diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 211128b..789752d 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -281,7 +281,7 @@ const BasicLayout: React.FC = (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 = [] diff --git a/src/pages/travelMember/PointsRuleConfig/index.tsx b/src/pages/travelMember/PointsRuleConfig/index.tsx index eb74203..372dbd9 100644 --- a/src/pages/travelMember/PointsRuleConfig/index.tsx +++ b/src/pages/travelMember/PointsRuleConfig/index.tsx @@ -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 = (pr disabled={disabled} bounds={bounds} onStart={(event, uiData) => onDraggaleStart(event, uiData)} + handle='.pointsRuleConfig' >
{modal}
@@ -402,10 +411,23 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr > - { + 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, diff --git a/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx b/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx index 7ddd6a4..e649db3 100644 --- a/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx +++ b/src/pages/travelMember/serverpartInfo/components/serverpartInfo.tsx @@ -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) = { setSelectTab(e) }} items={areaTabList} /> - : - - - - - { - 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 - } - } - }} - /> - - - - + : '' } +
+ + + + + { + 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 + } + } + }} + /> + + + + +
+ +
0 && selectTab === areaTabList[0].key ? 'block' : 'none' }}> 面积相关 @@ -657,48 +661,51 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) =
1 && selectTab === areaTabList[1].key ? 'block' : 'none' }}> - {/* 对向信息 - - - - { - // 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 - } + {/* 对向信息 */} +
+ + + + { + // 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: res[1].value }) + } + }) + return res + } + } + }} + /> + + +
+ 面积相关 diff --git a/src/pages/travelMember/serverpartInfo/index.tsx b/src/pages/travelMember/serverpartInfo/index.tsx index ed96367..72933d3 100644 --- a/src/pages/travelMember/serverpartInfo/index.tsx +++ b/src/pages/travelMember/serverpartInfo/index.tsx @@ -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)