|
|
@ -48,13 +48,14 @@ const DetailForm = (props) => { |
|
|
|
{ key: '巡查内容', name: 'content' }, |
|
|
|
{ key: '路线代码', name: 'codeRoad' }, |
|
|
|
{ key: '现场照片', name: 'scenePic' }, |
|
|
|
|
|
|
|
{ key: '处理详情', name: 'handleContent', skip: !isAnomaly }, |
|
|
|
{ key: '处理图片', name: 'handlePic', skip: !isAnomaly }, |
|
|
|
{ key: '处理人', name: 'performerName', skip: !isAnomaly } |
|
|
|
]; |
|
|
|
|
|
|
|
const renderContent = (data) => { |
|
|
|
if (data) { |
|
|
|
// Object.keys(data).map(key => {
|
|
|
|
|
|
|
|
// })
|
|
|
|
return keyList.map(obj => { |
|
|
|
return ( |
|
|
@ -73,7 +74,7 @@ const DetailForm = (props) => { |
|
|
|
: |
|
|
|
obj.name == 'projectType' ? |
|
|
|
reportTypeText(data[obj.name]) : |
|
|
|
data[obj.name] |
|
|
|
data[obj.name] || null |
|
|
|
} |
|
|
|
disabled |
|
|
|
/> |
|
|
@ -593,7 +594,7 @@ const PatrolTable = (props) => { |
|
|
|
const [detailVisible, setDetailVisible] = useState(false) |
|
|
|
const [activeTabKey1, setActiveTabKey1] = useState('tab1'); |
|
|
|
const { RangePicker } = DatePicker; |
|
|
|
|
|
|
|
const [reportDetailCopy, setReportDetailCopy] = useState({})//匹配执行者的名字
|
|
|
|
const isRoad = pathname.includes('road') |
|
|
|
const isAnomaly = pathname.includes('anomaly') |
|
|
|
const isPatrol = !isRoad && !isAnomaly |
|
|
@ -604,10 +605,10 @@ const PatrolTable = (props) => { |
|
|
|
}, []) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
// if (userList && userList instanceof Array) {
|
|
|
|
// setRecord(userList[0]);
|
|
|
|
// }
|
|
|
|
}, [userList]) |
|
|
|
if (userList && userList instanceof Array && reportDetail && reportDetail instanceof Object) { |
|
|
|
setReportDetailCopy(Object.assign(reportDetail, { performerName: userList.find(item => item.id === reportDetail.performerId)?.name })) |
|
|
|
} |
|
|
|
}, [userList, reportDetail]) |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
queryData(); |
|
|
@ -752,7 +753,7 @@ const PatrolTable = (props) => { |
|
|
|
<DetailForm |
|
|
|
visible={detailVisible} |
|
|
|
handleClose={handleClose} |
|
|
|
data={reportDetail} |
|
|
|
data={reportDetailCopy} |
|
|
|
loading={reportDetailLoading} |
|
|
|
isPatrol={isPatrol} isRoad={isRoad} isAnomaly={isAnomaly} |
|
|
|
/> |
|
|
|