Browse Source

Merge branch 'dev' of https://gitea.anxinyun.cn/gao.zhiyuan/Highways4Good into dev

release_0.0.4
巴林闲侠 2 years ago
parent
commit
ddfe115716
  1. 1
      web/client/index.ejs
  2. 57
      web/client/src/sections/fillion/components/bridgeTable.js
  3. 2
      web/client/src/sections/fillion/components/highways/highwaysdata.js
  4. 33
      web/client/src/sections/fillion/components/infor/details.js
  5. 27
      web/client/src/sections/fillion/components/inforTable.js
  6. 176
      web/client/src/sections/fillion/components/operationalTable.js
  7. 36
      web/client/src/sections/fillion/components/project/project.js
  8. 245
      web/client/src/sections/fillion/components/publicTable.js
  9. 89
      web/client/src/sections/fillion/components/transportationTable.js
  10. 20
      web/client/src/sections/organization/components/userModal.js
  11. 1
      web/client/src/sections/organization/containers/user.js
  12. 15
      web/client/src/sections/quanju/containers/footer/conserve/index.js
  13. 2
      web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js
  14. 2
      web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js
  15. 83
      web/client/src/sections/quanju/containers/footer/operation/left.js

1
web/client/index.ejs

@ -15,6 +15,7 @@
} }
</script> </script>
<script src="https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.Adaptor,AMap.Scale,AMap.ToolBar,AMap.DistrictSearch,AMap.Geocoder,AMap.CustomLayer,Map3D,ElasticMarker"></script> <script src="https://webapi.amap.com/maps?v=2.0&key=00f9a29dedcdbd8befec3dfe0cef5003&plugin=AMap.Adaptor,AMap.Scale,AMap.ToolBar,AMap.DistrictSearch,AMap.Geocoder,AMap.CustomLayer,Map3D,ElasticMarker"></script>
<script src="https://webapi.amap.com/loca?v=2.0.0&key=00f9a29dedcdbd8befec3dfe0cef5003"></script>
</head> </head>
<body style="background: transparent"> <body style="background: transparent">

