From 0a7b731a60d46ce765d48c532388481d4c902ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Fri, 8 Dec 2023 14:28:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:fix=20bug--=E6=9C=88=E6=8A=A5=E6=97=B6?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8D=E5=9B=9E=E6=98=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/addReportRulesModal.js | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/web/client/src/sections/patrolManage/components/addReportRulesModal.js b/web/client/src/sections/patrolManage/components/addReportRulesModal.js index 6924512..db6abd1 100644 --- a/web/client/src/sections/patrolManage/components/addReportRulesModal.js +++ b/web/client/src/sections/patrolManage/components/addReportRulesModal.js @@ -49,6 +49,7 @@ const AddReportRulesModal = props => { }) setStructlist(list) },[]) + useEffect(() => { // setPic(modalData?.reportpic) form.setFieldsValue({ @@ -63,7 +64,7 @@ const AddReportRulesModal = props => { name: modalData?.name, type: modalData?.type, system:modalData?.system, - pic: modalData?.reportpic?.map(item=>{return {storageUrl:item,url:item}}), + pic: modalData?.reportpic?.map(item=>{return {storageUrl:item}}), timeRange: modalData?.startTime ? [moment(modalData?.startTime), moment(modalData?.endTime)] : [], }) }, [visible]) @@ -249,19 +250,19 @@ const AddReportRulesModal = props => { isQiniu={true} // disabled={true} fileTypes={['png', 'jpg']} - // fileList={pic} - // defaultValue={(() => { - // let nextV = [] - // for (let s of modalData?.reportpic || []) { - // if (s) { - // nextV.push({ - // url: s, - // storageUrl: s, - // }) - // } - // } - // return nextV - // })()} + fileList={modalData?.reportpic} + defaultValue={(() => { + let nextV = [] + for (let s of modalData?.reportpic || []) { + if (s) { + nextV.push({ + url: s, + storageUrl: s, + }) + } + } + return nextV + })()} />