Browse Source

feat:异常反馈的查看添加三个字段

dev
zhaobing 2 years ago
parent
commit
7283a28c54
  1. 3
      api/app/lib/controllers/report/index.js
  2. 19
      web/client/src/sections/fillion/components/patrolTable.js

3
api/app/lib/controllers/report/index.js

@ -43,7 +43,8 @@ async function reportList(ctx) {
where: {
},
attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType', 'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad'],
attributes: ['id', 'road', 'time', 'projectType', 'roadSectionStart', 'performerId', 'roadSectionEnd', 'reportType',
'content', 'longitude', 'latitude', 'projectName', 'handleState', 'codeRoad', 'handleContent', 'handlePic'],
include: [{
model: models.User,
attributes: ['name']

19
web/client/src/sections/fillion/components/patrolTable.js

@ -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}
/>

Loading…
Cancel
Save