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. 24
      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"]; export const pageSizeOptions = ["10", "40", "100"];
; ;
const colorList = ['#3AA9FF', '#F997DF', '#F9EF97']
const colorList = ['#3AA9FF', '#F997DF', '#F9EF97', '#f40']
import utils from "@/config/utils" import utils from "@/config/utils"
export const pieChartOption = { export const pieChartOption = {

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

@ -274,16 +274,24 @@ function Fence(props) {
} }
const handleSubmit = () => { const handleSubmit = () => {
if (editStatus) { // 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 { // } 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)
}) })
} }
} }

10
src/pages/SystemMgm/AreaManage/loadable.jsx

@ -82,8 +82,8 @@ function AreaManage() {
setModalAreaVisible(true) 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) setEditStatus(true)
setModalAreaVisible(true) setModalAreaVisible(true)
} }
@ -159,7 +159,7 @@ function AreaManage() {
setModalAreaVisible(true) 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 <> return <>
<span className='label-text'>{name}</span> <span className='label-text'>{name}</span>
{ {
@ -171,14 +171,14 @@ function AreaManage() {
level == 2 ? <> level == 2 ? <>
<PlusCircleOutlined className='label-icon' onClick={() => handleAreaAdd({ level, id, isCity: false })} /> <PlusCircleOutlined className='label-icon' onClick={() => handleAreaAdd({ level, id, isCity: false })} />
<DeleteOutlined className="label-icon" onClick={() => handleAreaDel({ name, id, children })} /> <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 </> : null
} }
{ {
level > 2 ? <> level > 2 ? <>
{/* <PlusCircleOutlined className='label-icon' onClick={() => handleAreaAdd({level, pid, isCity: false})} /> */} {/* <PlusCircleOutlined className='label-icon' onClick={() => handleAreaAdd({level, pid, isCity: false})} /> */}
<DeleteOutlined className="label-icon" onClick={() => handleAreaDel({ name, id, children })} /> <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 </> : null
} }
</> </>

4
src/pages/SystemMgm/OrgnizationMgm/loadable.jsx

@ -139,19 +139,19 @@ function OrgnizationMgm() {
} }
const recursionFindIdPath = (data, id, path=[]) => { const recursionFindIdPath = (data, id, path=[]) => {
path.push(item.id); // name
for (let item of data) { for (let item of data) {
if (item.id === id) { if (item.id === id) {
// id // id
return path return path
} }
path.push(item.id); // name
if (Array.isArray(item.children) && item.children.length > 0) { if (Array.isArray(item.children) && item.children.length > 0) {
// //
const result = recursionFindIdPath(item.children, id, path); const result = recursionFindIdPath(item.children, id, path);
if (result) { if (result) {
// id // id
return result;
return result
} }
} }

Loading…
Cancel
Save