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

Loading…
Cancel
Save