|
|
|
/*
|
|
|
|
* @Author: AaronWu 2463371514@qq.com
|
|
|
|
* @Date: 2025-04-01 09:08:06
|
|
|
|
* @LastEditors: AaronWu 2463371514@qq.com
|
|
|
|
* @LastEditTime: 2025-04-01 16:48:50
|
|
|
|
* @FilePath: /IssueSupportManage/src/views/system/user/formSchemas.ts
|
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
|
*/
|
|
|
|
import type { FormSchema } from '@/components/core/schema-form/';
|
|
|
|
import { sexTypeList } from './data';
|
|
|
|
|
|
|
|
export const userSchemas: FormSchema<API.CreateUserParams>[] = [
|
|
|
|
{
|
|
|
|
field: 'account',
|
|
|
|
component: 'Input',
|
|
|
|
label: '账号',
|
|
|
|
colProps: {
|
|
|
|
span: 12,
|
|
|
|
},
|
|
|
|
rules: [{ required: true }],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'username',
|
|
|
|
component: 'Input',
|
|
|
|
label: '用户名',
|
|
|
|
colProps: {
|
|
|
|
span: 12,
|
|
|
|
},
|
|
|
|
rules: [{ required: true }],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'password',
|
|
|
|
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: 'sex',
|
|
|
|
component: 'Select',
|
|
|
|
label: '性别',
|
|
|
|
colProps: {
|
|
|
|
span: 12,
|
|
|
|
},
|
|
|
|
componentProps: {
|
|
|
|
mode: 'single',
|
|
|
|
request: async () => {
|
|
|
|
// const data = await getSexList();
|
|
|
|
return sexTypeList;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
field: 'state',
|
|
|
|
component: 'RadioGroup',
|
|
|
|
label: '帐号状态',
|
|
|
|
defaultValue: 1,
|
|
|
|
colProps: {
|
|
|
|
span: 12,
|
|
|
|
},
|
|
|
|
componentProps: {
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '启用',
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '禁用',
|
|
|
|
value: 0,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// required:true,
|
|
|
|
rules: [{ required: true, type: 'number' }],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'isAdmin',
|
|
|
|
component: 'RadioGroup',
|
|
|
|
label: '是否管理员',
|
|
|
|
defaultValue: 0,
|
|
|
|
colProps: {
|
|
|
|
span: 12,
|
|
|
|
},
|
|
|
|
componentProps: {
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
label: '是',
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '否',
|
|
|
|
value: 0,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// required:true,
|
|
|
|
rules: [{ required: true, type: 'number' }],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'remark',
|
|
|
|
component: 'InputTextArea',
|
|
|
|
label: '备注',
|
|
|
|
},
|
|
|
|
];
|