This commit is contained in:
ylj20011123 2025-07-10 20:47:10 +08:00
parent 0771f7dd3f
commit f59a57b41b
4 changed files with 125 additions and 87 deletions

View File

@ -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) { if (SCORETYPE && SCORETYPE.length > 0) {
const obj: any = {} const obj: any = {}
const list: any = [] const list: any = []

View File

@ -9,7 +9,7 @@ import Draggable from 'react-draggable';
import SubMenu from "antd/lib/menu/SubMenu"; import SubMenu from "antd/lib/menu/SubMenu";
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions'; 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 { MenuFoldOutlined, PlusOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
import { PageContainer } from '@ant-design/pro-layout'; 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'; 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 SCORETYPEList = session.get('SCORETYPEList')
let SCORETYPEObj = session.get('SCORETYPEObj') let SCORETYPEObj = session.get('SCORETYPEObj')
let SCORETYPETree = session.get('SCORETYPETree')
// 弹出框拖动效果 // 弹出框拖动效果
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置 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: '积分类别', title: '积分类别',
align: 'center', align: 'center',
hideInSearch: true, hideInSearch: true,
valueType: 'select', valueType: 'treeSelect',
valueEnum: SCORETYPEObj request: () => {
return SCORETYPETree
}
// valueEnum: SCORETYPEObj
}, },
{ {
dataIndex: 'SCORE_NAME', dataIndex: 'SCORE_NAME',
@ -261,6 +265,9 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
} }
} }
console.log('reqreq', req);
const data = await handleSynchroSCORESETTING(req) const data = await handleSynchroSCORESETTING(req)
if (data.Result_Code === 100) { if (data.Result_Code === 100) {
message.success(data.Result_Desc) message.success(data.Result_Desc)
@ -331,6 +338,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
<Modal <Modal
title={ title={
<div <div
className='pointsRuleConfig'
style={{ style={{
width: '100%', width: '100%',
cursor: 'move', cursor: 'move',
@ -374,6 +382,7 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
disabled={disabled} disabled={disabled}
bounds={bounds} bounds={bounds}
onStart={(event, uiData) => onDraggaleStart(event, uiData)} onStart={(event, uiData) => onDraggaleStart(event, uiData)}
handle='.pointsRuleConfig'
> >
<div ref={draggleRef}>{modal}</div> <div ref={draggleRef}>{modal}</div>
</Draggable> </Draggable>
@ -402,10 +411,23 @@ const PointsRuleConfig: React.FC<{ currentUser: CurrentUser | undefined }> = (pr
> >
<Row gutter={8}> <Row gutter={8}>
<Col span={12}> <Col span={12}>
<ProFormSelect {/* <ProFormSelect */}
<ProFormTreeSelect
name="SCORE_TYPE" name="SCORE_TYPE"
label="积分类别" 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={[ rules={[
{ {
required: true, required: true,

View File

@ -125,7 +125,7 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) =
formRef={formRef} formRef={formRef}
autoFocusFirstInput autoFocusFirstInput
submitter={false} submitter={false}
preserve={false} preserve={true}
request={async () => { request={async () => {
if (currentRow?.SERVERPART_ID) { if (currentRow?.SERVERPART_ID) {
const req: any = { const req: any = {
@ -358,47 +358,51 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) =
<Tabs activeKey={selectTab} onChange={(e: any) => { <Tabs activeKey={selectTab} onChange={(e: any) => {
setSelectTab(e) setSelectTab(e)
}} items={areaTabList} /> }} items={areaTabList} />
</div> : </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 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' }}> <div style={{ display: areaTabList && areaTabList.length > 0 && selectTab === areaTabList[0].key ? 'block' : 'none' }}>
<Divider orientation="left"></Divider> <Divider orientation="left"></Divider>
@ -657,48 +661,51 @@ const SERVERPARTTable = ({ currentRow, onShow, onRef, pageType }: DetailProps) =
</div> </div>
<div style={{ display: areaTabList && areaTabList.length > 1 && selectTab === areaTabList[1].key ? 'block' : 'none' }}> <div style={{ display: areaTabList && areaTabList.length > 1 && selectTab === areaTabList[1].key ? 'block' : 'none' }}>
{/* <Divider orientation="left"></Divider> {/* <Divider orientation="left">对向信息</Divider> */}
<Row> <div style={{ display: 'none' }}>
<Col span={1}></Col> <Row>
<Col span={5}> <Col span={1}></Col>
<ProFormSelect <Col span={5}>
label={"对向分区"} <ProFormSelect
name={"otherArea"} label={"对向分区"}
disabled={currentRow?.otherArea} name={"otherArea"}
request={async () => { disabled={currentRow?.otherArea}
// let list = session.get('shopregionList') request={async () => {
// return list // let list = session.get('shopregionList')
if (currentRow?.SERVERPART_ID) { // return list
const req: any = { if (currentRow?.SERVERPART_ID) {
ServerpartId: 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
}
} }
}} const regData = await handleNewGetSERVERPARTDetail(req)
/> const list: any = regData.ServerPartInfo
</Col> console.log('list', list);
</Row> */}
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> <Divider orientation="left"></Divider>
<Row> <Row>
<Col span={8}> <Col span={8}>

View File

@ -139,6 +139,7 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
let formDetailAll: any = serverPartRef.current?.formDetailAll let formDetailAll: any = serverPartRef.current?.formDetailAll
console.log('formDetailAll', formDetailAll); console.log('formDetailAll', formDetailAll);
// 把分区的数据取出来 // 把分区的数据取出来
let objA: any = { let objA: any = {
SERVERPART_REGION: res?.currentArea, SERVERPART_REGION: res?.currentArea,
@ -177,10 +178,17 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
}) })
} else { } else {
if (objB.SERVERPART_REGION) { if (objB.SERVERPART_REGION) {
objB.SERVERPARTINFO_ID = detailServerPartList.length[0].SERVERPARTINFO_ID
objB.SERVERPART_ID = currenMenu 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 = { const req: any = {
SERVERPART_ID: detailObj?.SERVERPART_ID, SERVERPART_ID: detailObj?.SERVERPART_ID,
@ -255,6 +263,7 @@ const serverpartInfo: React.FC<{ currentUser: CurrentUser }> = (props) => {
ServerPartInfo: objB.SERVERPART_REGION ? [objA, objB] : [objA] ServerPartInfo: objB.SERVERPART_REGION ? [objA, objB] : [objA]
} }
console.log('req', req); console.log('req', req);
const data = await handleSynchroSERVERPART(req) const data = await handleSynchroSERVERPART(req)