You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
1.8 KiB
101 lines
1.8 KiB
2 months ago
|
import type { FormSchema } from '@/components/core/schema-form/';
|
||
|
import { sexTypeList } from './data';
|
||
|
|
||
|
export const userSchemas: FormSchema<API.CreateUserParams>[] = [
|
||
|
// {
|
||
|
// field: 'username',
|
||
|
// component: 'Input',
|
||
|
// label: '用户名',
|
||
|
// colProps: {
|
||
|
// span: 12,
|
||
|
// },
|
||
|
// rules: [{ required: true }],
|
||
|
// },
|
||
|
{
|
||
|
field: 'realName',
|
||
|
component: 'Input',
|
||
|
label: '姓名',
|
||
|
colProps: {
|
||
|
span: 12,
|
||
|
},
|
||
|
rules: [{ required: true }],
|
||
|
},
|
||
|
{
|
||
|
field: 'mobile',
|
||
|
component: 'Input',
|
||
|
label: '手机号码',
|
||
|
colProps: {
|
||
|
span: 12,
|
||
|
},
|
||
|
rules: [
|
||
|
{
|
||
|
required: true,
|
||
|
message: '请输入正确格式的电话号码',
|
||
|
pattern: /^1(3[0-9]|4[01456879]|5[0-3,5-9]|6[2567]|7[0-8]|8[0-9]|9[0-3,5-9])\d{8}$/,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
// {
|
||
|
// field: 'idCard',
|
||
|
// component: 'Input',
|
||
|
// label: '身份证',
|
||
|
// colProps: {
|
||
|
// span: 12,
|
||
|
// },
|
||
|
// },
|
||
|
|
||
|
{
|
||
|
field: 'sex',
|
||
|
component: 'Select',
|
||
|
label: '性别',
|
||
|
colProps: {
|
||
|
span: 12,
|
||
|
},
|
||
|
componentProps: {
|
||
|
mode: 'single',
|
||
|
request: async () => {
|
||
|
// const data = await getSexList();
|
||
|
return sexTypeList;
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
field: 'avatar',
|
||
|
component: 'Input',
|
||
|
colProps: {
|
||
|
span: 12,
|
||
|
},
|
||
|
label: '头像',
|
||
|
},
|
||
|
{
|
||
|
field: 'state',
|
||
|
component: 'RadioGroup',
|
||
|
label: '帐号状态',
|
||
|
defaultValue: true,
|
||
|
colProps: {
|
||
|
span: 12,
|
||
|
},
|
||
|
componentProps: {
|
||
|
options: [
|
||
|
{
|
||
|
label: '启用',
|
||
|
value: 1,
|
||
|
},
|
||
|
{
|
||
|
label: '禁用',
|
||
|
value: 0,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
// required:true,
|
||
|
rules: [{ required: true, type: 'number' }],
|
||
|
|
||
|
},
|
||
|
|
||
|
{
|
||
|
field: 'remark',
|
||
|
component: 'InputTextArea',
|
||
|
label: '备注',
|
||
|
},
|
||
|
];
|