@@ -1,4 +1,4 @@ | |||||
import React, { useEffect, useState } from 'react' | |||||
import React, { useEffect, useState } from 'react' | |||||
import { Form, Input, InputNumber, Radio, Modal, Switch } from 'antd'; | import { Form, Input, InputNumber, Radio, Modal, Switch } from 'antd'; | ||||
import positonService from '@/request/service/positon'; | import positonService from '@/request/service/positon'; | ||||
import { useRequest } from '@/hooks/use-request'; | import { useRequest } from '@/hooks/use-request'; | ||||
@@ -68,7 +68,7 @@ const PositionEditor: React.FC<EditorProps> = (props) => { | |||||
width={640} | width={640} | ||||
onOk={save} | onOk={save} | ||||
onCancel={() => onCancel()} | onCancel={() => onCancel()} | ||||
confirmLoading= {saveLoading} | |||||
confirmLoading={saveLoading} | |||||
destroyOnClose | destroyOnClose | ||||
> | > | ||||
<Form | <Form | ||||
@@ -100,7 +100,7 @@ const PositionEditor: React.FC<EditorProps> = (props) => { | |||||
<Input /> | <Input /> | ||||
</Form.Item> | </Form.Item> | ||||
<Form.Item name="sort" label="岗位顺序" | |||||
<Form.Item name="sort" label="岗位顺序" | |||||
rules={[ | rules={[ | ||||
{ | { | ||||
required: true, | required: true, | ||||
@@ -115,7 +115,13 @@ const PositionEditor: React.FC<EditorProps> = (props) => { | |||||
<Input.TextArea showCount maxLength={100} /> | <Input.TextArea showCount maxLength={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: "关闭" } | ||||
@@ -86,6 +86,12 @@ const MenuListPage: React.FC = () => { | |||||
dataIndex: 'sort', | dataIndex: 'sort', | ||||
align: 'center', | align: 'center', | ||||
}, | }, | ||||
{ | |||||
title: '备注', | |||||
key: 'remark', | |||||
dataIndex: 'remark', | |||||
align: 'center', | |||||
}, | |||||
{ | { | ||||
title: '状态', | title: '状态', | ||||
key: 'status', | key: 'status', | ||||
@@ -100,6 +100,12 @@ export default () => { | |||||
dataIndex: 'sort', | dataIndex: 'sort', | ||||
align: 'center', | align: 'center', | ||||
}, | }, | ||||
{ | |||||
title: '备注', | |||||
key: 'remark', | |||||
dataIndex: 'remark', | |||||
align: 'center', | |||||
}, | |||||
{ | { | ||||
title: '状态', | title: '状态', | ||||
key: 'status', | key: 'status', | ||||
@@ -160,7 +166,7 @@ export default () => { | |||||
return ( | return ( | ||||
<> | <> | ||||
<div> | |||||
<div style={{ width: 1600 }}> | |||||
<Card className='mt-[4px] dark:bg-[rgb(33,41,70)] bg-white roundle-lg px[12px]' bodyStyle={{ paddingTop: 4, paddingBottom: 4 }}> | <Card className='mt-[4px] dark:bg-[rgb(33,41,70)] bg-white roundle-lg px[12px]' bodyStyle={{ paddingTop: 4, paddingBottom: 4 }}> | ||||
<div className='flex justify-between content-center'> | <div className='flex justify-between content-center'> | ||||
<div className='flex justify-normal items-center'> | <div className='flex justify-normal items-center'> | ||||
@@ -59,6 +59,8 @@ const UserEditor: React.FC<EditorProps> = (props) => { | |||||
if (visible) { | if (visible) { | ||||
if (data) { | if (data) { | ||||
form.setFieldsValue(data); | form.setFieldsValue(data); | ||||
} else { | |||||
form.setFieldValue("status", 0); | |||||
} | } | ||||
setUpdateEditPassword(true) | setUpdateEditPassword(true) | ||||
} else { | } else { | ||||
@@ -91,12 +93,12 @@ const UserEditor: React.FC<EditorProps> = (props) => { | |||||
<> | <> | ||||
<Modal | <Modal | ||||
open={visible} | open={visible} | ||||
title= {<div className='h-50px'>{isEdit? "编辑用户": "添加用户"}</div>} | |||||
title={<div className='h-50px'>{isEdit ? "编辑用户" : "添加用户"}</div>} | |||||
width={640} | width={640} | ||||
onOk={save} | onOk={save} | ||||
onCancel={() => onCancel()} | onCancel={() => onCancel()} | ||||
destroyOnClose | destroyOnClose | ||||
confirmLoading= {saveLoading} | |||||
confirmLoading={saveLoading} | |||||
> | > | ||||
<Form | <Form | ||||
form={form} | form={form} | ||||
@@ -120,7 +122,7 @@ const UserEditor: React.FC<EditorProps> = (props) => { | |||||
<Form.Item noStyle | <Form.Item noStyle | ||||
shouldUpdate={() => { | shouldUpdate={() => { | ||||
const shouldUpdate = shouldUpdateEditPassword; | const shouldUpdate = shouldUpdateEditPassword; | ||||
if(shouldUpdateEditPassword) { | |||||
if (shouldUpdateEditPassword) { | |||||
setUpdateEditPassword(false) | setUpdateEditPassword(false) | ||||
} | } | ||||
return shouldUpdate | return shouldUpdate | ||||
@@ -195,7 +197,13 @@ const UserEditor: React.FC<EditorProps> = (props) => { | |||||
<Input /> | <Input /> | ||||
</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: "关闭" } | ||||