update
This commit is contained in:
parent
0771f7dd3f
commit
f59a57b41b
@ -281,7 +281,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
|
||||
})
|
||||
|
||||
// 积分规则
|
||||
getFieldEnumTree({ FieldExplainField: 'POINT_TYPE' }).then((SCORETYPE: any) => {
|
||||
handleGetFieldEnumTreeTravel({ FieldExplainField: 'POINT_TYPE' }).then((SCORETYPE: any) => {
|
||||
if (SCORETYPE && SCORETYPE.length > 0) {
|
||||
const obj: any = {}
|
||||
const list: any = []
|
||||
|
||||
@ -9,7 +9,7 @@ import Draggable from 'react-draggable';
|
||||
import SubMenu from "antd/lib/menu/SubMenu";
|
||||
import ProTable from '@ant-design/pro-table';
|
||||
import ProDescriptions from '@ant-design/pro-descriptions';
|
||||
import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormUploadButton } from '@ant-design/pro-form';
|
||||
import ProForm, { ProFormDatePicker, ProFormDateTimePicker, ProFormMoney, ProFormSelect, ProFormText, ProFormTextArea, ProFormTreeSelect, ProFormUploadButton } from '@ant-design/pro-form';
|
||||
import { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
|
||||
import { PageContainer } from '@ant-design/pro-layout';
|
||||
import { Button, Col, Drawer, message, Row, Popconfirm, Space, Image, Modal, Form, Switch, Upload, Tooltip, Descriptions, TreeSelect } from 'antd';
|
||||
@ -39,6 +39,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
// 积分类型的枚举
|
||||
let SCORETYPEList = session.get('SCORETYPEList')
|
||||
let SCORETYPEObj = session.get('SCORETYPEObj')
|
||||
let SCORETYPETree = session.get('SCORETYPETree')
|
||||
|
||||
// 弹出框拖动效果
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
@ -67,8 +68,11 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
title: '积分类别',
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
valueType: 'select',
|
||||
valueEnum: SCORETYPEObj
|
||||
valueType: 'treeSelect',
|
||||
request: () => {
|
||||
return SCORETYPETree
|
||||
}
|
||||
// valueEnum: SCORETYPEObj
|
||||
},
|
||||
{
|
||||
dataIndex: 'SCORE_NAME',
|
||||
@ -261,6 +265,9 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
}
|
||||
}
|
||||
|
||||
console.log('reqreq', req);
|
||||
|
||||
|
||||
const data = await handleSynchroSCORESETTING(req)
|
||||
if (data.Result_Code === 100) {
|
||||
message.success(data.Result_Desc)
|
||||
@ -331,6 +338,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
<Modal
|
||||
title={
|
||||
<div
|
||||
className='pointsRuleConfig'
|
||||
style={{
|
||||
width: '100%',
|
||||
cursor: 'move',
|
||||
@ -374,6 +382,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
disabled={disabled}
|
||||
bounds={bounds}
|
||||
onStart={(event, uiData) => onDraggaleStart(event, uiData)}
|
||||
handle='.pointsRuleConfig'
|
||||
>
|
||||
<div ref={draggleRef}>{modal}</div>
|
||||
</Draggable>
|
||||
@ -402,10 +411,23 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={12}>
|
||||
<ProFormSelect
|
||||
{/* <ProFormSelect */}
|
||||
<ProFormTreeSelect
|
||||
name="SCORE_TYPE"
|
||||
label="积分类别"
|
||||
options={SCORETYPEList}
|
||||
request={async () => {
|
||||
return SCORETYPETree
|
||||
}}
|
||||
fieldProps={{
|
||||
placeholder: "请选择积分类别",
|
||||
treeDefaultExpandAll: true, // 默认展开所有节点
|
||||
showSearch: true, // 可选:启用搜索功能
|
||||
filterTreeNode: (inputValue: string, treeNode: any) => {
|
||||
// 通过label进行模糊匹配
|
||||
return treeNode.label.toLowerCase().includes(inputValue.toLowerCase());
|
||||
},
|
||||
}}
|
||||
// options={SCORETYPEList}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
|
||||
@ -125,7 +125,7 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) =
|
||||
formRef={formRef}
|
||||
autoFocusFirstInput
|
||||
submitter={false}
|
||||
preserve={false}
|
||||
preserve={true}
|
||||
request={async () => {
|
||||
if (currentRow?.SERVERPART_ID) {
|
||||
const req: any = {
|
||||
@ -358,47 +358,51 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) =
|
||||
<Tabs activeKey={selectTab} onChange={(e: any) => {
|
||||
setSelectTab(e)
|
||||
}} items={areaTabList} />
|
||||
</div> :
|
||||
<Row>
|
||||
<Col span={1}>
|
||||
</Col>
|
||||
<Col span={5}>
|
||||
<ProFormSelect
|
||||
label={"当前分区"}
|
||||
name={"currentArea"}
|
||||
disabled={serverPartType === 2 && currentRow?.currentArea}
|
||||
request={async () => {
|
||||
if (currentRow?.SERVERPART_ID) {
|
||||
const req: any = {
|
||||
ServerpartId: currentRow?.SERVERPART_ID
|
||||
}
|
||||
const regData = await handleNewGetSERVERPARTDetail(req)
|
||||
const list: any = regData.ServerPartInfo
|
||||
|
||||
console.log('regData', regData);
|
||||
console.log('formDetailAll', formDetailAll);
|
||||
|
||||
if (list && list.length > 0) {
|
||||
const obj: any = session.get('shopregionObj')
|
||||
const res: any = []
|
||||
list.forEach((item: any) => {
|
||||
if (item.SERVERPART_REGION) {
|
||||
res.push({ label: obj[item.SERVERPART_REGION], value: item.SERVERPART_REGION })
|
||||
}
|
||||
})
|
||||
console.log('res', res);
|
||||
formRef.current?.setFieldsValue({ currentArea: res[0].value })
|
||||
return res
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={17}>
|
||||
</Col>
|
||||
</Row>
|
||||
</div> : ''
|
||||
}
|
||||
|
||||
<div style={{ display: 'none' }}>
|
||||
<Row>
|
||||
<Col span={1}>
|
||||
</Col>
|
||||
<Col span={5}>
|
||||
<ProFormSelect
|
||||
label={"当前分区"}
|
||||
name={"currentArea"}
|
||||
disabled={serverPartType === 2 && currentRow?.currentArea}
|
||||
request={async () => {
|
||||
if (currentRow?.SERVERPART_ID) {
|
||||
const req: any = {
|
||||
ServerpartId: currentRow?.SERVERPART_ID
|
||||
}
|
||||
const regData = await handleNewGetSERVERPARTDetail(req)
|
||||
const list: any = regData.ServerPartInfo
|
||||
|
||||
console.log('regData', regData);
|
||||
console.log('formDetailAll222', formDetailAll);
|
||||
|
||||
if (list && list.length > 0) {
|
||||
const obj: any = session.get('shopregionObj')
|
||||
const res: any = []
|
||||
list.forEach((item: any) => {
|
||||
if (item.SERVERPART_REGION) {
|
||||
res.push({ label: obj[item.SERVERPART_REGION], value: item.SERVERPART_REGION })
|
||||
}
|
||||
})
|
||||
console.log('res', res);
|
||||
formRef.current?.setFieldsValue({ currentArea: res[0].value })
|
||||
return res
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={17}>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div style={{ display: areaTabList && areaTabList.length > 0 && selectTab === areaTabList[0].key ? 'block' : 'none' }}>
|
||||
<Divider orientation="left">面积相关</Divider>
|
||||
@ -657,48 +661,51 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) =
|
||||
</div>
|
||||
|
||||
<div style={{ display: areaTabList && areaTabList.length > 1 && selectTab === areaTabList[1].key ? 'block' : 'none' }}>
|
||||
{/* <Divider orientation="left">对向信息</Divider>
|
||||
<Row>
|
||||
<Col span={1}></Col>
|
||||
<Col span={5}>
|
||||
<ProFormSelect
|
||||
label={"对向分区"}
|
||||
name={"otherArea"}
|
||||
disabled={currentRow?.otherArea}
|
||||
request={async () => {
|
||||
// let list = session.get('shopregionList')
|
||||
// return list
|
||||
if (currentRow?.SERVERPART_ID) {
|
||||
const req: any = {
|
||||
ServerpartId: currentRow?.SERVERPART_ID
|
||||
}
|
||||
const regData = await handleNewGetSERVERPARTDetail(req)
|
||||
const list: any = regData.ServerPartInfo
|
||||
console.log('list', list);
|
||||
|
||||
if (list && list.length > 0) {
|
||||
const obj: any = session.get('shopregionObj')
|
||||
|
||||
const res: any = []
|
||||
list.forEach((item: any) => {
|
||||
if (item.SERVERPART_REGION) {
|
||||
res.push({ label: obj[item.SERVERPART_REGION], value: item.SERVERPART_REGION })
|
||||
}
|
||||
})
|
||||
console.log('res', res);
|
||||
const other: any = formRef.current?.getFieldValue('currentArea')
|
||||
res.forEach((item: any) => {
|
||||
if (Number(item.value) !== Number(other)) {
|
||||
formRef.current?.setFieldsValue({ otherArea: item.value })
|
||||
}
|
||||
})
|
||||
return res
|
||||
}
|
||||
{/* <Divider orientation="left">对向信息</Divider> */}
|
||||
<div style={{ display: 'none' }}>
|
||||
<Row>
|
||||
<Col span={1}></Col>
|
||||
<Col span={5}>
|
||||
<ProFormSelect
|
||||
label={"对向分区"}
|
||||
name={"otherArea"}
|
||||
disabled={currentRow?.otherArea}
|
||||
request={async () => {
|
||||
// let list = session.get('shopregionList')
|
||||
// return list
|
||||
if (currentRow?.SERVERPART_ID) {
|
||||
const req: any = {
|
||||
ServerpartId: currentRow?.SERVERPART_ID
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row> */}
|
||||
const regData = await handleNewGetSERVERPARTDetail(req)
|
||||
const list: any = regData.ServerPartInfo
|
||||
console.log('list', list);
|
||||
|
||||
if (list && list.length > 0) {
|
||||
const obj: any = session.get('shopregionObj')
|
||||
|
||||
const res: any = []
|
||||
list.forEach((item: any) => {
|
||||
if (item.SERVERPART_REGION) {
|
||||
res.push({ label: obj[item.SERVERPART_REGION], value: item.SERVERPART_REGION })
|
||||
}
|
||||
})
|
||||
console.log('res', res);
|
||||
const other: any = formRef.current?.getFieldValue('currentArea')
|
||||
res.forEach((item: any) => {
|
||||
if (Number(item.value) !== Number(other)) {
|
||||
formRef.current?.setFieldsValue({ otherArea: res[1].value })
|
||||
}
|
||||
})
|
||||
return res
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
<Divider orientation="left">面积相关</Divider>
|
||||
<Row>
|
||||
<Col span={8}>
|
||||
|
||||
@ -139,6 +139,7 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
let formDetailAll: any = serverPartRef.current?.formDetailAll
|
||||
console.log('formDetailAll', formDetailAll);
|
||||
|
||||
|
||||
// 把分区的数据取出来
|
||||
let objA: any = {
|
||||
SERVERPART_REGION: res?.currentArea,
|
||||
@ -177,10 +178,17 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
})
|
||||
} else {
|
||||
if (objB.SERVERPART_REGION) {
|
||||
objB.SERVERPARTINFO_ID = detailServerPartList.length[0].SERVERPARTINFO_ID
|
||||
objB.SERVERPART_ID = currenMenu
|
||||
objB.GREENSPACEAREA = detailServerPartList.length[0].GREENSPACEAREA
|
||||
objB.SCENICAREA = detailServerPartList.length[0].SCENICAREA
|
||||
}
|
||||
}
|
||||
|
||||
console.log('objA', objA);
|
||||
console.log('objB', objB);
|
||||
|
||||
|
||||
|
||||
const req: any = {
|
||||
SERVERPART_ID: detailObj?.SERVERPART_ID,
|
||||
@ -255,6 +263,7 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
ServerPartInfo: objB.SERVERPART_REGION ? [objA, objB] : [objA]
|
||||
}
|
||||
console.log('req', req);
|
||||
|
||||
const data = await handleSynchroSERVERPART(req)
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user