Browse Source

fix(): 路内问题处理

tags/PMS_Frontend_v1.0.6-develop
wanghx 1 year ago
parent
commit
72dc018544
  1. 2
      src/config/character.config.js
  2. 12
      src/pages/InRoadMgm/EquipmentMgm/MonitorEquipment/loadable.jsx
  3. 10
      src/pages/SystemMgm/AreaManage/loadable.jsx
  4. 4
      src/pages/SystemMgm/OrgnizationMgm/loadable.jsx

2
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 = {

12
src/pages/InRoadMgm/EquipmentMgm/MonitorEquipment/loadable.jsx

@ -274,17 +274,25 @@ function Fence(props) {
}
const handleSubmit = () => {
if (editStatus) { //
monitorEdit({...form.getFieldsValue(), id: editId}).then((msg) => {
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) => {
form.validateFields().then(data => {
monitorAdd(data).then((msg) => {
message.success(msg || '监控设备添加成功')
setEditModalVisible(false)
getData()
})
}).catch(err => {
console.error(err)
})
}
}
const [sessionTabList, setSessionTabList] = useSessionStorageState('monitorEquipment', {

10
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 <>
<span className='label-text'>{name}</span>
{
@ -171,14 +171,14 @@ function AreaManage() {
level == 2 ? <>
<PlusCircleOutlined className='label-icon' onClick={() => handleAreaAdd({ level, id, isCity: false })} />
<DeleteOutlined className="label-icon" onClick={() => handleAreaDel({ name, id, children })} />
<EditOutlined className="label-icon" onClick={() => handleAreaEdit({ name, id, virtually_code, code, lng_lat, type })} />
<EditOutlined className="label-icon" onClick={() => handleAreaEdit({ name, id, virtually_code, code, lng, lat, type })} />
</> : null
}
{
level > 2 ? <>
{/* <PlusCircleOutlined className='label-icon' onClick={() => handleAreaAdd({level, pid, isCity: false})} /> */}
<DeleteOutlined className="label-icon" onClick={() => handleAreaDel({ name, id, children })} />
<EditOutlined className="label-icon" onClick={() => handleAreaEdit({ name, id, virtually_code, code, lng_lat, type })} />
<EditOutlined className="label-icon" onClick={() => handleAreaEdit({ name, id, virtually_code, code, lng, lat, type })} />
</> : null
}
</>

4
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
}
}

Loading…
Cancel
Save