| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- import { BasicColumn } from '/@/components/Table';
- import { FormSchema } from '/@/components/Table';
- import { getAllRolesList, getAllTenantList } from './user.api';
- import { rules } from '/@/utils/helper/validator';
- import { render } from '/@/utils/common/renderUtils';
- export const columns: BasicColumn[] = [
- {
- title: '用户账号',
- dataIndex: 'username',
- width: 80,
- },
- {
- title: '用户姓名',
- dataIndex: 'realname',
- width: 80,
- },
- {
- title: '令牌',
- dataIndex: 'thirdId',
- width: 150,
- },
- {
- title: '有效期',
- dataIndex: 'birthday',
- width: 80,
- },
- {
- title: '状态',
- dataIndex: 'status_dictText',
- width: 80,
- },
- ];
- export const recycleColumns: BasicColumn[] = [
- {
- title: '用户账号',
- dataIndex: 'username',
- width: 100,
- },
- {
- title: '用户姓名',
- dataIndex: 'realname',
- width: 100,
- },
- {
- title: '头像',
- dataIndex: 'avatar',
- width: 80,
- customRender: render.renderAvatar,
- },
- {
- title: '性别',
- dataIndex: 'sex',
- width: 80,
- sorter: true,
- customRender: ({ text }) => {
- return render.renderDict(text, 'sex');
- },
- },
- ];
- export const searchFormSchema: FormSchema[] = [
- {
- label: '账号',
- field: 'username',
- component: 'JInput',
- colProps: { span: 6 },
- },
- {
- label: '名字',
- field: 'realname',
- component: 'JInput',
- colProps: { span: 6 },
- },
- // {
- // label: '性别',
- // field: 'sex',
- // component: 'JDictSelectTag',
- // componentProps: {
- // dictCode: 'sex',
- // placeholder: '请选择性别',
- // stringToNumber: true,
- // },
- // colProps: { span: 6 },
- // },
- // {
- // label: '手机号码',
- // field: 'phone',
- // component: 'Input',
- // colProps: { span: 6 },
- // },
- // {
- // label: '用户状态',
- // field: 'status',
- // component: 'JDictSelectTag',
- // componentProps: {
- // dictCode: 'user_status',
- // placeholder: '请选择状态',
- // stringToNumber: true,
- // },
- // colProps: { span: 6 },
- // },
- ];
- export const formSchema: FormSchema[] = [
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false,
- },
- {
- label: '用户账号',
- field: 'username',
- component: 'Input',
- dynamicDisabled: ({ values }) => {
- return !!values.id;
- },
- dynamicRules: ({ model, schema }) => rules.duplicateCheckRule('sys_user', 'username', model, schema, true),
- },
- {
- label: '登录密码',
- field: 'password',
- component: 'StrengthMeter',
- rules: [
- {
- required: true,
- message: '请输入登录密码',
- },
- ],
- },
- {
- label: '确认密码',
- field: 'confirmPassword',
- component: 'InputPassword',
- dynamicRules: ({ values }) => rules.confirmPassword(values, true),
- },
- {
- label: '用户姓名',
- field: 'realname',
- required: true,
- component: 'Input',
- },
- {
- label: '有效期',
- field: 'birthday',
- component: 'DatePicker',
- },
- {
- label: '第三方用户',
- field: 'thirdType',
- component: 'Input',
- defaultValue: '_thirdPartyUser',
- },
- ];
- export const formPasswordSchema: FormSchema[] = [
- {
- label: '用户账号',
- field: 'username',
- component: 'Input',
- componentProps: { readOnly: true },
- },
- {
- label: '登录密码',
- field: 'password',
- component: 'StrengthMeter',
- componentProps: {
- placeholder: '请输入登录密码',
- },
- rules: [
- {
- required: true,
- message: '请输入登录密码',
- },
- ],
- },
- {
- label: '确认密码',
- field: 'confirmPassword',
- component: 'InputPassword',
- dynamicRules: ({ values }) => rules.confirmPassword(values, true),
- },
- ];
- export const formAgentSchema: FormSchema[] = [
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false,
- },
- {
- field: 'userName',
- label: '用户名',
- component: 'Input',
- componentProps: {
- readOnly: true,
- allowClear: false,
- },
- },
- {
- field: 'agentUserName',
- label: '代理人用户名',
- required: true,
- component: 'JSelectUser',
- componentProps: {
- rowKey: 'username',
- labelKey: 'realname',
- maxSelectCount: 10,
- },
- },
- {
- field: 'startTime',
- label: '代理开始时间',
- component: 'DatePicker',
- required: true,
- componentProps: {
- showTime: true,
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
- placeholder: '请选择代理开始时间',
- },
- },
- {
- field: 'endTime',
- label: '代理结束时间',
- component: 'DatePicker',
- required: true,
- componentProps: {
- showTime: true,
- valueFormat: 'YYYY-MM-DD HH:mm:ss',
- placeholder: '请选择代理结束时间',
- },
- },
- {
- field: 'status',
- label: '状态',
- component: 'JDictSelectTag',
- defaultValue: '1',
- componentProps: {
- dictCode: 'valid_status',
- type: 'radioButton',
- },
- },
- ];
|