Refactor(Form): Optimize form input experience

Add placeholder. Optimize form validation. Hide ID input.
This commit is contained in:
2024-04-22 18:09:42 +08:00
parent 81b170d944
commit 5d28f7d8d7
22 changed files with 213 additions and 130 deletions

View File

@@ -121,8 +121,9 @@ const Category = () => {
return () => {
modal
.confirm({
title: '确定删除',
centered: true,
maskClosable: true,
title: '确定删除',
content: `确定删除类别 ${value.name} 吗?`
})
.then(
@@ -266,7 +267,7 @@ const Category = () => {
const addAndEditForm = (
<AntdForm form={form} disabled={isSubmitting} layout={'vertical'}>
<AntdForm.Item hidden={!isDrawerEdit} name={'id'} label={'ID'}>
<AntdForm.Item hidden name={'id'} label={'ID'}>
<AntdInput disabled />
</AntdForm.Item>
<AntdForm.Item
@@ -274,7 +275,7 @@ const Category = () => {
label={'名称'}
rules={[{ required: true, whitespace: true }]}
>
<AntdInput allowClear />
<AntdInput allowClear placeholder={'请输入名称'} />
</AntdForm.Item>
<AntdForm.Item name={'enable'} label={'状态'}>
<AntdSwitch checkedChildren={'启用'} unCheckedChildren={'禁用'} />