diff --git a/web/client/index.ejs b/web/client/index.ejs index a91dbdd7..0d79375c 100644 --- a/web/client/index.ejs +++ b/web/client/index.ejs @@ -15,6 +15,7 @@ } + diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index d8101bda..2f46b175 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -4,7 +4,7 @@ import { Spin, Button, Popconfirm, Badge } from 'antd'; import ProTable from '@ant-design/pro-table'; import './protable.less' import moment from 'moment'; -import { getBridge, getProject,delBridge,delProject } from "../actions/infor" +import { getBridge, getProject, delBridge, delProject } from "../actions/infor" import UserModal from './infor/details'; import ProjectModal from './project/project'; @@ -26,7 +26,23 @@ const BrideTable = (props) => { const [delet, setDelet] = useState() const ref = useRef() - useEffect(() => { ref.current.reload() }, [whichofits,delet]) + useEffect(() => { ref.current.reload() }, [whichofits, delet]) + const deldata = (id) => { // 桥梁 + const query = { + bridgeId: id + } + dispatch(delBridge(query)).then((res) => { + setDelet(res) + }) + } + const deldatas = (id) => { // 工程 + const query = { + projectId: id + } + dispatch(delProject(query)).then((res) => { + setDelet(res) + }) + } const columns = { tab1: [ { @@ -1493,16 +1509,10 @@ const BrideTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 + { deldata(record.id) }}> + + } }, @@ -1683,16 +1693,9 @@ const BrideTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldatas(record.id) }}> + + } }, @@ -1809,20 +1812,20 @@ const BrideTable = (props) => { dataSource={counts || []} request={async (params) => { - if(whichofits=='qiaoliang'){ + if (whichofits == 'qiaoliang') { const query = { - bridgeName:sitename + bridgeName: sitename } setRowSelected([]); const res = await dispatch(getBridge(query)); // console.log(res) - + setCounts(res.payload.data) return { ...res, total: res.payload.data ? res.payload.data.count : 0 } - }if(whichofits=='gongcheng'){ + } if (whichofits == 'gongcheng') { const query = { type: 'bridge', // type:sitename @@ -1835,7 +1838,7 @@ const BrideTable = (props) => { total: res.payload.data ? res.payload.data.count : 0 } } - + }} search={{ defaultCollapsed: false, diff --git a/web/client/src/sections/fillion/components/highways/highwaysdata.js b/web/client/src/sections/fillion/components/highways/highwaysdata.js index 0ced59c2..854781da 100644 --- a/web/client/src/sections/fillion/components/highways/highwaysdata.js +++ b/web/client/src/sections/fillion/components/highways/highwaysdata.js @@ -3,7 +3,7 @@ import { connect } from 'react-redux'; import { Form, Spin, Table } from 'antd'; import { ModalForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form'; import { putOperaTional,putHighways } from "../../actions/infor" -import { _ } from 'lodash' +import _ from 'lodash' const HightModal = (props) => { const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd,setDelet } = props diff --git a/web/client/src/sections/fillion/components/infor/details.js b/web/client/src/sections/fillion/components/infor/details.js index 26e32560..73b24c7d 100644 --- a/web/client/src/sections/fillion/components/infor/details.js +++ b/web/client/src/sections/fillion/components/infor/details.js @@ -155,15 +155,14 @@ const UserModal = (props) => { setDelet(values) const query = { ...values, level: whichofits, roadId: records?.[0]?.value || '' } dispatch(putRoadway(query)).then((res) => { - setSuccess(res.success) - + }) return true } else { setDelet(values) const query = { ...values, level: whichofits } dispatch(putRoadway(query)).then((res) => { - setSuccess(res.success) + }) return true @@ -174,14 +173,14 @@ const UserModal = (props) => { setDelet(values) const query = { ...values, roadId: records?.[0]?.value || '' } dispatch(putBridge(query)).then((res) => { - setSuccess(res.success) + }) return true } else { setDelet(values) const query = { ...values } dispatch(putBridge(query)).then((res) => { - setSuccess(res.success) + }) return true } @@ -189,16 +188,16 @@ const UserModal = (props) => { if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { if (typecard == '111') { setDelet(values) - const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys === 'chuzu' ? '出租车' : '危货' } + const query = { ...values, vehicleId: records?.[0]?.value || '', type: rewkeys == 'chuzu' ? '出租车' : '危货' } dispatch(putSpecificVehicle(query)).then((res) => { - setSuccess(res.success) + }) return true } else { setDelet(values) - const query = { ...values, type: rewkeys } + const query = { ...values, type: rewkeys == 'chuzu' ? '出租车' : '危货' } dispatch(putSpecificVehicle(query)).then((res) => { - setSuccess(res.success) + }) return true } @@ -208,14 +207,14 @@ const UserModal = (props) => { setDelet(values) const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' } dispatch(putHouseholds(query)).then((res) => { - setSuccess(res.success) + }) return true } else { setDelet(values) const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' } dispatch(putHouseholds(query)).then((res) => { - setSuccess(res.success) + }) return true } @@ -224,14 +223,14 @@ const UserModal = (props) => { setDelet(values) const query = { ...values, lineId: records?.[0]?.value || '' } dispatch(putCircuit(query)).then((res) => { - setSuccess(res.success) + }) return true } else { setDelet(values) const query = { ...values } dispatch(putCircuit(query)).then((res) => { - setSuccess(res.success) + }) return true } @@ -241,14 +240,14 @@ const UserModal = (props) => { setDelet(values) const query = { ...values, carId: records?.[0]?.value || '' } dispatch(putVehicle(query)).then((res) => { - setSuccess(res.success) + }) return true } else { setDelet(values) const query = { ...values } dispatch(putVehicle(query)).then((res) => { - setSuccess(res.success) + }) return true } @@ -258,7 +257,7 @@ const UserModal = (props) => { setDelet(values) const query = { ...values, overspeedId: records?.[0]?.value || '' } dispatch(putPurchase(query)).then((res) => { - setSuccess(res.success) + setMonitor(res) }) return true @@ -266,7 +265,7 @@ const UserModal = (props) => { setDelet(values) const query = { ...values } dispatch(putPurchase(query)).then((res) => { - setSuccess(res.success) + setMonitor(res) }) return true diff --git a/web/client/src/sections/fillion/components/inforTable.js b/web/client/src/sections/fillion/components/inforTable.js index 00ceafb7..11b05946 100644 --- a/web/client/src/sections/fillion/components/inforTable.js +++ b/web/client/src/sections/fillion/components/inforTable.js @@ -51,6 +51,14 @@ const InForTable = (props) => { `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) }) } + const deldata = (id) => { // 治超删除 + const query = { + overspeedId: id + } + dispatch(delPurchase(query)).then((res) => { + setDelet(res) + }) + } const columns = [ { @@ -364,16 +372,11 @@ const InForTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 + + { deldata(record.id) }}> + + } }, @@ -438,8 +441,8 @@ const InForTable = (props) => { request={async (params) => { console.log(params) const query = { - limit:params.pageSize, - page:params.current-1, + limit: params.pageSize, + page: params.current - 1, nameOfInspectionPoint: nameOfInspectionPoint, licensePlate: licensePlate, numberOfAxles: numberOfAxles, diff --git a/web/client/src/sections/fillion/components/operationalTable.js b/web/client/src/sections/fillion/components/operationalTable.js index 5df036be..119e1629 100644 --- a/web/client/src/sections/fillion/components/operationalTable.js +++ b/web/client/src/sections/fillion/components/operationalTable.js @@ -1,9 +1,9 @@ -import React, { useEffect, useState,useRef } from 'react'; +import React, { useEffect, useState, useRef } from 'react'; import { connect } from 'react-redux'; import { Spin, Button, Popconfirm, Badge } from 'antd'; import ProTable from '@ant-design/pro-table'; import './protable.less' -import { getOperaTional, getSpecificVehicle, getHouseholds,delSpecificVehicle,delHouseholds } from "../actions/infor" +import { getOperaTional, getSpecificVehicle, getHouseholds, delSpecificVehicle, delHouseholds } from "../actions/infor" import UserModal from './infor/details'; import HightModal from './highways/highwaysdata'; @@ -24,7 +24,7 @@ const OperaTionalTable = (props) => { const [delet, setDelet] = useState() const ref = useRef() - useEffect(() => { ref.current.reload() }, [rewkeys,activeKey,delet]) + useEffect(() => { ref.current.reload() }, [rewkeys, activeKey, delet]) //打开弹窗 const openModal = (type, record) => { setModalVisible(true); @@ -35,6 +35,23 @@ const OperaTionalTable = (props) => { setModalRecord(null); } } + const deldata = (id) => { // 出租危货 + const query = { + vehicleId: id + } + dispatch(delSpecificVehicle(query)).then((res) => { + setDelet(res) + }) + } + + const deldatas = (id) => { // 业户 + const query = { + businessId: id + } + dispatch(delHouseholds(query)).then((res) => { + setDelet(res) + }) + } //打开弹窗 const hightModal = (type, record) => { setModalVisibleyilan(true); @@ -73,7 +90,7 @@ const OperaTionalTable = (props) => { search: false, fieldProps: { - + placeholder: '请输入道路名称进行搜索', getPopupContainer: (triggerNode) => triggerNode.parentNode, }, @@ -132,7 +149,7 @@ const OperaTionalTable = (props) => { render: (dom, record) => { return record.nameOfBusinessOwner }, - }, + }, { title: '车籍地', search: false, @@ -696,16 +713,9 @@ const OperaTionalTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldata(record.id) }}> + + } }, @@ -759,7 +769,7 @@ const OperaTionalTable = (props) => { render: (dom, record) => { return record.nameOfBusinessOwner }, - }, { + }, { title: '品名', search: false, dataIndex: 'containers', @@ -1336,16 +1346,9 @@ const OperaTionalTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldata(record.id) }}> + + } }, @@ -1813,16 +1816,9 @@ const OperaTionalTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldatas(record.id) }}> + + } }, @@ -1881,16 +1877,20 @@ const OperaTionalTable = (props) => { }, { key: 'tab2', - label: { { - setRewkeys('chuzu') - } }}>出租车{activeKey === 'tab2'}, + label: { + { + setRewkeys('chuzu') + } + }}>出租车{activeKey === 'tab2'}, }, { key: 'tab3', - label: { { - setRewkeys('weihuo') - } }}>危险货运{activeKey === 'tab3'}, + label: { + { + setRewkeys('weihuo') + } + }}>危险货运{activeKey === 'tab3'}, }, { key: 'tab4', @@ -1918,58 +1918,62 @@ const OperaTionalTable = (props) => { }} columns={columns[activeKey]} - dataSource={counts || []} + dataSource={counts || []} request={async (params, sort, filter) => { - if(rewkeys=='keyun'){ + if (rewkeys == 'keyun') { const query = {} - setRowSelected([]); - const res = await dispatch(getOperaTional(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} - if(rewkeys=='chuzu'){ + setRowSelected([]); + const res = await dispatch(getOperaTional(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } + if (rewkeys == 'chuzu') { const query = { - type:'出租车', - nameOfBusinessOwner:sitename + type: '出租车', + nameOfBusinessOwner: sitename } - setRowSelected([]); - const res = await dispatch(getSpecificVehicle(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} - if(rewkeys=='weihuo'){ + setRowSelected([]); + const res = await dispatch(getSpecificVehicle(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } + if (rewkeys == 'weihuo') { const query = { - type:'危货', - nameOfBusinessOwner:sitename + type: '危货', + nameOfBusinessOwner: sitename } - setRowSelected([]); - const res = await dispatch(getSpecificVehicle(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} - if(rewkeys=='yehu'){ + setRowSelected([]); + const res = await dispatch(getSpecificVehicle(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } + if (rewkeys == 'yehu') { const query = { - nameOfBusinessOwner:sitename + nameOfBusinessOwner: sitename } - setRowSelected([]); - const res = await dispatch(getHouseholds(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - }} + setRowSelected([]); + const res = await dispatch(getHouseholds(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } + } }} search={{ defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ ...dom.reverse(), - ['tab2','tab3','tab4'].includes(activeKey) ? { props.exports(rowSelected, counts) }}> + ['tab2', 'tab3', 'tab4'].includes(activeKey) ? { props.exports(rowSelected, counts) }}> + >编辑 { deldata(record.id) }}> + + } }, @@ -1113,16 +1122,9 @@ const requestcheliang = (name) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 { deldatas(record.id) }}> + + } }, @@ -1173,16 +1175,20 @@ const requestcheliang = (name) => { items: [ { key: 'tab1', - label: { { - setRewkeys('xianlu') - } }}>运营线路{activeKey === 'tab1'}, + label: { + { + setRewkeys('xianlu') + } + }}>运营线路{activeKey === 'tab1'}, }, { key: 'tab2', - label: { { - setRewkeys('cheliang') - } }}>车辆信息{activeKey === 'tab2'}, + label: { + { + setRewkeys('cheliang') + } + }}>车辆信息{activeKey === 'tab2'}, } ], @@ -1211,31 +1217,31 @@ const requestcheliang = (name) => { dataSource={counts || []} request={async (params) => { - if(rewkeys=='xianlu'){ + if (rewkeys == 'xianlu') { const query = { - fleet:sitename + fleet: sitename + } + setRowSelected([]); + const res = await dispatch(getCircuit(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } } - setRowSelected([]); - const res = await dispatch(getCircuit(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 - } - } - if(rewkeys=='cheliang'){ + if (rewkeys == 'cheliang') { const query = { - fleet:sitename - } - setRowSelected([]); - const res = await dispatch(getVehicle(query)); - setCounts(res.payload.data) - return { - ...res, - total: res.payload.data ? res.payload.data.count : 0 + fleet: sitename + } + setRowSelected([]); + const res = await dispatch(getVehicle(query)); + setCounts(res.payload.data) + return { + ...res, + total: res.payload.data ? res.payload.data.count : 0 + } } - } - + }} search={{ defaultCollapsed: false, @@ -1252,13 +1258,13 @@ const requestcheliang = (name) => { > - {modalVisible ? { const [whichofits, setWhichofits] = useState('县') const [delet, setDelet] = useState() const ref = useRef() - useEffect(() => { ref.current.reload() }, [ whichofits, delet]) + useEffect(() => { ref.current.reload() }, [whichofits, delet]) //打开弹窗 const openModal = (type, record) => { setModalVisible(true); @@ -42,7 +42,24 @@ const TransporTationTable = (props) => { setModalRecord(null); } } - // console.log(counts) + //删除daolu + const deldata = (id) => { + const query = { + roadId: id + } + dispatch(delRoadway(query)).then((res) => { + setDelet(res) + }) + } + //删除工程 + const deldatas = (id) => { + const query = { + projectId: id + } + dispatch(delProject(query)).then((res) => { + setDelet(res) + }) + } //批量导出 const exports = (ids, counts) => { // console.log(user); @@ -1170,22 +1187,20 @@ const TransporTationTable = (props) => { width: 120, fixed: 'right', render: (dom, record) => { + // node = renderRemoveUser('移除'); return
+ >编辑 + { deldata(record.id) }}> + } }, @@ -2337,14 +2352,11 @@ const TransporTationTable = (props) => { setRecortd(record) }} - >编辑 + >编辑 + { deldata(record.id) }}> + + + } }, @@ -3497,15 +3509,10 @@ const TransporTationTable = (props) => { setRecortd(record) }} - >编辑 + >编辑 + { deldata(record.id) }}> + + } }, @@ -3688,16 +3695,11 @@ const TransporTationTable = (props) => { setTypecard('111') setRecortd(record) }} - >编辑 + >编辑 + { deldatas(record.id) }}> + + + } }, @@ -3747,19 +3749,19 @@ const TransporTationTable = (props) => { { key: 'tab1', label: { - setWhichofits('xian') + setWhichofits('县') }}>县道{activeKey === 'tab1'}, }, { key: 'tab2', label: { - setWhichofits('xiang') + setWhichofits('乡') }}>乡道{activeKey === 'tab2'}, }, { key: 'tab3', label: { - setWhichofits('cun') + setWhichofits('村') }}>村道{activeKey === 'tab3'}, }, { key: 'tab4', @@ -3875,6 +3877,7 @@ const TransporTationTable = (props) => { rewkeys={'road'} recortd={recortd} setRecortd={setRecortd} + setDelet={setDelet} /> : ''} ) diff --git a/web/client/src/sections/organization/components/userModal.js b/web/client/src/sections/organization/components/userModal.js index 29a91f9f..d229bc7a 100644 --- a/web/client/src/sections/organization/components/userModal.js +++ b/web/client/src/sections/organization/components/userModal.js @@ -1,22 +1,25 @@ import React from 'react'; import { connect } from 'react-redux'; -import { Spin, Card, Modal, TreeSelect, message } from 'antd'; +import { Spin } from 'antd'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; const UserModal = (props) => { const { visible, modalType, depData, onVisibleChange, onConfirm, editData } = props - const reg_tel = /^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/; const onFinish = (values) => { if (onConfirm) { onConfirm(values); } } - const mobile = (value) => { - if (reg_tel.test(value)) { - return + + const checkName = (rule, value, callback) => { + if (value && value.replace(/[^\u4E00-\u9FA5]/g).includes('undefined')) { + callback(new Error('请输入中文!')); + } else { + callback() } - return message('请输入姓名') } + + return ( { label="姓名" required placeholder="请输入姓名" - rules={[{ required: true, message: '请输入姓名' },{ max: 5, message: '请输入5个字以内的名称' }]} + rules={[{ required: true, message: '请输入姓名' }, + { max: 5, message: '请输入5个字以内的名称' }, + { validator: checkName } + ]} /> < ProFormText name={['contract', 'phone']} diff --git a/web/client/src/sections/organization/containers/user.js b/web/client/src/sections/organization/containers/user.js index b32dffc2..634c2c7c 100644 --- a/web/client/src/sections/organization/containers/user.js +++ b/web/client/src/sections/organization/containers/user.js @@ -374,7 +374,6 @@ const UserManage = (props) => { function mapStateToProps(state) { const { depMessage, depUser, global } = state; - console.log('depMessage:', depMessage); // console.log(state); return { clientHeight: global.clientHeight, diff --git a/web/client/src/sections/quanju/containers/footer/conserve/index.js b/web/client/src/sections/quanju/containers/footer/conserve/index.js index 7a141fe5..8d6328c1 100644 --- a/web/client/src/sections/quanju/containers/footer/conserve/index.js +++ b/web/client/src/sections/quanju/containers/footer/conserve/index.js @@ -19,25 +19,24 @@ const Conserve = (props) => { setLoading(false) setRoadData(res.payload.data || {}) }) - dispatch(getHighways()).then(res =>{ + dispatch(getHighways()).then(res => { setHighwaysData(res.payload.data || []) }) - dispatch(getRoadMaintenances()).then(res =>{ + dispatch(getRoadMaintenances()).then(res => { setRoadMaintenances(res.payload.data || []) }) }, []) return ( -
-
- - +
+
+ + +
-
) } function mapStateToProps(state) { - // const { auth } = state; return { diff --git a/web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js b/web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js index 73b69818..29d39de1 100644 --- a/web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js +++ b/web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js @@ -37,7 +37,7 @@ const LeftBottom = (props) => { total={totalData?.toFixed(3) || 0} colorList={colorList} textLeft={'20%'} - numLeft={'16%'} + numLeft={'14.5%'} underColorList={underColorList} /> diff --git a/web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js b/web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js index f3f15c41..44f52f73 100644 --- a/web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js +++ b/web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js @@ -62,7 +62,7 @@ const RightBottom = (props) => { height='100%' text='养护总数' textLeft={'21%'} - numLeft={'23%'} + numLeft={'22%'} total={totalData || 0} colorList={colorList} underColorList={underColorList} diff --git a/web/client/src/sections/quanju/containers/footer/operation/left.js b/web/client/src/sections/quanju/containers/footer/operation/left.js index 7e7e9f81..2966deaf 100644 --- a/web/client/src/sections/quanju/containers/footer/operation/left.js +++ b/web/client/src/sections/quanju/containers/footer/operation/left.js @@ -6,6 +6,7 @@ import { getBusTierList } from '../../../actions/example' import './style.less' + const Left = (props) => { const [treeData, setTreeData] = useState([]) const [treeDataList, setTreeDataList] = useState([]) @@ -39,9 +40,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 ? ( @@ -75,47 +77,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)