diff --git a/api/app/lib/controllers/patrolManage/patrolTemplate.js b/api/app/lib/controllers/patrolManage/patrolTemplate.js index d538a24..5038706 100644 --- a/api/app/lib/controllers/patrolManage/patrolTemplate.js +++ b/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) { diff --git a/web/client/src/sections/patrolManage/containers/patrolRecord.js b/web/client/src/sections/patrolManage/containers/patrolRecord.js index dee8f12..aa9c869 100644 --- a/web/client/src/sections/patrolManage/containers/patrolRecord.js +++ b/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 + })() + } /> @@ -257,26 +265,6 @@ const PatrolRecord = (props) => { } return dataArr })()} - {/* - 当前点位:{modelData?.points?.itemData?.name} - - - 当前位置:{modelData?.points?.address} - - - 巡检结果:{modelData.alarm ? '异常' : '正常'} - - {!modelData.alarm ? '' : - - 巡检详情:{modelData?.points?.msgInp} - } - {!modelData.alarm ? '' : - - 异常等级:{modelData?.points?.changeThree} - } - {!modelData.alarm ? '' : - {modelData?.points?.imgs?.map(rs => )} - } */} )