Browse Source

update:position rules

dev
powersir 11 months ago
parent
commit
59305f6d91
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      src/pages/system/post/create-position.tsx

+ 11
- 1
src/pages/system/post/create-position.tsx View File

@@ -35,6 +35,8 @@ const PositionEditor: React.FC<EditorProps> = (props) => {
if (visible) { if (visible) {
if (data) { if (data) {
form.setFieldsValue(data); form.setFieldsValue(data);
} else {
form.setFieldValue("status", 0);
} }
} else { } else {
form.resetFields(); form.resetFields();
@@ -42,6 +44,7 @@ const PositionEditor: React.FC<EditorProps> = (props) => {
}, [visible]); }, [visible]);


const save = async () => { const save = async () => {
await form.validateFields();
setSaveLoading(true); setSaveLoading(true);
const fieldValues = form.getFieldsValue(); const fieldValues = form.getFieldsValue();
const newValue = isEdit ? { ...data, ...fieldValues } : fieldValues; const newValue = isEdit ? { ...data, ...fieldValues } : fieldValues;
@@ -97,7 +100,14 @@ const PositionEditor: React.FC<EditorProps> = (props) => {
<Input /> <Input />
</Form.Item> </Form.Item>


<Form.Item name="sort" label="岗位顺序" >
<Form.Item name="sort" label="岗位顺序"
rules={[
{
required: true,
message: '请输入岗位顺序',
},
]}
>
<InputNumber min={1} max={100} /> <InputNumber min={1} max={100} />
</Form.Item> </Form.Item>




Loading…
Cancel
Save