From e3dca8af01e89a418885462bb325c16381a34354 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 3 Aug 2023 03:04:33 +0800 Subject: [PATCH] fix bugs --- .../fillion/components/maintenanceTable.js | 4 ++-- .../fillion/components/patrolTable.js | 19 +++++++++++-------- .../containers/maintenanceSpotCheck.js | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/web/client/src/sections/fillion/components/maintenanceTable.js b/web/client/src/sections/fillion/components/maintenanceTable.js index a8638df3..f94a7758 100644 --- a/web/client/src/sections/fillion/components/maintenanceTable.js +++ b/web/client/src/sections/fillion/components/maintenanceTable.js @@ -62,7 +62,7 @@ const DetailForm = (props) => { ]; const renderContent = (data) => { if (data) { - if (new Date(data.time) > new Date('2023-08-03')) { + if ( moment(data.time).isAfter(moment('2023-08-03 00:00:00'))) { return keyList.map(obj => { return
{obj.key} @@ -217,7 +217,7 @@ const DetailList = (props) => { dataIndex: 'projectType', align: 'center', render: (text, record) => { - return record.projectType.length > 0 ? reportTypeText(text) : (record.codeRoad && record.codeRoad.length > 0) + return record.projectType?.length > 0 ? reportTypeText(text) : (record.codeRoad && record.codeRoad.length > 0) ? record.codeRoad[0] === 'X' ? '县道' : record.codeRoad[0] === 'Y' diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index 82ef2d51..6e47e36a 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -99,7 +99,10 @@ const DetailForm = (props) => { if (data) { // Object.keys(data).map(key => { // }) - if ((new Date(data.time + '') > new Date('2023-8-3'))) { + if ( + moment(data.time).isAfter(moment('2023-08-03 00:00:00')) + // (new Date(data.time + '') > new Date('2023-8-3')) + ) { return keyList.map(obj => { return ( @@ -295,13 +298,13 @@ const DetailList = (props) => { dataIndex: 'projectType', align: 'center', render: (text, record) => { - return record.projectType.length > 0 ? reportTypeText(text) : (record.codeRoad && record.codeRoad.length > 0) - ? record.codeRoad[0] === 'X' - ? '县道' - : record.codeRoad[0] === 'Y' - ? '乡道' - : '村道' - : '' + return record.projectType?.length > 0 ? reportTypeText(text) : (record.codeRoad && record.codeRoad.length > 0) + ? record.codeRoad[0] === 'X' + ? '县道' + : record.codeRoad[0] === 'Y' + ? '乡道' + : '村道' + : '' } } : '', isRoad ? diff --git a/web/client/src/sections/fillion/containers/maintenanceSpotCheck.js b/web/client/src/sections/fillion/containers/maintenanceSpotCheck.js index 28586871..918b945a 100644 --- a/web/client/src/sections/fillion/containers/maintenanceSpotCheck.js +++ b/web/client/src/sections/fillion/containers/maintenanceSpotCheck.js @@ -80,7 +80,7 @@ const DetailForm = (props) => { ]; const renderContent = (data) => { if (data) { - if (new Date(data.time) > new Date('2023-08-03')) { + if ( moment(data.time).isAfter(moment('2023-08-03 00:00:00'))) { return keyList.map(obj => { return
{obj.key}