|
|
@@ -35,6 +35,8 @@ const PositionEditor: React.FC<EditorProps> = (props) => { |
|
|
|
if (visible) { |
|
|
|
if (data) { |
|
|
|
form.setFieldsValue(data); |
|
|
|
} else { |
|
|
|
form.setFieldValue("status", 0); |
|
|
|
} |
|
|
|
} else { |
|
|
|
form.resetFields(); |
|
|
@@ -42,6 +44,7 @@ const PositionEditor: React.FC<EditorProps> = (props) => { |
|
|
|
}, [visible]); |
|
|
|
|
|
|
|
const save = async () => { |
|
|
|
await form.validateFields(); |
|
|
|
setSaveLoading(true); |
|
|
|
const fieldValues = form.getFieldsValue(); |
|
|
|
const newValue = isEdit ? { ...data, ...fieldValues } : fieldValues; |
|
|
@@ -97,7 +100,14 @@ const PositionEditor: React.FC<EditorProps> = (props) => { |
|
|
|
<Input /> |
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
<Form.Item name="sort" label="岗位顺序" > |
|
|
|
<Form.Item name="sort" label="岗位顺序" |
|
|
|
rules={[ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: '请输入岗位顺序', |
|
|
|
}, |
|
|
|
]} |
|
|
|
> |
|
|
|
<InputNumber min={1} max={100} /> |
|
|
|
</Form.Item> |
|
|
|
|
|
|
|