From 811332a62dc458036f1315b2c8427d5672975922 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Fri, 24 Feb 2023 11:33:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=B7=A1=E6=A3=80=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=94=99=E8=AF=AF=E6=95=B0=E6=8D=AE=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../patrolManage/patrolTemplate.js | 9 +++-- .../patrolManage/containers/patrolRecord.js | 38 +++++++------------ 2 files changed, 18 insertions(+), 29 deletions(-) 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 => )} - } */} )