57
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 from '@ant-design/pro-table';
import './protable.less' import './protable.less'
import moment from 'moment'; 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 UserModal from './infor/details';
import ProjectModal from './project/project'; import ProjectModal from './project/project';
@ -26,7 +26,23 @@ const BrideTable = (props) => {
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
const ref = useRef() 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 = { const columns = {
tab1: [ tab1: [
{ {
@ -1493,16 +1509,10 @@ const BrideTable = (props) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button>
onClick={() => { <Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}>
const query = { <Button type="link">删除</Button>
bridgeId: record.id </Popconfirm></div>
}
dispatch(delBridge(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -1683,16 +1693,9 @@ const BrideTable = (props) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button><Popconfirm title='' onConfirm={() => { deldatas(record.id) }}>
onClick={() => { <Button type="link">删除</Button>
const query = { </Popconfirm></div>
projectId: record.id
}
dispatch(delProject(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -1809,20 +1812,20 @@ const BrideTable = (props) => {
dataSource={counts || []} dataSource={counts || []}
request={async (params) => { request={async (params) => {
if(whichofits=='qiaoliang'){ if (whichofits == 'qiaoliang') {
const query = { const query = {
bridgeName:sitename bridgeName: sitename
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getBridge(query)); const res = await dispatch(getBridge(query));
// console.log(res) // console.log(res)
setCounts(res.payload.data) setCounts(res.payload.data)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
} }
}if(whichofits=='gongcheng'){ } if (whichofits == 'gongcheng') {
const query = { const query = {
type: 'bridge', type: 'bridge',
// type:sitename // type:sitename
@ -1835,7 +1838,7 @@ const BrideTable = (props) => {
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
} }
} }
}} }}
search={{ search={{
defaultCollapsed: false, defaultCollapsed: false,

2
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 { Form, Spin, Table } from 'antd';
import { ModalForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form'; import { ModalForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form';
import { putOperaTional,putHighways } from "../../actions/infor" import { putOperaTional,putHighways } from "../../actions/infor"
import { _ } from 'lodash' import _ from 'lodash'
const HightModal = (props) => { const HightModal = (props) => {
const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd,setDelet } = props const { visible, onVisibleChange, typecard, rewkeys, recortd, dispatch, setRecortd,setDelet } = props

33
web/client/src/sections/fillion/components/infor/details.js

@ -155,15 +155,14 @@ const UserModal = (props) => {
setDelet(values) setDelet(values)
const query = { ...values, level: whichofits, roadId: records?.[0]?.value || '' } const query = { ...values, level: whichofits, roadId: records?.[0]?.value || '' }
dispatch(putRoadway(query)).then((res) => { dispatch(putRoadway(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values, level: whichofits } const query = { ...values, level: whichofits }
dispatch(putRoadway(query)).then((res) => { dispatch(putRoadway(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
@ -174,14 +173,14 @@ const UserModal = (props) => {
setDelet(values) setDelet(values)
const query = { ...values, roadId: records?.[0]?.value || '' } const query = { ...values, roadId: records?.[0]?.value || '' }
dispatch(putBridge(query)).then((res) => { dispatch(putBridge(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values } const query = { ...values }
dispatch(putBridge(query)).then((res) => { dispatch(putBridge(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} }
@ -189,16 +188,16 @@ const UserModal = (props) => {
if (rewkeys === 'weihuo' || rewkeys === 'chuzu') { if (rewkeys === 'weihuo' || rewkeys === 'chuzu') {
if (typecard == '111') { if (typecard == '111') {
setDelet(values) 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) => { dispatch(putSpecificVehicle(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values, type: rewkeys } const query = { ...values, type: rewkeys == 'chuzu' ? '出租车' : '危货' }
dispatch(putSpecificVehicle(query)).then((res) => { dispatch(putSpecificVehicle(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} }
@ -208,14 +207,14 @@ const UserModal = (props) => {
setDelet(values) setDelet(values)
const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' } const query = { ...values, businessId: records?.[0]?.value, type: rewkeys == 'chuzu' ? '出租车' : '危货' }
dispatch(putHouseholds(query)).then((res) => { dispatch(putHouseholds(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' } const query = { ...values, type: rewkeys === 'chuzu' ? '出租车' : '危货' }
dispatch(putHouseholds(query)).then((res) => { dispatch(putHouseholds(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} }
@ -224,14 +223,14 @@ const UserModal = (props) => {
setDelet(values) setDelet(values)
const query = { ...values, lineId: records?.[0]?.value || '' } const query = { ...values, lineId: records?.[0]?.value || '' }
dispatch(putCircuit(query)).then((res) => { dispatch(putCircuit(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values } const query = { ...values }
dispatch(putCircuit(query)).then((res) => { dispatch(putCircuit(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} }
@ -241,14 +240,14 @@ const UserModal = (props) => {
setDelet(values) setDelet(values)
const query = { ...values, carId: records?.[0]?.value || '' } const query = { ...values, carId: records?.[0]?.value || '' }
dispatch(putVehicle(query)).then((res) => { dispatch(putVehicle(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values } const query = { ...values }
dispatch(putVehicle(query)).then((res) => { dispatch(putVehicle(query)).then((res) => {
setSuccess(res.success)
}) })
return true return true
} }
@ -258,7 +257,7 @@ const UserModal = (props) => {
setDelet(values) setDelet(values)
const query = { ...values, overspeedId: records?.[0]?.value || '' } const query = { ...values, overspeedId: records?.[0]?.value || '' }
dispatch(putPurchase(query)).then((res) => { dispatch(putPurchase(query)).then((res) => {
setSuccess(res.success)
setMonitor(res) setMonitor(res)
}) })
return true return true
@ -266,7 +265,7 @@ const UserModal = (props) => {
setDelet(values) setDelet(values)
const query = { ...values } const query = { ...values }
dispatch(putPurchase(query)).then((res) => { dispatch(putPurchase(query)).then((res) => {
setSuccess(res.success)
setMonitor(res) setMonitor(res)
}) })
return true return true

27
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}`) `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 = const columns =
[ [
{ {
@ -364,16 +372,11 @@ const InForTable = (props) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button>
onClick={() => {
const query = { <Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}>
overspeedId: record.id <Button type="link">删除</Button>
} </Popconfirm></div>
dispatch(delPurchase(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -438,8 +441,8 @@ const InForTable = (props) => {
request={async (params) => { request={async (params) => {
console.log(params) console.log(params)
const query = { const query = {
limit:params.pageSize, limit: params.pageSize,
page:params.current-1, page: params.current - 1,
nameOfInspectionPoint: nameOfInspectionPoint, nameOfInspectionPoint: nameOfInspectionPoint,
licensePlate: licensePlate, licensePlate: licensePlate,
numberOfAxles: numberOfAxles, numberOfAxles: numberOfAxles,

176
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 { connect } from 'react-redux';
import { Spin, Button, Popconfirm, Badge } from 'antd'; import { Spin, Button, Popconfirm, Badge } from 'antd';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import './protable.less' 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 UserModal from './infor/details';
import HightModal from './highways/highwaysdata'; import HightModal from './highways/highwaysdata';
@ -24,7 +24,7 @@ const OperaTionalTable = (props) => {
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [rewkeys,activeKey,delet]) useEffect(() => { ref.current.reload() }, [rewkeys, activeKey, delet])
//打开弹窗 //打开弹窗
const openModal = (type, record) => { const openModal = (type, record) => {
setModalVisible(true); setModalVisible(true);
@ -35,6 +35,23 @@ const OperaTionalTable = (props) => {
setModalRecord(null); 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) => { const hightModal = (type, record) => {
setModalVisibleyilan(true); setModalVisibleyilan(true);
@ -73,7 +90,7 @@ const OperaTionalTable = (props) => {
search: false, search: false,
fieldProps: { fieldProps: {
placeholder: '请输入道路名称进行搜索', placeholder: '请输入道路名称进行搜索',
getPopupContainer: (triggerNode) => triggerNode.parentNode, getPopupContainer: (triggerNode) => triggerNode.parentNode,
}, },
@ -132,7 +149,7 @@ const OperaTionalTable = (props) => {
render: (dom, record) => { render: (dom, record) => {
return record.nameOfBusinessOwner return record.nameOfBusinessOwner
}, },
}, },
{ {
title: '车籍地', title: '车籍地',
search: false, search: false,
@ -696,16 +713,9 @@ const OperaTionalTable = (props) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button> <Popconfirm title='' onConfirm={() => { deldata(record.id) }}>
onClick={() => { <Button type="link">删除</Button>
const query = { </Popconfirm></div>
vehicleId: record.id
}
dispatch(delSpecificVehicle(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -759,7 +769,7 @@ const OperaTionalTable = (props) => {
render: (dom, record) => { render: (dom, record) => {
return record.nameOfBusinessOwner return record.nameOfBusinessOwner
}, },
}, { }, {
title: '品名', title: '品名',
search: false, search: false,
dataIndex: 'containers', dataIndex: 'containers',
@ -1336,16 +1346,9 @@ const OperaTionalTable = (props) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button> <Popconfirm title='' onConfirm={() => { deldata(record.id) }}>
onClick={() => { <Button type="link">删除</Button>
const query = { </Popconfirm></div>
vehicleId: record.id
}
dispatch(delSpecificVehicle(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -1813,16 +1816,9 @@ const OperaTionalTable = (props) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button><Popconfirm title='' onConfirm={() => { deldatas(record.id) }}>
onClick={() => { <Button type="link">删除</Button>
const query = { </Popconfirm></div>
businessId: record.id
}
dispatch(delHouseholds(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -1881,16 +1877,20 @@ const OperaTionalTable = (props) => {
}, },
{ {
key: 'tab2', key: 'tab2',
label: <span onClick={() => { { label: <span onClick={() => {
setRewkeys('chuzu') {
} }}>出租车{activeKey === 'tab2'}</span>, setRewkeys('chuzu')
}
}}>出租车{activeKey === 'tab2'}</span>,
}, },
{ {
key: 'tab3', key: 'tab3',
label: <span onClick={() => { { label: <span onClick={() => {
setRewkeys('weihuo') {
} }}>危险货运{activeKey === 'tab3'}</span>, setRewkeys('weihuo')
}
}}>危险货运{activeKey === 'tab3'}</span>,
}, { }, {
key: 'tab4', key: 'tab4',
@ -1918,58 +1918,62 @@ const OperaTionalTable = (props) => {
}} }}
columns={columns[activeKey]} columns={columns[activeKey]}
dataSource={counts || []} dataSource={counts || []}
request={async (params, sort, filter) => { request={async (params, sort, filter) => {
if(rewkeys=='keyun'){ if (rewkeys == 'keyun') {
const query = {} const query = {}
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getOperaTional(query)); const res = await dispatch(getOperaTional(query));
setCounts(res.payload.data) setCounts(res.payload.data)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
}} }
if(rewkeys=='chuzu'){ }
if (rewkeys == 'chuzu') {
const query = { const query = {
type:'出租车', type: '出租车',
nameOfBusinessOwner:sitename nameOfBusinessOwner: sitename
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getSpecificVehicle(query)); const res = await dispatch(getSpecificVehicle(query));
setCounts(res.payload.data) setCounts(res.payload.data)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
}} }
if(rewkeys=='weihuo'){ }
if (rewkeys == 'weihuo') {
const query = { const query = {
type:'危货', type: '危货',
nameOfBusinessOwner:sitename nameOfBusinessOwner: sitename
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getSpecificVehicle(query)); const res = await dispatch(getSpecificVehicle(query));
setCounts(res.payload.data) setCounts(res.payload.data)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
}} }
if(rewkeys=='yehu'){ }
if (rewkeys == 'yehu') {
const query = { const query = {
nameOfBusinessOwner:sitename nameOfBusinessOwner: sitename
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getHouseholds(query)); const res = await dispatch(getHouseholds(query));
setCounts(res.payload.data) setCounts(res.payload.data)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
}} }
}
}} }}
search={{ search={{
defaultCollapsed: false, defaultCollapsed: false,
optionRender: (searchConfig, formProps, dom) => [ optionRender: (searchConfig, formProps, dom) => [
...dom.reverse(), ...dom.reverse(),
['tab2','tab3','tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}> ['tab2', 'tab3', 'tab4'].includes(activeKey) ? <Popconfirm title="确认导出?" onConfirm={() => { props.exports(rowSelected, counts) }}>
<Button <Button
> >
导出 导出
@ -1981,13 +1985,13 @@ const OperaTionalTable = (props) => {
> >
</ProTable></div> </ProTable></div>
{modalVisible ? <UserModal {modalVisible ? <UserModal
visible={modalVisible} visible={modalVisible}
onVisibleChange={setModalVisible} onVisibleChange={setModalVisible}
modalRecord={modalRecord} modalRecord={modalRecord}
typecard={typecard} typecard={typecard}
rewkeys={rewkeys} rewkeys={rewkeys}
data={rewkeys==='yehu'?data:date} data={rewkeys === 'yehu' ? data : date}
recortd={recortd} recortd={recortd}
// sitename={sitename} // sitename={sitename}
setDelet={setDelet} setDelet={setDelet}
@ -2006,7 +2010,7 @@ const OperaTionalTable = (props) => {
</Spin > </Spin >
) )
} }
const date={ const date = {
"nameOfBusinessOwner": "业户名称", "nameOfBusinessOwner": "业户名称",
"productName": "品名", "productName": "品名",
"vehicleRegistry": "车籍地", "vehicleRegistry": "车籍地",
@ -2047,7 +2051,7 @@ const date={
"nextRatingDate": "下次等级评定日期", "nextRatingDate": "下次等级评定日期",
"creationDate": "创建日期" "creationDate": "创建日期"
} }
const data={ const data = {
"nameOfBusinessOwner": "业户名称", "nameOfBusinessOwner": "业户名称",
"productName": "品名", "productName": "品名",
"creditSocialCode": "信用社会代码", "creditSocialCode": "信用社会代码",
@ -2076,7 +2080,7 @@ const data={
"licenseIssuanceType": "证照发放类型", "licenseIssuanceType": "证照发放类型",
"numberOfSharedVehicles": "共有车辆数", "numberOfSharedVehicles": "共有车辆数",
"creationDate": "创建日期", "creationDate": "创建日期",
'type':'类型' 'type': '类型'
} }
function mapStateToProps(state) { function mapStateToProps(state) {
const { auth, depMessage } = state; const { auth, depMessage } = state;

36
web/client/src/sections/fillion/components/project/project.js

@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { Form, Spin, Table } from 'antd'; import { Form, Spin, Table } from 'antd';
import { DrawerForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form'; import { DrawerForm, ProForm, ProFormText,ProFormSelect } from '@ant-design/pro-form';
import { putProject } from "../../actions/infor" import { putProject } from "../../actions/infor"
import { _ } from 'lodash' import _ from 'lodash'
const data = { const data = {
"entryName": "项目名称", "entryName": "项目名称",
@ -23,7 +23,6 @@ const ProjectModal = (props) => {
const [records, setRecords] = useState()//处理 const [records, setRecords] = useState()//处理
const [recordsay, setRecordsay] = useState()//必填数据 const [recordsay, setRecordsay] = useState()//必填数据
const [success, setSuccess] = useState() //状态 const [success, setSuccess] = useState() //状态
const [flage, setFlage] = useState() //xiangmujinzhan
useEffect(() => { useEffect(() => {
const array = [] const array = []
if (rewkeys === 'road') { if (rewkeys === 'road') {
@ -78,40 +77,39 @@ const ProjectModal = (props) => {
visible={visible} visible={visible}
onVisibleChange={onVisibleChange} onVisibleChange={onVisibleChange}
onFinish={(values) => { onFinish={(values) => {
console.log(values)
if (rewkeys === 'road') { if (rewkeys === 'road') {
if (typecard == '111') { if (typecard == '111') {
setDelet(values) setDelet(values)
setDelet(values) const query = { ...values, type:rewkeys,projectId:records?.[0]?.value || '' }
const query = { ...values, type:rewkeys }
dispatch(putProject(query)).then((res) => { dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
}) })
return success return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values, type:rewkeys } const query = { ...values, type:rewkeys }
dispatch(putProject(query)).then((res) => { dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
}) })
return success return true
} }
} }
if (rewkeys === 'bridge') { if (rewkeys === 'bridge') {
if (typecard == '111') { if (typecard == '111') {
setDelet(values) setDelet(values)
const query = { ...values, type:rewkeys } const query = { ...values, type:rewkeys,projectId:records?.[0]?.value || '' }
dispatch(putProject(query)).then((res) => { dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
}) })
return success return true
} else { } else {
setDelet(values) setDelet(values)
const query = { ...values, type:rewkeys } const query = { ...values, type:rewkeys }
dispatch(putProject(query)).then((res) => { dispatch(putProject(query)).then((res) => {
setSuccess(res.success)
}) })
return success return true
} }
} }
}} }}
@ -127,7 +125,7 @@ const ProjectModal = (props) => {
placeholder="请输入名称" placeholder="请输入名称"
// value={recordsay?.[0]?.value} // value={recordsay?.[0]?.value}
rules={[{ required: true, message: "必填" }]} // rules={[{ required: true, message: "必填" }]}
/><ProFormText /><ProFormText
name={newlys?.[1]?.type} name={newlys?.[1]?.type}
width="md" width="md"
@ -135,7 +133,7 @@ const ProjectModal = (props) => {
placeholder="请输入名称" placeholder="请输入名称"
// value={recordsay?.[1]?.value} // value={recordsay?.[1]?.value}
rules={[{ required: true, message: "必填" }]} // rules={[{ required: true, message: "必填" }]}
/> />
<ProFormSelect <ProFormSelect
options={[ options={[
@ -150,6 +148,7 @@ const ProjectModal = (props) => {
width="xs" width="xs"
name='done' name='done'
label='是否已完成' label='是否已完成'
rules={[{ required: true, message: "必填" }]}
/> />
{newlysay?.map((item, index) => { {newlysay?.map((item, index) => {
return <ProFormText width="md" return <ProFormText width="md"
@ -167,7 +166,7 @@ const ProjectModal = (props) => {
placeholder="请输入名称" placeholder="请输入名称"
// value={recordssy?.[0]?.value} // value={recordssy?.[0]?.value}
rules={[{ required: true, message: "必填" }]} // rules={[{ required: true, message: "必填" }]}
/><ProFormText /><ProFormText
name={newlys?.[1]?.type} name={newlys?.[1]?.type}
width="md" width="md"
@ -175,7 +174,7 @@ const ProjectModal = (props) => {
placeholder="请输入名称" placeholder="请输入名称"
// value={recordssy?.[1]?.value} // value={recordssy?.[1]?.value}
rules={[{ required: true, message: "必填" }]} // rules={[{ required: true, message: "必填" }]}
/> />
<ProFormSelect <ProFormSelect
options={[ options={[
@ -190,6 +189,7 @@ const ProjectModal = (props) => {
width="xs" width="xs"
name='done' name='done'
label='是否已完成' label='是否已完成'
rules={[{ required: true, message: "必填" }]}
/> />
{newlysay?.map((item, index) => { {newlysay?.map((item, index) => {
return <ProFormText width="md" return <ProFormText width="md"

245
web/client/src/sections/fillion/components/publicTable.js

@ -4,7 +4,7 @@ import { Spin, Button, Popconfirm, Badge } from 'antd';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import './protable.less' import './protable.less'
import moment from 'moment'; import moment from 'moment';
import { getCircuit,getVehicle,delCircuit,delVehicle } from "../actions/infor" import { getCircuit, getVehicle, delCircuit, delVehicle } from "../actions/infor"
import UserModal from './infor/details'; import UserModal from './infor/details';
const PublicTable = (props) => { const PublicTable = (props) => {
@ -24,23 +24,23 @@ const PublicTable = (props) => {
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [delet,rewkeys]) useEffect(() => { ref.current.reload() }, [delet, rewkeys])
//xianlu请求 //xianlu请求
const requestxianlu = (name) => { const requestxianlu = (name) => {
const query = name const query = name
setRowSelected([]); setRowSelected([]);
dispatch(getCircuit(query)).then((res)=>{ dispatch(getCircuit(query)).then((res) => {
setCounts(res.payload.data) setCounts(res.payload.data)
}) })
} }
//cheliang请求 //cheliang请求
const requestcheliang = (name) => { const requestcheliang = (name) => {
const query = '' const query = ''
setRowSelected([]); setRowSelected([]);
dispatch(getVehicle(query)).then((res)=>{ dispatch(getVehicle(query)).then((res) => {
setCounts(res.payload.data) setCounts(res.payload.data)
}) })
} }
//打开弹窗 //打开弹窗
const openModal = (type, record) => { const openModal = (type, record) => {
setModalVisible(true); setModalVisible(true);
@ -67,6 +67,22 @@ const requestcheliang = (name) => {
`attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`) `attachments?src=files/${resTextIs}&filename=${encodeURIComponent(resTextIs)}&token=${user.token}`)
}) })
} }
const deldata = (id) => { // 线路
const query = {
lineId: id
}
dispatch(delCircuit(query)).then((res) => {
setDelet(res)
})
}
const deldatas = (id) => { // 车辆
const query = {
carId: id
}
dispatch(delVehicle(query)).then((res) => {
setDelet(res)
})
}
const columns = { const columns = {
tab1: [ tab1: [
{ {
@ -411,16 +427,9 @@ const requestcheliang = (name) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button><Popconfirm title='' onConfirm={() => { deldata(record.id) }}>
onClick={() => { <Button type="link">删除</Button>
const query = { </Popconfirm></div>
lineId: record.id
}
dispatch(delCircuit(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -1113,16 +1122,9 @@ const requestcheliang = (name) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button><Popconfirm title='' onConfirm={() => { deldatas(record.id) }}>
onClick={() => { <Button type="link">删除</Button>
const query = { </Popconfirm></div>
carId: record.id
}
dispatch(delVehicle(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -1173,16 +1175,20 @@ const requestcheliang = (name) => {
items: [ items: [
{ {
key: 'tab1', key: 'tab1',
label: <span onClick={() => { { label: <span onClick={() => {
setRewkeys('xianlu') {
} }}>运营线路{activeKey === 'tab1'}</span>, setRewkeys('xianlu')
}
}}>运营线路{activeKey === 'tab1'}</span>,
}, },
{ {
key: 'tab2', key: 'tab2',
label: <span onClick={() => { { label: <span onClick={() => {
setRewkeys('cheliang') {
} }}>车辆信息{activeKey === 'tab2'}</span>, setRewkeys('cheliang')
}
}}>车辆信息{activeKey === 'tab2'}</span>,
} }
], ],
@ -1211,31 +1217,31 @@ const requestcheliang = (name) => {
dataSource={counts || []} dataSource={counts || []}
request={async (params) => { request={async (params) => {
if(rewkeys=='xianlu'){ if (rewkeys == 'xianlu') {
const query = { 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([]); if (rewkeys == 'cheliang') {
const res = await dispatch(getCircuit(query));
setCounts(res.payload.data)
return {
...res,
total: res.payload.data ? res.payload.data.count : 0
}
}
if(rewkeys=='cheliang'){
const query = { const query = {
fleet:sitename fleet: sitename
} }
setRowSelected([]); setRowSelected([]);
const res = await dispatch(getVehicle(query)); const res = await dispatch(getVehicle(query));
setCounts(res.payload.data) setCounts(res.payload.data)
return { return {
...res, ...res,
total: res.payload.data ? res.payload.data.count : 0 total: res.payload.data ? res.payload.data.count : 0
}
} }
}
}} }}
search={{ search={{
defaultCollapsed: false, defaultCollapsed: false,
@ -1252,13 +1258,13 @@ const requestcheliang = (name) => {
> >
</ProTable></div> </ProTable></div>
{modalVisible ? <UserModal {modalVisible ? <UserModal
visible={modalVisible} visible={modalVisible}
onVisibleChange={setModalVisible} onVisibleChange={setModalVisible}
modalRecord={modalRecord} modalRecord={modalRecord}
typecard={typecard} typecard={typecard}
rewkeys={rewkeys} rewkeys={rewkeys}
data={rewkeys==='xianlu'?data:date} data={rewkeys === 'xianlu' ? data : date}
recortd={recortd} recortd={recortd}
// sitename={sitename} // sitename={sitename}
setDelet={setDelet} setDelet={setDelet}
@ -1292,58 +1298,59 @@ const data = {
"area": "所属区域", "area": "所属区域",
"remarks": "备注" "remarks": "备注"
} }
const date={ "company": "所属公司", const date = {
"fleet": "所属车队", "company": "所属公司",
"line": "所属线路", "fleet": "所属车队",
"vehicleNumber": "车辆编号", "line": "所属线路",
"vehicleLicensePlateNumber": "车辆牌照号", "vehicleNumber": "车辆编号",
"operationCategory": "运营类别", "vehicleLicensePlateNumber": "车辆牌照号",
"serviceLife": "已使用年限", "operationCategory": "运营类别",
"engineModel": "发动机型号", "serviceLife": "已使用年限",
"vehicleModel": "车辆型号", "engineModel": "发动机型号",
"vehicleCategory": "车辆类别", "vehicleModel": "车辆型号",
"vehicleStatus": "车辆状态", "vehicleCategory": "车辆类别",
"dateOfEntry": "入户日期", "vehicleStatus": "车辆状态",
"purchaseDate": "购进日期", "dateOfEntry": "入户日期",
"energyConsumptionType": "能耗类型", "purchaseDate": "购进日期",
"numberOfStandardUnits": "标台数", "energyConsumptionType": "能耗类型",
"maintenanceUnit": "维保单位", "numberOfStandardUnits": "标台数",
"vehicleType": "车辆类型", "maintenanceUnit": "维保单位",
"brandAndModel": "厂牌型号", "vehicleType": "车辆类型",
"manufacturer": "生产厂家", "brandAndModel": "厂牌型号",
"drivingLicenseNo": "行驶证编号", "manufacturer": "生产厂家",
"engineNumber": "发动机编号", "drivingLicenseNo": "行驶证编号",
"mainEnergyConsumption": "主能耗", "engineNumber": "发动机编号",
"secondaryEnergyConsumption": "副能耗", "mainEnergyConsumption": "主能耗",
"emissionStandard": "排放标准", "secondaryEnergyConsumption": "副能耗",
"startDate": "启用日期", "emissionStandard": "排放标准",
"lastTransferDate": "最近一次调动日期", "startDate": "启用日期",
"conductor": "车长", "lastTransferDate": "最近一次调动日期",
"vehicleWidth": "车宽", "conductor": "车长",
"carHeight": "车高", "vehicleWidth": "车宽",
"approvedPassengerCapacity": "核定载客数", "carHeight": "车高",
"vehicleIdentificationNumber": "车辆识别号", "approvedPassengerCapacity": "核定载客数",
"gearboxBrand": "变速箱品牌", "vehicleIdentificationNumber": "车辆识别号",
"manualCarWashingFee": "人工洗车费", "gearboxBrand": "变速箱品牌",
"laborCost": "劳务费", "manualCarWashingFee": "人工洗车费",
"curbWeight": "整备质量", "laborCost": "劳务费",
"totalMass": "总质量", "curbWeight": "整备质量",
"airConditioningTemperature": "空调温度", "totalMass": "总质量",
"airConditionedCarOrNot": "是否空调车", "airConditioningTemperature": "空调温度",
"turnOnTheAirConditioningTemperature": "开空调温度", "airConditionedCarOrNot": "是否空调车",
"power": "功率", "turnOnTheAirConditioningTemperature": "开空调温度",
"transmission": "变速器", "power": "功率",
"seatingCapacity": "座位数", "transmission": "变速器",
"airConditioningBrand": "空调品牌", "seatingCapacity": "座位数",
"seatType": "座椅类型", "airConditioningBrand": "空调品牌",
"tireSpecifications": "轮胎规格", "seatType": "座椅类型",
"roadTransportCertificateNo": "道路运输证号", "tireSpecifications": "轮胎规格",
"parkingPoint": "停放点", "roadTransportCertificateNo": "道路运输证号",
"carWashingType": "洗车类型", "parkingPoint": "停放点",
"maintenanceFreeWheelEnd": "免维护轮端", "carWashingType": "洗车类型",
"firstGuaranteeDate": "首保日期", "maintenanceFreeWheelEnd": "免维护轮端",
"dateOfRenovation": "整修日期", "firstGuaranteeDate": "首保日期",
"motorVehicleOwner": "机动车所有人" "dateOfRenovation": "整修日期",
"motorVehicleOwner": "机动车所有人"
} }
function mapStateToProps(state) { function mapStateToProps(state) {
const { auth, depMessage } = state; const { auth, depMessage } = state;

89
web/client/src/sections/fillion/components/transportationTable.js

@ -1,6 +1,6 @@
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Spin, Button, Popconfirm, Badge } from 'antd'; import { Spin, Button, Popconfirm } from 'antd';
import ProTable from '@ant-design/pro-table'; import ProTable from '@ant-design/pro-table';
import './protable.less' import './protable.less'
import moment from 'moment'; import moment from 'moment';
@ -22,7 +22,7 @@ const TransporTationTable = (props) => {
const [whichofits, setWhichofits] = useState('县') const [whichofits, setWhichofits] = useState('县')
const [delet, setDelet] = useState() const [delet, setDelet] = useState()
const ref = useRef() const ref = useRef()
useEffect(() => { ref.current.reload() }, [ whichofits, delet]) useEffect(() => { ref.current.reload() }, [whichofits, delet])
//打开弹窗 //打开弹窗
const openModal = (type, record) => { const openModal = (type, record) => {
setModalVisible(true); setModalVisible(true);
@ -42,7 +42,24 @@ const TransporTationTable = (props) => {
setModalRecord(null); 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) => { const exports = (ids, counts) => {
// console.log(user); // console.log(user);
@ -1170,22 +1187,20 @@ const TransporTationTable = (props) => {
width: 120, width: 120,
fixed: 'right', fixed: 'right',
render: (dom, record) => { render: (dom, record) => {
// node = renderRemoveUser('移除');
return <div><Button type="link" return <div><Button type="link"
onClick={() => { onClick={() => {
setRecortd(record) setRecortd(record)
openModal('edit', record) openModal('edit', record)
setTypecard('111') setTypecard('111')
}} }}
>编辑</Button><Button type="link" >编辑</Button>
onClick={() => { <Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}><Button type="link"
const query = { // onClick={() => {
roadId: record.id
} // }}
dispatch(delRoadway(query)).then((res) => { >删除</Button></Popconfirm>
setDelet(res) </div>
})
}}
>删除</Button></div>
} }
}, },
@ -2337,14 +2352,11 @@ const TransporTationTable = (props) => {
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" onClick={() => { >编辑</Button>
const query = { <Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}>
roadId: record.id <Button type="link">删除</Button>
} </Popconfirm>
dispatch(delRoadway(query)).then((res) => { </div>
setDelet(res)
})
}}>删除</Button></div>
} }
}, },
@ -3497,15 +3509,10 @@ const TransporTationTable = (props) => {
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" onClick={() => { >编辑</Button>
const query = { <Popconfirm title='是否确认删除' onConfirm={() => { deldata(record.id) }}>
roadId: record.id <Button type="link">删除</Button>
} </Popconfirm></div>
dispatch(delRoadway(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -3688,16 +3695,11 @@ const TransporTationTable = (props) => {
setTypecard('111') setTypecard('111')
setRecortd(record) setRecortd(record)
}} }}
>编辑</Button><Button type="link" >编辑</Button>
onClick={() => { <Popconfirm title='是否确认删除' onConfirm={() => { deldatas(record.id) }}>
const query = { <Button type="link">删除</Button>
projectId: record.id </Popconfirm>
} </div>
dispatch(delProject(query)).then((res) => {
setDelet(res)
})
}}
>删除</Button></div>
} }
}, },
@ -3747,19 +3749,19 @@ const TransporTationTable = (props) => {
{ {
key: 'tab1', key: 'tab1',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('xian') setWhichofits('')
}}>县道{activeKey === 'tab1'}</span>, }}>县道{activeKey === 'tab1'}</span>,
}, },
{ {
key: 'tab2', key: 'tab2',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('xiang') setWhichofits('')
}}>乡道{activeKey === 'tab2'}</span>, }}>乡道{activeKey === 'tab2'}</span>,
}, },
{ {
key: 'tab3', key: 'tab3',
label: <span onClick={() => { label: <span onClick={() => {
setWhichofits('cun') setWhichofits('')
}}>村道{activeKey === 'tab3'}</span>, }}>村道{activeKey === 'tab3'}</span>,
}, { }, {
key: 'tab4', key: 'tab4',
@ -3875,6 +3877,7 @@ const TransporTationTable = (props) => {
rewkeys={'road'} rewkeys={'road'}
recortd={recortd} recortd={recortd}
setRecortd={setRecortd} setRecortd={setRecortd}
setDelet={setDelet}
/> : ''} /> : ''}
</Spin > </Spin >
) )

20
web/client/src/sections/organization/components/userModal.js

@ -1,22 +1,25 @@
import React from 'react'; import React from 'react';
import { connect } from 'react-redux'; 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'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
const UserModal = (props) => { const UserModal = (props) => {
const { visible, modalType, depData, onVisibleChange, onConfirm, editData } = 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) => { const onFinish = (values) => {
if (onConfirm) { if (onConfirm) {
onConfirm(values); onConfirm(values);
} }
} }
const mobile = (value) => {
if (reg_tel.test(value)) { const checkName = (rule, value, callback) => {
return if (value && value.replace(/[^\u4E00-\u9FA5]/g).includes('undefined')) {
callback(new Error('请输入中文!'));
} else {
callback()
} }
return message('请输入姓名')
} }
return ( return (
<Spin spinning={false}> <Spin spinning={false}>
<ModalForm <ModalForm
@ -45,7 +48,10 @@ const UserModal = (props) => {
label="姓名" label="姓名"
required required
placeholder="请输入姓名" placeholder="请输入姓名"
rules={[{ required: true, message: '请输入姓名' },{ max: 5, message: '请输入5个字以内的名称' }]} rules={[{ required: true, message: '请输入姓名' },
{ max: 5, message: '请输入5个字以内的名称' },
{ validator: checkName }
]}
/> />
< ProFormText < ProFormText
name={['contract', 'phone']} name={['contract', 'phone']}

1
web/client/src/sections/organization/containers/user.js

@ -374,7 +374,6 @@ const UserManage = (props) => {
function mapStateToProps(state) { function mapStateToProps(state) {
const { depMessage, depUser, global } = state; const { depMessage, depUser, global } = state;
console.log('depMessage:', depMessage);
// console.log(state); // console.log(state);
return { return {
clientHeight: global.clientHeight, clientHeight: global.clientHeight,

15
web/client/src/sections/quanju/containers/footer/conserve/index.js

@ -19,25 +19,24 @@ const Conserve = (props) => {
setLoading(false) setLoading(false)
setRoadData(res.payload.data || {}) setRoadData(res.payload.data || {})
}) })
dispatch(getHighways()).then(res =>{ dispatch(getHighways()).then(res => {
setHighwaysData(res.payload.data || []) setHighwaysData(res.payload.data || [])
}) })
dispatch(getRoadMaintenances()).then(res =>{ dispatch(getRoadMaintenances()).then(res => {
setRoadMaintenances(res.payload.data || []) setRoadMaintenances(res.payload.data || [])
}) })
}, []) }, [])
return ( return (
<div style={{ width: '100%', height: '100%', }}> <div style={{ width: '100%', height: '100%', }}>
<div style={{ display: 'flex', width: '100%', height: '100%', justifyContent: 'space-between' }}> <div style={{ display: 'flex', width: '100%', height: '100%', justifyContent: 'space-between' }}>
<Left roadData={roadData} loading={loading} /> <Left roadData={roadData} loading={loading} />
<Right highwaysData={highwaysData} roadMaintenances={roadMaintenances}/> <Right highwaysData={highwaysData} roadMaintenances={roadMaintenances} />
</div>
</div> </div>
</div>
) )
} }
function mapStateToProps(state) { function mapStateToProps(state) {
// const { auth } = state; // const { auth } = state;
return { return {

2
web/client/src/sections/quanju/containers/footer/conserve/left/left-bottom.js

@ -37,7 +37,7 @@ const LeftBottom = (props) => {
total={totalData?.toFixed(3) || 0} total={totalData?.toFixed(3) || 0}
colorList={colorList} colorList={colorList}
textLeft={'20%'} textLeft={'20%'}
numLeft={'16%'} numLeft={'14.5%'}
underColorList={underColorList} underColorList={underColorList}
/> />
</Module> </Module>

2
web/client/src/sections/quanju/containers/footer/conserve/right/right-bottom.js

@ -62,7 +62,7 @@ const RightBottom = (props) => {
height='100%' height='100%'
text='养护总数' text='养护总数'
textLeft={'21%'} textLeft={'21%'}
numLeft={'23%'} numLeft={'22%'}
total={totalData || 0} total={totalData || 0}
colorList={colorList} colorList={colorList}
underColorList={underColorList} underColorList={underColorList}

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

@ -6,6 +6,7 @@ import { getBusTierList } from '../../../actions/example'
import './style.less' import './style.less'
const Left = (props) => { const Left = (props) => {
const [treeData, setTreeData] = useState([]) const [treeData, setTreeData] = useState([])
const [treeDataList, setTreeDataList] = useState([]) const [treeDataList, setTreeDataList] = useState([])
@ -39,9 +40,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 +77,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