1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
59
60
61
62
63
64
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
| import { isAccountExist } from '/@/api/tigerapi/account';
| import { BasicColumn } from '/@/components/Table';
| import { FormSchema } from '/@/components/Table';
| import { useMessage } from '/@/hooks/web/useMessage';
|
| export const columns: BasicColumn[] = [
| {
| title: '用户ID',
| dataIndex: 'USER_ID',
| width: 200,
| },
| {
| title: '用户名',
| dataIndex: 'USER_NAME',
| width: 120,
| },
| {
| title: '邮箱',
| dataIndex: 'EMAIL',
| width: 120,
| },
| {
| title: '创建时间',
| dataIndex: 'CREATE_TIME',
| width: 180,
| },
| ];
|
| export const searchFormSchema: FormSchema[] = [
| {
| field: 'USER_ID',
| label: '用户ID',
| component: 'Input',
| colProps: { span: 8 },
| },
| {
| field: 'USER_NAME',
| label: '用户名',
| component: 'Input',
| colProps: { span: 8 },
| },
| ];
|
| export const accountFormSchema: FormSchema[] = [
| {
| field: 'USER_ID',
| label: '用户ID',
| component: 'Input',
| helpMessage: ['用户异步验证', '不能输入带有admin的用户名'],
| //rules: [
| dynamicRules: (data) => [
| {
| required: true,
| message: '请输入用户名',
| },
| {
| validator(_, value) {
| return new Promise((resolve, reject) => {
| //console.log(data, 11);
| if (!data.model.isUpdate) {
| isAccountExist(value)
| .then((action) => {
| if (!action.Data) {
| resolve();
| } else {
| reject(action.Message || '验证失败');
| }
| })
| .catch((err) => {
| reject(err.message || '验证失败');
| });
| } else {
| resolve();
| }
| });
| },
| },
| ],
| },
| {
| field: 'USER_PWD',
| label: '密码',
| component: 'InputPassword',
| required: true,
| show: false,
| defaultValue: '000000',
| },
| {
| label: '用户名',
| field: 'USER_NAME',
| component: 'Input',
| required: true,
| },
|
| // {
| // field: 'ORG_CODE',
| // label: '所属部门',
| // component: 'TreeSelect',
| // componentProps: {
| // fieldNames: {
| // label: 'deptName',
| // key: 'deptCode',
| // value: 'deptCode',
| // },
| // getPopupContainer: () => document.body,
| // },
| // required: true,
| // },
| {
| label: '邮箱',
| field: 'EMAIL',
| component: 'Input',
| required: false,
| },
| {
| label: '是否启用',
| field: 'STATUS_CODE',
| component: 'Switch',
| colProps: { span: 24 },
| // defaultValue: true,
| componentProps: ({ schema, tableAction, formActionType, formModel }) => {
| return {
| checkedChildren: '已启用',
| unCheckedChildren: '已禁用',
| // checked: true,//formModel.STATUS_CODE === 'ENABLE',
| // onChange: (e) => {
| // console.log('e',e)
| // // formModel.STATUS_CODE = e == true ? 'ENABLE' : 'DISABLEDS';
| // },
| };
| },
| },
| {
| label: 'isUpdate',
| field: 'isUpdate',
| component: 'Input',
| show: false,
| },
| {
| label: '用户ID',
| field: 'ID',
| component: 'Input',
| show: false,
| },
| ];
|
|