|
|
@ -3,7 +3,8 @@ import { connect } from "react-redux"; |
|
|
|
import { Select, Modal, Form, Button, Toast } from "@douyinfe/semi-ui"; |
|
|
|
import { IconUpload } from '@douyinfe/semi-icons'; |
|
|
|
const EditModal = (props) => { |
|
|
|
const { dispatch, actions, user, onCancel, dataToEdit, apiRoot, close } = props; |
|
|
|
const { dispatch, actions, user, onCancel, dataToEdit, apiRoot, close, |
|
|
|
DepartmentTrainType, DepartmentTrainMethod, DepartmentTrainAppraisalMethod } = props; |
|
|
|
const { humanAffairs } = actions; |
|
|
|
const form = useRef();//表单
|
|
|
|
const [options, setOptions] = useState([]); |
|
|
@ -121,16 +122,20 @@ const EditModal = (props) => { |
|
|
|
> |
|
|
|
{options} |
|
|
|
</Form.Select> |
|
|
|
<Form.Input |
|
|
|
<Form.Select |
|
|
|
field="trainingType" |
|
|
|
label="培训类型" |
|
|
|
label={{ text: '培训类型', required: true }} |
|
|
|
style={{ width: '100%' }} |
|
|
|
initValue={dataToEdit?.trainingType || ""} |
|
|
|
placeholder="请输入培训类型" |
|
|
|
showClear |
|
|
|
validate={validate} |
|
|
|
validateStatus={validateStatus} |
|
|
|
/> |
|
|
|
placeholder='请选择培训类型' |
|
|
|
filter |
|
|
|
rules={[{ required: true, message: '请选择培训类型' }]} |
|
|
|
> |
|
|
|
{DepartmentTrainType.map((d, i) => <Select.Option value={d} key={`type-${i}`}> |
|
|
|
{d} |
|
|
|
</Select.Option>)} |
|
|
|
</Form.Select> |
|
|
|
<Form.DatePicker |
|
|
|
field='trainDate' |
|
|
|
type='dateTime' |
|
|
@ -141,21 +146,16 @@ const EditModal = (props) => { |
|
|
|
rules={[{ required: true, message: "培训时间不可空" }]} |
|
|
|
disabled={dataToEdit?.id ? true : false} |
|
|
|
/> |
|
|
|
<Form.Input |
|
|
|
<Form.TextArea |
|
|
|
field="trainContent" |
|
|
|
label="培训内容" |
|
|
|
label={{ text: '培训内容', required: true }} |
|
|
|
style={{ width: '100%' }} |
|
|
|
initValue={dataToEdit?.trainContent || ""} |
|
|
|
placeholder="请输入培训内容" |
|
|
|
showClear |
|
|
|
|
|
|
|
rows={3} maxCount={200} |
|
|
|
validate={validateContent} |
|
|
|
validateStatus={validateStatus} |
|
|
|
// rules={[{
|
|
|
|
// required: true, message: "培训内容不可空"
|
|
|
|
// }, {
|
|
|
|
// max: 200, message: "最多200个字符"
|
|
|
|
// }]}
|
|
|
|
/> |
|
|
|
<Form.Input |
|
|
|
field="trainWho" |
|
|
@ -173,34 +173,38 @@ const EditModal = (props) => { |
|
|
|
placeholder="请输入培训讲师" |
|
|
|
showClear |
|
|
|
/> |
|
|
|
<Form.Input |
|
|
|
<Form.Select |
|
|
|
field="trainMethod" |
|
|
|
label='培训方式' |
|
|
|
label={{ text: '培训方式', required: true }} |
|
|
|
style={{ width: '100%' }} |
|
|
|
initValue={dataToEdit?.trainMethod || ""} |
|
|
|
placeholder="请输入培训方式" |
|
|
|
showClear |
|
|
|
validate={validate} |
|
|
|
validateStatus={validateStatus} |
|
|
|
/> |
|
|
|
<Form.Input |
|
|
|
placeholder='请选择培训方式' |
|
|
|
filter |
|
|
|
rules={[{ required: true, message: '请选择培训方式' }]} |
|
|
|
> |
|
|
|
{DepartmentTrainMethod.map((d, i) => <Select.Option value={d} key={`trainMethod-${i}`}> |
|
|
|
{d} |
|
|
|
</Select.Option>)} |
|
|
|
</Form.Select> |
|
|
|
<Form.Select |
|
|
|
field="appraisalMethod" |
|
|
|
label='考核形式' |
|
|
|
label={{ text: '考核形式', required: true }} |
|
|
|
style={{ width: '100%' }} |
|
|
|
initValue={dataToEdit?.appraisalMethod || ""} |
|
|
|
placeholder="请输入考核形式" |
|
|
|
showClear |
|
|
|
validate={validate} |
|
|
|
validateStatus={validateStatus} |
|
|
|
// rules={[{
|
|
|
|
// required: true, message: "考核形式不可空"
|
|
|
|
// }, {
|
|
|
|
// max: 20, message: "最多20个字符"
|
|
|
|
// }]}
|
|
|
|
/> |
|
|
|
placeholder='请选择考核形式' |
|
|
|
filter |
|
|
|
rules={[{ required: true, message: '请选择考核形式' }]} |
|
|
|
> |
|
|
|
{DepartmentTrainAppraisalMethod.map((d, i) => <Select.Option value={d} key={`appraisalMethod-${i}`}> |
|
|
|
{d} |
|
|
|
</Select.Option>)} |
|
|
|
</Form.Select> |
|
|
|
|
|
|
|
<Form.Input |
|
|
|
field="trainTime" |
|
|
|
label='培训时长' |
|
|
|
label={{ text: '培训时长', required: true }} |
|
|
|
style={{ width: '100%' }} |
|
|
|
initValue={dataToEdit?.trainTime || ""} |
|
|
|
placeholder="请输入培训时长" |
|
|
|