account.data.ts 1.9 KB
Newer Older
V
Vben 已提交
1
import { getAllRoleList } from '/@/api/demo/system';
V
Vben 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '用户名',
    dataIndex: 'account',
    width: 120,
  },
  {
    title: '昵称',
    dataIndex: 'nickname',
    width: 120,
  },
  {
    title: '邮箱',
    dataIndex: 'email',
    width: 200,
  },
  {
V
Vben 已提交
22 23
    title: '创建时间',
    dataIndex: 'createTime',
V
Vben 已提交
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
    width: 180,
  },
  {
    title: '角色',
    dataIndex: 'role',
    width: 200,
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'account',
    label: '用户名',
    component: 'Input',
    colProps: { span: 8 },
  },
  {
    field: 'nickname',
    label: '昵称',
    component: 'Input',
    colProps: { span: 8 },
  },
];

export const accountFormSchema: FormSchema[] = [
  {
    field: 'account',
    label: '用户名',
    component: 'Input',
    required: true,
  },
V
Vben 已提交
59 60 61 62 63
  {
    field: 'pwd',
    label: '密码',
    component: 'InputPassword',
    required: true,
64
    show: false,
V
Vben 已提交
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
  },
  {
    label: '角色',
    field: 'role',
    component: 'ApiSelect',
    componentProps: {
      api: getAllRoleList,
      labelField: 'roleName',
      valueField: 'roleValue',
    },
    required: true,
  },
  {
    field: 'dept',
    label: '所属部门',
    component: 'TreeSelect',
    componentProps: {
      replaceFields: {
        title: 'deptName',
        key: 'id',
        value: 'id',
      },
      getPopupContainer: () => document.body,
    },
    required: true,
  },
V
Vben 已提交
91 92 93 94 95 96
  {
    field: 'nickname',
    label: '昵称',
    component: 'Input',
    required: true,
  },
V
Vben 已提交
97

V
Vben 已提交
98 99 100 101 102 103
  {
    label: '邮箱',
    field: 'email',
    component: 'Input',
    required: true,
  },
V
Vben 已提交
104

V
Vben 已提交
105 106 107 108 109 110
  {
    label: '备注',
    field: 'remark',
    component: 'InputTextArea',
  },
];