|
|
@ -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: '请选择结构物' }, |
|
|
|
]} |
|
|
|
> |
|
|
|
<Select disabled={type === 'view'} options={struOpt} loading={struLoading} onChange={(value) => { |
|
|
|
dispatch(positionList({ projectId: value })).then(res => { |
|
|
|
<Select disabled={type === 'view'} options={struOpt} loading={struLoading} onChange={(projectId) => { |
|
|
|
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 }))) |
|
|
|
}} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item |
|
|
|