|
@ -6,7 +6,7 @@ import moment from 'moment'; |
|
|
|
|
|
|
|
|
const { RangePicker } = DatePicker; |
|
|
const { RangePicker } = DatePicker; |
|
|
|
|
|
|
|
|
const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userList, structureList, struLoading, type, curRecord }) => { |
|
|
const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userList, structureList, struLoading, type, curRecord, templateLoading, patrolTemplate }) => { |
|
|
const [userOpt, setUserOpt] = useState(); |
|
|
const [userOpt, setUserOpt] = useState(); |
|
|
const [struOpt, setStruOpt] = useState(); |
|
|
const [struOpt, setStruOpt] = useState(); |
|
|
const [pointOpt, setPointOpt] = useState(); |
|
|
const [pointOpt, setPointOpt] = useState(); |
|
@ -144,6 +144,21 @@ const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userLis |
|
|
> |
|
|
> |
|
|
<Input addonAfter={selectAfter} disabled={type === 'view'} /> |
|
|
<Input addonAfter={selectAfter} disabled={type === 'view'} /> |
|
|
</Form.Item> |
|
|
</Form.Item> |
|
|
|
|
|
<Form.Item |
|
|
|
|
|
name="templateId" |
|
|
|
|
|
label="巡检模板" |
|
|
|
|
|
rules={[ |
|
|
|
|
|
{ required: true, message: '请选择巡检模板' }, |
|
|
|
|
|
]} |
|
|
|
|
|
> |
|
|
|
|
|
<Select |
|
|
|
|
|
disabled={type === 'view'} |
|
|
|
|
|
options={patrolTemplate.map(t => { |
|
|
|
|
|
return { label: t.name, value: t.id } |
|
|
|
|
|
})} |
|
|
|
|
|
loading={templateLoading} |
|
|
|
|
|
/> |
|
|
|
|
|
</Form.Item> |
|
|
<Form.Item |
|
|
<Form.Item |
|
|
name="time" |
|
|
name="time" |
|
|
label="任务周期" |
|
|
label="任务周期" |
|
@ -190,13 +205,15 @@ const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userLis |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
function mapStateToProps (state) { |
|
|
const { auth, userList, structureList } = state |
|
|
const { auth, userList, structureList, patrolTemplate } = state |
|
|
return { |
|
|
return { |
|
|
user: auth.user, |
|
|
user: auth.user, |
|
|
userList: userList.data || [], |
|
|
userList: userList.data || [], |
|
|
structureList: structureList.data || [], |
|
|
structureList: structureList.data || [], |
|
|
|
|
|
patrolTemplate: (patrolTemplate.data || { rows: [] }).rows, |
|
|
userLoading: userList.isRequesting, |
|
|
userLoading: userList.isRequesting, |
|
|
struLoading: structureList.isRequesting |
|
|
struLoading: structureList.isRequesting, |
|
|
|
|
|
templateLoading: patrolTemplate.isRequesting, |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
export default connect(mapStateToProps)(PlanModal); |
|
|
export default connect(mapStateToProps)(PlanModal); |