Browse Source

update:department rules

dev
powersir 11 months ago
parent
commit
dbfdd939b9
1 changed files with 17 additions and 3 deletions
  1. +17
    -3
      src/pages/system/dept/create-department.tsx

+ 17
- 3
src/pages/system/dept/create-department.tsx View File

@@ -42,6 +42,7 @@ const DepartmentEditor: 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;
@@ -65,7 +66,7 @@ const DepartmentEditor: React.FC<EditorProps> = (props) => {
width={640} width={640}
onOk={save} onOk={save}
onCancel={() => onCancel()} onCancel={() => onCancel()}
confirmLoading= {saveLoading}
confirmLoading={saveLoading}
destroyOnClose destroyOnClose
> >
<Form <Form
@@ -107,11 +108,24 @@ const DepartmentEditor: 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>


<Form.Item name="status" label="状态">
<Form.Item name="status" label="状态"
rules={[
{
required: true,
message: '请设置状态',
},
]}>
<Radio.Group options={[ <Radio.Group options={[
{ value: 0, label: "开启" }, { value: 0, label: "开启" },
{ value: 1, label: "关闭" } { value: 1, label: "关闭" }


Loading…
Cancel
Save