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: { 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: [{ include: [{
model: models.User, model: models.User,
attributes: ['name'] attributes: ['name']

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

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

Loading…
Cancel
Save