diff --git a/src/config/character.config.js b/src/config/character.config.js index f234825..e9cdcbf 100644 --- a/src/config/character.config.js +++ b/src/config/character.config.js @@ -806,7 +806,7 @@ export const schedule = [ export const pageSizeOptions = ["10", "40", "100"]; ; -const colorList = ['#3AA9FF', '#F997DF', '#F9EF97'] +const colorList = ['#3AA9FF', '#F997DF', '#F9EF97', '#f40'] import utils from "@/config/utils" export const pieChartOption = { diff --git a/src/pages/InRoadMgm/EquipmentMgm/MonitorEquipment/loadable.jsx b/src/pages/InRoadMgm/EquipmentMgm/MonitorEquipment/loadable.jsx index 3713e29..aec96b1 100644 --- a/src/pages/InRoadMgm/EquipmentMgm/MonitorEquipment/loadable.jsx +++ b/src/pages/InRoadMgm/EquipmentMgm/MonitorEquipment/loadable.jsx @@ -274,16 +274,24 @@ function Fence(props) { } const handleSubmit = () => { if (editStatus) { // 编辑 - monitorEdit({...form.getFieldsValue(), id: editId}).then((msg) => { - message.success(msg || '监控设备更新成功') - setEditModalVisible(false) - getData() + form.validateFields().then(data => { + monitorEdit({...data, id: editId}).then((msg) => { + message.success(msg || '监控设备更新成功') + setEditModalVisible(false) + getData() + }) + }).catch(err => { + console.error(err) }) } else { // 新增 - monitorAdd(form.getFieldsValue()).then((msg) => { - message.success(msg || '监控设备添加成功') - setEditModalVisible(false) - getData() + form.validateFields().then(data => { + monitorAdd(data).then((msg) => { + message.success(msg || '监控设备添加成功') + setEditModalVisible(false) + getData() + }) + }).catch(err => { + console.error(err) }) } } diff --git a/src/pages/SystemMgm/AreaManage/loadable.jsx b/src/pages/SystemMgm/AreaManage/loadable.jsx index 88cfcf8..42a0d69 100644 --- a/src/pages/SystemMgm/AreaManage/loadable.jsx +++ b/src/pages/SystemMgm/AreaManage/loadable.jsx @@ -82,8 +82,8 @@ function AreaManage() { setModalAreaVisible(true) } - const handleAreaEdit = ({ name, id, virtually_code, code, lng_lat, type }) => { - setEditForm({ name, id, virtually_code, code, lng_lat, type }) + const handleAreaEdit = ({ name, id, virtually_code, code, lng, lat, type }) => { + setEditForm({ name, id, virtually_code, code, lng_lat: lng ? `${lng}, ${lat}` : "", type }) setEditStatus(true) setModalAreaVisible(true) } @@ -159,7 +159,7 @@ function AreaManage() { setModalAreaVisible(true) } } - const treeTitleRender = ({ name, children, level, pid, id, virtually_code, lng_lat, code, type }) => { + const treeTitleRender = ({ name, children, level, pid, id, virtually_code, lng, lat, code, type }) => { return <> {name} { @@ -171,14 +171,14 @@ function AreaManage() { level == 2 ? <> handleAreaAdd({ level, id, isCity: false })} /> handleAreaDel({ name, id, children })} /> - handleAreaEdit({ name, id, virtually_code, code, lng_lat, type })} /> + handleAreaEdit({ name, id, virtually_code, code, lng, lat, type })} /> : null } { level > 2 ? <> {/* handleAreaAdd({level, pid, isCity: false})} /> */} handleAreaDel({ name, id, children })} /> - handleAreaEdit({ name, id, virtually_code, code, lng_lat, type })} /> + handleAreaEdit({ name, id, virtually_code, code, lng, lat, type })} /> : null } diff --git a/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx b/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx index 32db69b..2c91799 100644 --- a/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx +++ b/src/pages/SystemMgm/OrgnizationMgm/loadable.jsx @@ -139,19 +139,19 @@ function OrgnizationMgm() { } const recursionFindIdPath = (data, id, path=[]) => { + path.push(item.id); // 将当前节点的name添加到路径中 for (let item of data) { if (item.id === id) { // 如果找到目标id,则返回当前路径 return path } - path.push(item.id); // 将当前节点的name添加到路径中 if (Array.isArray(item.children) && item.children.length > 0) { // 如果当前节点有子节点,则递归搜索子节点 const result = recursionFindIdPath(item.children, id, path); if (result) { // 如果在子节点中找到目标id,则返回结果 - return result; + return result } }