From 3d0de3701eb3f25dcd20513e3221936d9707f2db Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Thu, 3 Aug 2023 02:24:15 +0800 Subject: [PATCH] fix bugs --- .../src/sections/fillion/components/maintenanceTable.js | 9 +++++++-- .../src/sections/fillion/components/patrolTable.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/web/client/src/sections/fillion/components/maintenanceTable.js b/web/client/src/sections/fillion/components/maintenanceTable.js index e312a354..3b77aa07 100644 --- a/web/client/src/sections/fillion/components/maintenanceTable.js +++ b/web/client/src/sections/fillion/components/maintenanceTable.js @@ -217,8 +217,13 @@ const DetailList = (props) => { dataIndex: 'projectType', align: 'center', render: (text, record) => { - return record.projectType.length > 0 ? reportTypeText(text) : 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' + ? '乡道' + : '村道' + : '' } }, { title: '所属道路', diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index cbf2d374..72067d1d 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -295,8 +295,13 @@ const DetailList = (props) => { dataIndex: 'projectType', align: 'center', render: (text, record) => { - return record.projectType.length > 0 ? reportTypeText(text) : 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 ?