Browse Source

fix():修改路内BUG

tags/PMS_V1.0.0_Alpha5
guoxin 1 year ago
parent
commit
776db4072c
  1. 4
      src/components/TableModule/index.jsx
  2. 4
      src/pages/InRoadMgm/PersonMgm/Attendance/Fence/loadable.jsx
  3. 4
      src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx

4
src/components/TableModule/index.jsx

@ -314,14 +314,16 @@ const TableModule = forwardRef((props, ref) => {
let last = options[options.length - 1]; let last = options[options.length - 1];
if (last.children) { if (last.children) {
addChild(last, res); addChild(last, res);
} else {
res = [last.id]
} }
res.push(last.id);
} }
console.log(res); console.log(res);
setAreaSelectedList(res); setAreaSelectedList(res);
} }
const addChild = (child, res) => { const addChild = (child, res) => {
if (child.children) { if (child.children) {
res.push(child.id)
child.children.forEach((item) => { child.children.forEach((item) => {
addChild(item, res); addChild(item, res);
}); });

4
src/pages/InRoadMgm/PersonMgm/Attendance/Fence/loadable.jsx

@ -69,8 +69,9 @@ function Fence(props) {
let last = options[options.length - 1]; let last = options[options.length - 1];
if (last.children) { if (last.children) {
addChild(last, res); addChild(last, res);
}else {
res = [last.id]
} }
res.push(last.id);
} }
console.log(res); console.log(res);
setAreaSelectedList(res); setAreaSelectedList(res);
@ -78,6 +79,7 @@ function Fence(props) {
} }
const addChild = (child, res) => { const addChild = (child, res) => {
if (child.children) { if (child.children) {
res.push(child.id)
child.children.forEach((item) => { child.children.forEach((item) => {
addChild(item, res); addChild(item, res);
}); });

4
src/pages/InRoadMgm/Stuff/StuffMgm/loadable.jsx

@ -79,8 +79,9 @@ function StuffMgm(props) {
let last = options[options.length - 1]; let last = options[options.length - 1];
if (last.children) { if (last.children) {
addChild(last, res); addChild(last, res);
} else {
res = [last.id]
} }
res.push(last.id);
} }
setGetOption(res) setGetOption(res)
setFormData({ ...formData, region_id: value }) setFormData({ ...formData, region_id: value })
@ -363,6 +364,7 @@ function StuffMgm(props) {
] ]
const addChild = (child, res) => { const addChild = (child, res) => {
if (child.children) { if (child.children) {
res.push(child.id)
child.children.forEach((item) => { child.children.forEach((item) => {
addChild(item, res); addChild(item, res);
}); });

Loading…
Cancel
Save