-
{obj.key}
- {
- obj.name != 'scenePic' && obj.name.indexOf('conserve') == -1 ?
-
- :
-
- {
- data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
- return
-
-
- }) : '暂无图片'
- }
-
+ if (new Date(data.time) > new Date('2023-08-01')) {
+ return keyList.map(obj => {
+ return
+
{obj.key}
+ {
+ obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
+
+ : obj.name != 'roadSectionStart' && obj.name != 'videoUrl' ?
+
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
+ return
+
+
+ }) : '暂无图片'
+ }
+
: obj.name != 'videoUrl' ?
+
+
+
:
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
+ return
+
+
+ }) : '暂无视频'
+ }
+
+ }
+
+
+ })
+
+ } else {
+ return keyListOld.map(obj => {
+ return
+
{obj.key}
+ {
+ obj.name != 'scenePic' && obj.name.indexOf('conserve') == -1 ?
+
+ :
+
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
+ return
+
+
+ }) : '暂无图片'
+ }
+
+
+ }
+
+ })
+
+ }
- }
-
- })
} else {
return '暂无数据'
}
@@ -113,25 +189,26 @@ const DetailList = (props) => {
let counter = 0;
const columns = [
+ // {
+ // title: '编号',
+ // key: 'id',
+ // dataIndex: 'id',
+ // align: 'center',
+ // render: (text, record) => {
+ // let day = moment(record.time).format("YYYYMMDD")
+ // if (!basicDate) {
+ // basicDate = day;
+ // counter += 1;
+ // } else if (basicDate == day) {
+ // counter += 1;
+ // } else if (basicDate != day) {
+ // basicDate = day;
+ // counter = 1;
+ // }
+ // return moment(record.time).format("YYYYMMDD") * 10000 + counter;
+ // }
+ // },
{
- title: '编号',
- key: 'id',
- dataIndex: 'id',
- align: 'center',
- render: (text, record) => {
- let day = moment(record.time).format("YYYYMMDD")
- if (!basicDate) {
- basicDate = day;
- counter += 1;
- } else if (basicDate == day) {
- counter += 1;
- } else if (basicDate != day) {
- basicDate = day;
- counter = 1;
- }
- return moment(record.time).format("YYYYMMDD") * 10000 + counter;
- }
- }, {
title: '工程类型',
key: 'projectType',
dataIndex: 'projectType',
@@ -154,9 +231,9 @@ const DetailList = (props) => {
}
},
{
- title: '具体内容',
- key: 'content',
- dataIndex: 'content',
+ title: '具体位置',
+ key: 'address',
+ dataIndex: 'address',
align: 'center'
},
{
@@ -457,13 +534,13 @@ const PatrolNameList = (props) => {
const MaintenanceTable = (props) => {
- const { userList, user, reportList, dispatch, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, depMessage, depUser, clientHeight } = props;
+ const { userList, user, reportList, dispatch, allDepUsers, reportListLoading, reportDetail, reportDetailLoading, userLoading, exports, depMessage, depUser, clientHeight } = props;
const [record, setRecord] = useState(1);
const [dateRange, setDateRange] = useState();
const [detailVisible, setDetailVisible] = useState(false)
const { RangePicker } = DatePicker;
-
+ // console.log('allDepUsers', allDepUsers)
useEffect(() => {
queryData()
}, [])
@@ -479,30 +556,33 @@ const MaintenanceTable = (props) => {
// if (record) {
queryData()
// }
- }, [record, dateRange])
+ }, [record, dateRange, allDepUsers, user])
const queryData = () => {
- let userId = null
- if (user?.username === 'SuperAdmin' && record === 1) {
- userId = undefined
- } else if (user?.username === 'SuperAdmin' && record !== 1) {
- userId = record
- } else if (user?.username !== 'SuperAdmin' && record === 1) {
- userId = user?.id
- } else if (user?.username !== 'SuperAdmin' && record !== 1) {
- userId = record
- }
- //: user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id
- let query = {
- userId,
- reportType: 'conserve',
- asc: true
- }
- if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
- query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
- query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
+ if (allDepUsers && allDepUsers.length && user) {
+ //console.log('ssssss',)
+ const userL = allDepUsers.find(item => item.depId === user.departmentId)?.users?.map(child => { return child.id })
+ let userId = null
+ if (user?.username === 'SuperAdmin' && record === 1) {
+ userId = undefined
+ } else if (user?.username !== 'SuperAdmin' && record === 1) {
+ userId = userL && userL.length ? userL + '' : undefined
+ } else {
+ userId = record
+ }
+
+ //: user?.username === 'SuperAdmin' && record === 1 ? record?.id : record ? record : user?.id
+ let query = {
+ userId,
+ reportType: 'conserve',
+ asc: true
+ }
+ if ((dateRange && dateRange instanceof Array && dateRange[0] != '')) {
+ query.startTime = moment(dateRange[0]).startOf('day').format('YYYY-MM-DD HH:mm:ss')
+ query.endTime = moment(dateRange[1]).endOf('day').format('YYYY-MM-DD HH:mm:ss')
+ }
+ dispatch(getReportList(query))
}
- dispatch(getReportList(query));
}
const handleClose = () => {
@@ -560,7 +640,7 @@ const MaintenanceTable = (props) => {
};
function mapStateToProps(state) {
- const { auth, depMessage, userList, reportList, reportDetail, depUser, global } = state;
+ const { auth, depMessage, userList, reportList, reportDetail, depUser, global, allDepUsers } = state;
const pakData = (dep) => {
return dep.map((d) => {
return {
@@ -584,6 +664,7 @@ function mapStateToProps(state) {
reportDetail: reportDetail.data,
reportDetailLoading: reportDetail.isRequesting,
depUser: depUser.data || [],
+ allDepUsers: allDepUsers.data || []
};
}
diff --git a/web/client/src/sections/fillion/components/patrolTable.js b/web/client/src/sections/fillion/components/patrolTable.js
index a411d36a..a36435ef 100644
--- a/web/client/src/sections/fillion/components/patrolTable.js
+++ b/web/client/src/sections/fillion/components/patrolTable.js
@@ -13,6 +13,7 @@ import NominateModal from '../components/feedback/nominateModal' //指派的模
// @ts-ignore
import styles from './protable.less';
import moment from 'moment';
+import NominateModalcopy from './feedback/nominateModalcopy';//指派的模块
export const reportTypeText = (text) => {
switch (text) {
@@ -39,6 +40,39 @@ const DetailForm = (props) => {
const [qndmn] = useState(localStorage.getItem('qndmn'));
const keyList = [
+ // { key: '编号', name: 'id' },
+ // isPatrol ?'巡查管理详情' :isRoad ? '建设上报详情' : '异常反馈详情'
+ { key: '工程类型', name: 'projectType', skip: isPatrol },
+ { key: '反馈类型', name: 'projectType', skip: !isAnomaly },
+ { key: '工程名称', name: 'projectName', skip: !isRoad },
+ { key: '所在路段', name: 'road', skip: isPatrol },
+ { key: '具体位置', name: 'address', skip: isPatrol },
+ { key: '巡查内容', name: 'content', skip: isPatrol },
+ { key: '路线代码', name: 'codeRoad', skip: !isAnomaly && isPatrol },
+ { key: '现场照片', name: 'scenePic', skip: isPatrol },
+ { key: '处理详情', name: 'handleContent', skip: !isAnomaly },
+ { key: '处理图片', name: 'handlePic', skip: !isAnomaly },
+ { key: '处理人', name: 'performerName', skip: !isAnomaly },
+
+ { key: '道路类型', name: 'reportType', skip: !isPatrol },
+ { key: '其他', name: 'projectType', skip: !isPatrol },
+ { key: '路线名称', name: 'road', skip: !isPatrol },
+ { key: '巡查路段', name: 'roadSectionStart', skip: !isPatrol },
+ { key: '具体位置', name: 'address', skip: !isPatrol },
+ { key: '是否有异常', name: 'inspectionNoException', skip: !isPatrol },
+ // insectionNoException
+ { key: '路面损坏', name: 'roadDamage', skip: !isPatrol },
+ { key: '安防损坏', name: 'securityDamage', skip: !isPatrol },
+ { key: '桥梁损坏', name: 'bridgeDamage', skip: !isPatrol },
+ { key: '涵洞损坏', name: 'culvertDamage', skip: !isPatrol },
+ { key: '安防缺失', name: 'ecurityDeficiency', skip: !isPatrol },
+ { key: '路域环境', name: 'encounteredEnvironment', skip: !isPatrol },
+ { key: '其他内容', name: 'otherDescription', skip: !isPatrol },
+ //{ key: '路线代码', name: 'codeRoad', skip: !isPatrol },
+ { key: '上报图片', name: 'scenePic', skip: !isPatrol },
+ { key: '上报视频', name: 'videoUrl', skip: !isPatrol },
+ ];
+ const keyListOld = [
// { key: '编号', name: 'id' },
// isPatrol ?'巡查管理详情' :isRoad ? '建设上报详情' : '异常反馈详情'
{ key: '工程类型', name: 'projectType', skip: !isPatrol },
@@ -54,47 +88,103 @@ const DetailForm = (props) => {
{ key: '处理人', name: 'performerName', skip: !isAnomaly }
];
+ const changeBoolean = (bool) => {
+ //console.log('bool', bool)
+ return bool ? '无异常' : '有异常'
+ }
const renderContent = (data) => {
if (data) {
// Object.keys(data).map(key => {
// })
- return keyList.map(obj => {
- return (
- obj.skip ? null :
-
-
{obj.key}
- {
- obj.name != 'scenePic' && obj.name != 'handlePic' ?
-
- :
-
- {
- data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
- return
-
-
- })
- : '暂无图片'
- }
-
+ if ((new Date(data.time + '') > new Date('2023-8-1'))) {
+
+ return keyList.map(obj => {
+ return (
+ obj.skip ? null :
+
+
{obj.key}
+ {
+ obj.name != 'scenePic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
+
+ : obj.name != 'roadSectionStart' && obj.name != 'videoUrl' ?
+
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
+ return
+
+
+ }) : '暂无图片'
+ }
+
: obj.name != 'videoUrl' ?
+
+
+
:
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
+ return
+
+
+ }) : '暂无视频'
+ }
+
+ }
+
+
+ )
+ })
+ } else {
+ return keyListOld.map(obj => {
+ return (
+ obj.skip ? null :
+
+
{obj.key}
+ {
+ obj.name != 'scenePic' && obj.name != 'handlePic' ?
+
+ :
+
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
+ return
+
+
+ })
+ : '暂无图片'
+ }
+
+
+ }
+
+ )
+ })
+ }
- }
-
- )
- })
} else {
+
return '暂无数据'
+
}
}
@@ -151,27 +241,26 @@ const DetailList = (props) => {
let basicDate = null;
let counter = 0;
//指派任务
- console.log('vis', vis)
const columns = [
- isPatrol ? {
- title: '编号',
- key: 'id',
- dataIndex: 'id',
- align: 'center',
- render: (text, record) => {
- let day = moment(record.time).format("YYYYMMDD")
- if (!basicDate) {
- basicDate = day;
- counter += 1;
- } else if (basicDate == day) {
- counter += 1;
- } else if (basicDate != day) {
- basicDate = day;
- counter = 1;
- }
- return moment(record.time).format("YYYYMMDD") * 10000 + counter;
- }
- } : '',
+ // isPatrol ? {
+ // title: '编号1',
+ // key: 'id',
+ // dataIndex: 'id',
+ // align: 'center',
+ // render: (text, record) => {
+ // let day = moment(record.time).format("YYYYMMDD")
+ // if (!basicDate) {
+ // basicDate = day;
+ // counter += 1;
+ // } else if (basicDate == day) {
+ // counter += 1;
+ // } else if (basicDate != day) {
+ // basicDate = day;
+ // counter = 1;
+ // }
+ // return moment(record.time).format("YYYYMMDD") * 10000 + counter;
+ // }
+ // } : '',
isPatrol || isAnomaly ?
{
title: isPatrol ? '工程类型' : '反馈类型',
@@ -222,9 +311,9 @@ const DetailList = (props) => {
}
} : '',
{
- title: '具体内容',
- key: 'content',
- dataIndex: 'content',
+ title: '具体位置',
+ key: 'address',
+ dataIndex: 'address',
align: 'center'
},
{
@@ -314,7 +403,8 @@ const DetailList = (props) => {
toolBarRender={false}
search={false}
/>
-
+
{obj.key}
+ {
+ obj.name != 'conserveBeforePic' && obj.name != 'conserveAfterPic' && obj.name != 'roadSectionStart' && obj.name != 'videoUrl' && obj.name.indexOf('conserve') == -1 ?
+
+ : obj.name != 'roadSectionStart' && obj.name != 'videoUrl' ?
+
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
+ return
+
+
+ }) : '暂无图片'
+ }
+
: obj.name != 'videoUrl' ?
+
+
+
:
+ {
+ data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(videoUrl => {
+ return
+
+
+ }) : '暂无视频'
+ }
+
+ }
+
+
+ })
+
+ } else {
+ return keyListOld.map(obj => {
+ return
+ //
{obj.key}
+ // {
+ // obj.name === 'scenePic' && data[obj.name] instanceof Array ?
+ //
+ // {
+ // data[obj.name].map(imgSrc => {
+ // return
+ //
+ //
+ // })
+ // }
+ //
+ // : obj.name === 'roadSectionStart' ?
+ //
+ //
+ //
+ // :
+ //
+ // }
+ //
+ // );
+ // } else {
+ // return null; // 不渲染异常相关字段
+ // }
+ // });
+ // } else {
+ // // 当'无异常'字段为false或未定义时,显示其他异常相关字段
+ // return keyList.map(obj => {
+ // if (obj.name !== 'inspectionNoException') {
+ // return (
+ //
+ //
{obj.key}
+ // {
+ // obj.name !== 'scenePic' && obj.name !== 'roadSectionStart' && obj.name.indexOf('conserve') === -1 ?
+ //
+ // : obj.name !== 'roadSectionStart' ?
+ //
+ // {
+ // data[obj.name] && data[obj.name] instanceof Array ? data[obj.name].map(imgSrc => {
+ // return
+ //
+ //
+ // }) : '暂无图片'
+ // }
+ //
+ // :
+ //
+ //
+ // }
+ //
+ // );
+ // } else {
+ // return null; // 不渲染其他异常字段
+ // }
+ // });
+ // }
+ // } else {
+ // return '暂无数据';
+ // }
+ // }
+ return (
+