|
|
@ -7,7 +7,7 @@ import moment from 'moment'; |
|
|
|
const { RangePicker } = DatePicker; |
|
|
|
const { TextArea } = Input; |
|
|
|
|
|
|
|
const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef }) => { |
|
|
|
const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef, checkItemsGroup }) => { |
|
|
|
const [form] = Form.useForm(); |
|
|
|
|
|
|
|
return ( |
|
|
@ -61,6 +61,7 @@ const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef }) = |
|
|
|
name="form_in_modal" |
|
|
|
initialValues={{ |
|
|
|
...curRecord, |
|
|
|
checkItems: curRecord?.check_items?.map(c => c.id) |
|
|
|
}} |
|
|
|
> |
|
|
|
<Form.Item |
|
|
@ -91,30 +92,19 @@ const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef }) = |
|
|
|
// width: 200,
|
|
|
|
}} |
|
|
|
mode="multiple" |
|
|
|
options={[ |
|
|
|
{ |
|
|
|
label: 'Manager', |
|
|
|
options: [ |
|
|
|
{ |
|
|
|
label: 'Jack', |
|
|
|
value: 1, |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Lucy', |
|
|
|
value: 2, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: 'Engineer', |
|
|
|
options: [ |
|
|
|
{ |
|
|
|
label: 'yiminghe', |
|
|
|
value: 3, |
|
|
|
}, |
|
|
|
], |
|
|
|
}, |
|
|
|
]} |
|
|
|
options={ |
|
|
|
checkItemsGroup.map(g => { |
|
|
|
return { |
|
|
|
label: g.name, |
|
|
|
options: g.check_items.map(c => { |
|
|
|
return { |
|
|
|
label: c.name, |
|
|
|
value: c.id, |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
</Form> |
|
|
@ -123,13 +113,10 @@ const PlanModal = ({ visible, onCancel, dispatch, type, curRecord, tableRef }) = |
|
|
|
}; |
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
|
const { auth, userList, structureList } = state |
|
|
|
const { auth, checkItemsGroup } = state |
|
|
|
return { |
|
|
|
user: auth.user, |
|
|
|
userList: userList.data || [], |
|
|
|
structureList: structureList.data || [], |
|
|
|
userLoading: userList.isRequesting, |
|
|
|
struLoading: structureList.isRequesting |
|
|
|
checkItemsGroup: checkItemsGroup.data || [] |
|
|
|
} |
|
|
|
} |
|
|
|
export default connect(mapStateToProps)(PlanModal); |