From 3c602be0dfa0d44154eb69d3a35500495a7f024f Mon Sep 17 00:00:00 2001 From: zhaobing Date: Fri, 4 Aug 2023 20:10:51 +0800 Subject: [PATCH] feat:fix bugs --- api/app/lib/controllers/data/vehicle.js | 1 - .../fillion/components/bridgeTable.js | 10 +++++--- .../fillion/components/highwaysTable.js | 7 +++--- .../fillion/components/transportationTable.js | 23 +++++++++++++------ .../footer/leadership/centerleft/daolu.js | 4 ++-- .../footer/leadership/centerleft/top.js | 14 +++++------ 6 files changed, 35 insertions(+), 24 deletions(-) diff --git a/api/app/lib/controllers/data/vehicle.js b/api/app/lib/controllers/data/vehicle.js index 554e4e5a..4ba183a5 100644 --- a/api/app/lib/controllers/data/vehicle.js +++ b/api/app/lib/controllers/data/vehicle.js @@ -26,7 +26,6 @@ async function get(ctx) { } } const vehicleRes = await models.Statistic.findAll(findOption) - console.log('vehicleRes', vehicleRes) ctx.status = 200; ctx.body = { vehicleRes: vehicleRes.filter(item => item.dataValues.name === '标志牌' || item.dataValues.name === '养护责任牌') diff --git a/web/client/src/sections/fillion/components/bridgeTable.js b/web/client/src/sections/fillion/components/bridgeTable.js index f32c0e89..1f9b43bb 100644 --- a/web/client/src/sections/fillion/components/bridgeTable.js +++ b/web/client/src/sections/fillion/components/bridgeTable.js @@ -39,6 +39,12 @@ const BrideTable = (props) => { setDelet(res) }) } + useEffect(async () => { + const res = await dispatch(getBridge()) + setSmallBridge(res.payload.data?.filter(item => item.bridgeClassification === '小桥')) + setMiddleBridge(res.payload.data?.filter(item => item.bridgeClassification === '中桥')) + setBigBridge(res.payload.data?.filter(item => item.bridgeClassification === '大桥')) + }, []) const deldatas = (id) => { // 工程 const query = { projectId: id @@ -1813,9 +1819,7 @@ const BrideTable = (props) => { setRowSelected([]); const res = await dispatch(getBridge(query)); // console.log(res) - setSmallBridge(res.payload.data?.filter(item => item.bridgeClassification === '小桥')) - setMiddleBridge(res.payload.data?.filter(item => item.bridgeClassification === '中桥')) - setBigBridge(res.payload.data?.filter(item => item.bridgeClassification === '大桥')) + setCounts(res.payload.data) return { ...res, diff --git a/web/client/src/sections/fillion/components/highwaysTable.js b/web/client/src/sections/fillion/components/highwaysTable.js index 2d19929a..248e503c 100644 --- a/web/client/src/sections/fillion/components/highwaysTable.js +++ b/web/client/src/sections/fillion/components/highwaysTable.js @@ -91,15 +91,14 @@ const TransporTationTable = (props) => { width: 160, fixed: 'right', render: (dom, record) => { - console.log('record', record.id === null) - return
+ disabled={editAble} + >编辑) : null} } }, diff --git a/web/client/src/sections/fillion/components/transportationTable.js b/web/client/src/sections/fillion/components/transportationTable.js index 99e35d15..6fabd4b7 100644 --- a/web/client/src/sections/fillion/components/transportationTable.js +++ b/web/client/src/sections/fillion/components/transportationTable.js @@ -76,6 +76,20 @@ const TransporTationTable = (props) => { setDelet(res) }) } + useEffect(async () => { + console.log('whichofits', whichofits) + let query = {} + if (whichofits === '县') { + query.level = '县' + } else if (whichofits === '乡') { + query.level = '乡' + } else if (whichofits === '村') { + query.level = '村' + } + const res = await dispatch(getRoadway(query)) + const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]; + setRoadData(uniqueArray) + }, [whichofits]) const columns = { tab1: [ { @@ -3823,8 +3837,7 @@ const TransporTationTable = (props) => { } setRowSelected([]); const res = await dispatch(getRoadway(query)); - const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]; - setRoadData(uniqueArray) + setCounts(departmentInfo ? res.payload.data.filter((item) => { return item.townshipCode === departmentInfo.areaCode }) : res.payload.data) @@ -3840,8 +3853,6 @@ const TransporTationTable = (props) => { } setRowSelected([]); const res = await dispatch(getRoadway(query)); - const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]; - setRoadData(uniqueArray) setCounts(departmentInfo ? res.payload.data.filter((item) => { return item.townshipCode === departmentInfo.areaCode }) : res.payload.data) @@ -3856,8 +3867,6 @@ const TransporTationTable = (props) => { } setRowSelected([]); const res = await dispatch(getRoadway(query)) - const uniqueArray = [...new Set(res.payload.data?.map(item => item.routeName))]; - setRoadData(uniqueArray) setCounts(departmentInfo ? res.payload.data.filter((item) => { return item.townshipCode === departmentInfo.areaCode }) : res.payload.data) @@ -3883,7 +3892,7 @@ const TransporTationTable = (props) => { search={{ defaultCollapsed: false, optionRender: (searchConfig, formProps, dom) => [ - {`共有${whichofits}道:${roadData.length || 0}条`}, + {`共有${whichofits}道:${roadData.length || 0}条`}, ...dom.reverse(), { props.exports(rowSelected, grade, differentiate) }} disabled={user?.username !== 'SuperAdmin' && user?.userResources?.filter(i => i.resourceId === 'ROADMANAGE')[0].isshow === "true" ? true : ''} diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js index 8ef8046d..9d8f5b47 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/daolu.js @@ -38,6 +38,7 @@ const Right = (props) => { // const }) }, []) + const roadMile = 2481.2 const renderBody = () => { return ( @@ -117,8 +118,7 @@ const Right = (props) => {
{/* */} -

乡村道道路2481.2公里

- +

乡村道道路{roadMile}公里

{/*

乡村道道路{isNaN((roads?.["乡"] + roads?.["村"]).toFixed(3)) ? "" : (roads?.["乡"] + roads?.["村"]).toFixed(3)}公里

*/}

占比{((2481.2 / 2689) * 100).toFixed(2)}%

diff --git a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js index eb227e7b..7049020d 100644 --- a/web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js +++ b/web/client/src/sections/quanju/containers/footer/leadership/centerleft/top.js @@ -28,7 +28,7 @@ const Leftcenter = (props) => { {/*
{ onClick("build") }}>建设
*/} -
{ +
{ onClick("daolu") }} > { @@ -37,14 +37,14 @@ const Leftcenter = (props) => {
-
+
+

2689

道路统计公里

{/*

{isNaN((list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)) ? "" : (list?.["县"] + list?.["乡"] + list?.["村"]).toFixed(3)}

*/} -

2689

-
{ + {/*
{ onClick("handong") }} > { @@ -57,8 +57,8 @@ const Leftcenter = (props) => {

涵洞统计

{isNaN((culvert?.["县"] + culvert?.["乡"] + culvert?.["村"]).toFixed(0)) ? "" : (culvert?.["县"] + culvert?.["乡"] + culvert?.["村"]).toFixed(0)}

-
-
{ +
*/} +
{ onClick("qiaoliang") }} > { @@ -68,8 +68,8 @@ const Leftcenter = (props) => {
-

桥梁统计

165

+

桥梁统计

{/*

{isNaN((bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])) ? "" : (bridge?.["小桥"] + bridge?.["中桥"] + bridge?.["大桥"])}

*/}