From 5d9e0adf15be424b3bfdb332af847a012efeb926 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Sat, 30 Jul 2022 17:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E6=9F=A5=E7=AE=A1=E7=90=86-=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E5=B7=A1=E6=9F=A5tab=E8=AE=B0=E5=BD=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=BC=96=E5=8F=B7=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fillion/components/maintenanceTable.js | 19 +++++++++++++++++ .../fillion/components/patrolTable.js | 21 +++++++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/web/client/src/sections/fillion/components/maintenanceTable.js b/web/client/src/sections/fillion/components/maintenanceTable.js index b33c19a6..0e00c751 100644 --- a/web/client/src/sections/fillion/components/maintenanceTable.js +++ b/web/client/src/sections/fillion/components/maintenanceTable.js @@ -90,6 +90,8 @@ const DetailList = (props) => { } } + let daySet = {}; + const columns = [ { title: '编号', @@ -97,6 +99,14 @@ const DetailList = (props) => { dataIndex: 'id', align: 'center', render: (text, record) => { + let day = moment(record.time).format("YYYYMMDD") + if (daySet[day]) { + daySet[day].add(Symbol()) + } else { + daySet[day] = new Set() + daySet[day].add(Symbol()) + } + return day * 10000 + daySet[day].size return moment(record.time).format("YYYYMMDD") * 10000 + record.id; } }, { @@ -104,6 +114,15 @@ const DetailList = (props) => { key: 'projectType', dataIndex: 'projectType', align: 'center', + render: (text, record) => { + switch (text) { + case 'road': return '道路'; + case 'bridge': return '桥梁'; + case 'culvert ': return '涵洞'; + case 'other': return '其他'; + default: return text; + } + } }, { title: '所属道路', key: 'road', diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index e8b49e3c..c2bfd650 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -90,7 +90,7 @@ const DetailList = (props) => { }) } } - + let daySet = {}; const columns = [ { title: '编号', @@ -98,6 +98,14 @@ const DetailList = (props) => { dataIndex: 'id', align: 'center', render: (text, record) => { + let day = moment(record.time).format("YYYYMMDD") + if (daySet[day]) { + daySet[day].add(Symbol()) + } else { + daySet[day] = new Set() + daySet[day].add(Symbol()) + } + return day * 10000 + daySet[day].size return moment(record.time).format("YYYYMMDD") * 10000 + record.id; } }, @@ -106,6 +114,15 @@ const DetailList = (props) => { key: 'projectType', dataIndex: 'projectType', align: 'center', + render: (text, record) => { + switch (text) { + case 'road': return '道路'; + case 'bridge': return '桥梁'; + case 'culvert ': return '涵洞'; + case 'other': return '其他'; + default: return text; + } + } }, { title: '所属道路', @@ -388,7 +405,7 @@ const PatrolTable = (props) => { ); }; -function mapStateToProps(state) { +function mapStateToProps (state) { const { auth, depMessage, userList, reportList, reportDetail } = state; const pakData = (dep) => { return dep.map((d) => {