diff --git a/web/client/src/sections/fillion/components/maintenanceTable.js b/web/client/src/sections/fillion/components/maintenanceTable.js index f58c8dc7..a0d29e11 100644 --- a/web/client/src/sections/fillion/components/maintenanceTable.js +++ b/web/client/src/sections/fillion/components/maintenanceTable.js @@ -9,6 +9,7 @@ import { PinyinHelper } from '@peace/utils'; // @ts-ignore import styles from './protable.less'; import moment from 'moment'; +import { reportTypeText } from './patrolTable' const DetailForm = (props) => { const { visible, data, handleClose, loading } = props; @@ -32,7 +33,18 @@ const DetailForm = (props) => { {obj.key} { obj.name != 'scenePic' && obj.name.indexOf('conserve') == -1 ? - + :
{ @@ -120,13 +132,7 @@ const DetailList = (props) => { dataIndex: 'projectType', align: 'center', render: (text, record) => { - switch (text) { - case 'road': return '道路'; - case 'bridge': return '桥梁'; - case 'culvert': return '涵洞'; - case 'other': return '其他'; - default: return text; - } + return reportTypeText(text) } }, { title: '所属道路', @@ -380,7 +386,7 @@ const MaintenanceTable = (props) => { ); }; -function mapStateToProps(state) { +function mapStateToProps (state) { const { auth, depMessage, userList, reportList, reportDetail } = state; const pakData = (dep) => { return dep.map((d) => { diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js index f6b5c20f..c6ba55c3 100644 --- a/web/client/src/sections/fillion/components/patrolTable.js +++ b/web/client/src/sections/fillion/components/patrolTable.js @@ -11,7 +11,7 @@ import PatrolGis from './gis/patrolGis'; import styles from './protable.less'; import moment from 'moment'; -const reportTypeText = (text) => { +export const reportTypeText = (text) => { switch (text) { case 'road': return '道路'; //