瀏覽代碼

update:position rules

dev
powersir 11 月之前
父節點
當前提交
59305f6d91
共有 1 個檔案被更改,包括 11 行新增1 行删除
  1. +11
    -1
      src/pages/system/post/create-position.tsx

+ 11
- 1
src/pages/system/post/create-position.tsx 查看文件

@@ -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>



Loading…
取消
儲存