liujiangyong 2 years ago
parent
commit
0bcece84a5
  1. 9
      api/app/lib/controllers/patrolManage/patrolTemplate.js
  2. 38
      web/client/src/sections/patrolManage/containers/patrolRecord.js

9
api/app/lib/controllers/patrolManage/patrolTemplate.js

@ -145,15 +145,16 @@ async function delPatrolTemplate (ctx, next) {
throw errMsg;
}
await models.PatrolTemplate.destroy({
where: { id },
transaction
})
await models.PatrolTemplateCheckItems.destroy({
where: { templateId: id },
transaction
})
await models.PatrolTemplate.destroy({
where: { id },
transaction
})
await transaction.commit();
ctx.status = 204;
} catch (error) {

38
web/client/src/sections/patrolManage/containers/patrolRecord.js

@ -238,11 +238,19 @@ const PatrolRecord = (props) => {
isQiniu={true}
disabled={true}
fileTypes={["png", "jpg"]}
defaultValue={(inspectContent[k].imgs || []).map(s => {
return {
storageUrl: s
}
})}
defaultValue={
(() => {
let nextV = []
for (let s of (inspectContent[k].imgs || [])) {
if (s) {
nextV.push({
storageUrl: s
})
}
}
return nextV
})()
}
/>
</Col>
</Row>
@ -257,26 +265,6 @@ const PatrolRecord = (props) => {
}
return dataArr
})()}
{/* <Row align='middle' justify='center' style={{ marginBottom: 10 }}>
当前点位{modelData?.points?.itemData?.name}
</Row>
<Row align='middle' justify='center' style={{ marginBottom: 10 }}>
当前位置{modelData?.points?.address}
</Row>
<Row align='middle' justify='center' style={{ marginBottom: 10 }}>
巡检结果{modelData.alarm ? '异常' : '正常'}
</Row>
{!modelData.alarm ? '' :
<Row align='middle' justify='center' style={{ marginBottom: 10 }}>
巡检详情{modelData?.points?.msgInp}
</Row>}
{!modelData.alarm ? '' :
<Row align='middle' justify='center' style={{ marginBottom: 10 }}>
异常等级{modelData?.points?.changeThree}
</Row>}
{!modelData.alarm ? '' : <Row align='middle' justify='center' style={{ marginBottom: 10 }}>
{modelData?.points?.imgs?.map(rs => <img key={rs} src={`/_file-server/${rs}`} style={{ display: 'inline-block', width: 260, marginBottom: 10 }} />)}
</Row>} */}
</Modal>
</div>
)

Loading…
Cancel
Save