Commit 2de65965 authored by 皮倩雯's avatar 皮倩雯

fix: '巡检反馈GIS图层修改为下拉选择树'

parent 17c15cc0
Pipeline #65013 failed with stages
...@@ -28,6 +28,7 @@ import { ...@@ -28,6 +28,7 @@ import {
CM_Feedback_LoadFields, CM_Feedback_LoadFields,
CM_Feedback_QueryPatrolFeedback, CM_Feedback_QueryPatrolFeedback,
GetTaskSyncField, GetTaskSyncField,
GetGisPatrolObject,
} from '@/services/PatrolFeedback/api'; } from '@/services/PatrolFeedback/api';
import { import {
GetCM_Event_LoadEventTable, GetCM_Event_LoadEventTable,
...@@ -66,6 +67,8 @@ const AddModal = props => { ...@@ -66,6 +67,8 @@ const AddModal = props => {
const [keepAllData, setKeepAllData] = useState([]); // 保存所有关联事件类型数据 const [keepAllData, setKeepAllData] = useState([]); // 保存所有关联事件类型数据
const [keepTree, setKeepTree] = useState([]); const [keepTree, setKeepTree] = useState([]);
const [keepAll, setKeepAll] = useState([]); // 保存所选关联事件下完整的字段值 const [keepAll, setKeepAll] = useState([]); // 保存所选关联事件下完整的字段值
const [treeSelectValue, setTreeSelectValue] = useState([]);
const [menuWebList, setMenuWebList] = useState([]);
const [form] = Form.useForm(); const [form] = Form.useForm();
const [formAdd] = Form.useForm(); const [formAdd] = Form.useForm();
...@@ -74,6 +77,7 @@ const AddModal = props => { ...@@ -74,6 +77,7 @@ const AddModal = props => {
useEffect(() => { useEffect(() => {
getEventData(); // 获取所有关联事件数据 getEventData(); // 获取所有关联事件数据
getGisPatrolObject();
if (visible) { if (visible) {
if (type === 'edit') { if (type === 'edit') {
CM_Feedback_QueryPatrolFeedback({ id: formObj.id }).then(res => { CM_Feedback_QueryPatrolFeedback({ id: formObj.id }).then(res => {
...@@ -142,6 +146,21 @@ const AddModal = props => { ...@@ -142,6 +146,21 @@ const AddModal = props => {
}); });
}; };
const getGisPatrolObject = () => {
GetGisPatrolObject().then(res => {
if (res.code === '0') {
setMenuWebList(res.data);
} else {
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
console.log(res);
});
};
const getReloadTableField = (e, i) => { const getReloadTableField = (e, i) => {
reloadTableFields({ reloadTableFields({
tableName: e, tableName: e,
...@@ -579,10 +598,10 @@ const AddModal = props => { ...@@ -579,10 +598,10 @@ const AddModal = props => {
}; };
const mapTree = org => { const mapTree = org => {
const haveChildren = Array.isArray(org.children) && org.children.length > 0; const haveChildren = Array.isArray(org.items) && org.items.length > 0;
return haveChildren ? ( return haveChildren ? (
<TreeNode value={`123${org.name}`} title={org.name} disabled> <TreeNode value={org.serverName} title={org.serverName} disabled>
{org.children.map(item => mapTree(item))} {org.items.map(item => mapTree(item))}
</TreeNode> </TreeNode>
) : ( ) : (
<TreeNode value={org.name} title={org.name} /> <TreeNode value={org.name} title={org.name} />
...@@ -641,6 +660,10 @@ const AddModal = props => { ...@@ -641,6 +660,10 @@ const AddModal = props => {
// setKeepTree(data); // setKeepTree(data);
}; };
const treeSelectOnchange = e => {
setTreeSelectValue(e);
};
return ( return (
<Drawer <Drawer
title="反馈配置" title="反馈配置"
...@@ -703,7 +726,22 @@ const AddModal = props => { ...@@ -703,7 +726,22 @@ const AddModal = props => {
</Col> </Col>
<Col span={23}> <Col span={23}>
<Item label="GIS图层" name="gisLayer" labelCol={{ span: 4 }}> <Item label="GIS图层" name="gisLayer" labelCol={{ span: 4 }}>
<Input placeholder="请输入GIS图层" /> <TreeSelect
showSearch
value={treeSelectValue}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择映射字段名 "
allowClear
treeDefaultExpandAll
showCheckedStrategy
onChange={treeSelectOnchange}
>
{menuWebList ? (
menuWebList.map(i => mapTree(i))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect>
</Item> </Item>
</Col> </Col>
<Col span={23}> <Col span={23}>
...@@ -858,23 +896,6 @@ const AddModal = props => { ...@@ -858,23 +896,6 @@ const AddModal = props => {
)) ))
: ''} : ''}
</Select> </Select>
{/* <TreeSelect
showSearch
style={{ width: '159px', marginLeft: '4px' }}
// value={treeSelectValue}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
placeholder="请选择映射字段名 "
allowClear
treeDefaultExpandAll
showCheckedStrategy
// onChange={treeSelectOnchange}
>
{keepTree ? (
keepTree.map(i => mapTree(i))
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</TreeSelect> */}
</Form.Item> </Form.Item>
<MinusCircleOutlined <MinusCircleOutlined
onClick={() => remove(name)} onClick={() => remove(name)}
......
...@@ -47,3 +47,5 @@ export const CM_Feedback_ChangPatrolOrder = patrolOrder => ...@@ -47,3 +47,5 @@ export const CM_Feedback_ChangPatrolOrder = patrolOrder =>
// 任务同步事件字段 // 任务同步事件字段
export const GetTaskSyncField = query => export const GetTaskSyncField = query =>
get(`${PANDA_GIS}/PatrolInspection/GetTaskSyncField`, query); get(`${PANDA_GIS}/PatrolInspection/GetTaskSyncField`, query);
export const GetGisPatrolObject = query => get(`${PANDA_GIS}/MapLayer/GetGisPatrolObject`, query);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment