From aea799ac1caa67223f6f86de0c092b35098ef72f Mon Sep 17 00:00:00 2001 From: wenlele Date: Mon, 28 Nov 2022 15:58:25 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=B5=8B=E9=A1=B9=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/service/components/pushModal.jsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/web/client/src/sections/service/components/pushModal.jsx b/web/client/src/sections/service/components/pushModal.jsx index 2754a4b..7bb780f 100644 --- a/web/client/src/sections/service/components/pushModal.jsx +++ b/web/client/src/sections/service/components/pushModal.jsx @@ -89,13 +89,19 @@ function pushModal (props) { } }) setProjectStructure(data) - let FactorId = [] - for (let key in alter?.pomsStrucFactorId) { - FactorId.push(key) - } - setFactorShow(FactorId?.map(Number)) + if (!editObj.id) { form.current.setValue('strucId', ProjectId) + } else { + let FactorId = [] + if (alter?.pomsStrucFactorId) { + for (let key in alter?.pomsStrucFactorId) { + FactorId.push(key) + } + setFactorShow(FactorId?.map(Number)) + } else { + setFactorShow(ProjectId) + } } form.current.validate(['strucId', 'timeType']) setStructure(false) @@ -309,7 +315,7 @@ function pushModal (props) { key={u.name + index} field={'factor' + u.id} style={{ width: 695 }} - initValue={editObj?.id ? editObj?.pomsStrucFactorId[u.id] : []} + initValue={editObj?.pomsStrucFactorId ? editObj?.pomsStrucFactorId[u.id] : []} direction='horizontal' showClear >