Browse Source

添加可选链判断

master
liujiangyong 2 years ago
parent
commit
a56e4b5df1
  1. 4
      web/client/src/sections/patrolManage/components/planModal.js

4
web/client/src/sections/patrolManage/components/planModal.js

@ -196,9 +196,9 @@ const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userLis
]}
>
<Select mode="multiple" disabled={type === 'view'} options={userOpt} loading={userLoading} onChange={(values) => {
const selectUser = userList.filter(u => values?.includes(u.id))
const selectUser = userList?.filter(u => values?.includes(u.id))
form.setFieldsValue({
userDept: [...new Set(selectUser.map(u => u.department.name))].join()
userDept: [...new Set(selectUser?.map(u => u.department.name))].join()
});
}} />
</Form.Item>

Loading…
Cancel
Save