diff --git a/web/client/src/sections/patrolManage/components/planModal.js b/web/client/src/sections/patrolManage/components/planModal.js index 8eaa551..d4a1168 100644 --- a/web/client/src/sections/patrolManage/components/planModal.js +++ b/web/client/src/sections/patrolManage/components/planModal.js @@ -33,7 +33,7 @@ const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userLis useEffect(() => { if (userList.length) { - setUserOpt(userList.map(u => ({ label: u.name, value: u.id }))) + setUserOpt(userList?.filter(f => f.structure?.includes(curRecord?.project?.id))?.map(u => ({ label: u.name, value: u.id }))) } }, [userList]) @@ -104,13 +104,15 @@ const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userLis { required: true, message: '请选择结构物' }, ]} > - { + dispatch(positionList({ projectId })).then(res => { if (res.success) { setPoints(res.payload.data?.rows) setPointOpt(res.payload.data?.rows[0]?.points?.map(p => ({ label: p.name, value: p.id }))) } }) + form.setFieldsValue({ userId: null }); + setUserOpt(userList?.filter(f => f.structure?.includes(projectId))?.map(u => ({ label: u.name, value: u.id }))) }} />