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 >