Browse Source

*大屏运营公交车辆信息接口路线新增及条件过滤判断

release_0.0.4
wanyiwei 3 years ago
parent
commit
1267cb4f15
  1. 82
      web/client/src/sections/quanju/containers/footer/operation/left.js

82
web/client/src/sections/quanju/containers/footer/operation/left.js

@ -39,9 +39,10 @@ const Left = (props) => {
};
const loop = (treeData) =>
treeData.map((item) => {
const index = item.title.indexOf(searchValue);
const beforeStr = item.title.substr(0, index);
const afterStr = item.title.substr(index + searchValue.length);
// console.log(item,'===> item -----');
const index = item.title != null && item.title.indexOf(searchValue);
const beforeStr = item.title != null && item.title.substr(0, index);
const afterStr = item.title != null && item.title.substr(index + searchValue.length);
const title =
index > -1 ? (
<span>
@ -75,47 +76,52 @@ const Left = (props) => {
let busTierList = []
let busTierOpen = []
let dataList = []
busTier && busTier.data && busTier.data.forEach((e, index) => {
if (index == 0) {
busTierOpen.push(e.name)
}
busTierList.push({
key: e.name,
title: e.name,
children: e.child.map(s => {
return {
key: s.name,
title: s.name,
children: s.child.map(i => {
return {
key: i.vehicleLicensePlateNumber,
title: i.vehicleLicensePlateNumber,
}
})
}
let busTierNewList = []
if (busTier && busTier.data && busTier.data.length > 0) {
busTierNewList.push(busTier && busTier.data && busTier.data[0])
}
if (busTierNewList.length > 0) {
busTierNewList.forEach((e, index) => {
if (index == 0) {
busTierOpen.push(e.name)
}
busTierList.push({
key: e.name,
title: e.name,
children: e.child.map(s => {
return {
key: s.name,
title: s.name,
children: s.child.map(i => {
return {
key: i.name,
title: i.name,
children: i.child.map(x => {
return {
key: x.name,
title: x.name,
}
})
}
})
}
})
})
})
})
busTier && busTier.data && busTier.data.forEach(e => {
dataList.push({
key: e.name,
title: e.name,
})
e.child.forEach(i => {
dataList.push({
key: i.name,
title: i.name,
})
i.child.forEach(s => {
dataList.push({
key: s.vehicleLicensePlateNumber,
title: s.vehicleLicensePlateNumber,
busTierNewList.forEach(e => {
e.child.forEach(i => {
i.child.forEach(s => {
s.child.forEach(x => {
dataList.push({
key: x.name,
title: x.name
})
})
})
})
})
})
}
setTreeData(busTierList)
setExpandedKeys(busTierOpen)
setTreeDataList(dataList)

Loading…
Cancel
Save