Skip to content

Commit 80f3272

Browse files
authored
chore: update fields for user create and edit (#78)
1 parent d8dd884 commit 80f3272

File tree

1 file changed

+57
-29
lines changed
  • apps/web-antd/src/views/system/user

1 file changed

+57
-29
lines changed

apps/web-antd/src/views/system/user/data.ts

Lines changed: 57 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ export function useColumns(
5050
field: 'seq',
5151
title: $t('common.table.id'),
5252
type: 'seq',
53+
fixed: 'left',
5354
width: 50,
5455
},
55-
{ field: 'username', title: '用户名', width: 100 },
56+
{ field: 'username', title: '用户名', fixed: 'left', width: 100 },
5657
{ field: 'nickname', title: '昵称', width: 100 },
5758
{
5859
field: 'avatar',
@@ -73,7 +74,6 @@ export function useColumns(
7374
showOverflow: 'ellipsis',
7475
slots: { default: 'roles' },
7576
},
76-
{ field: 'email', title: '邮箱', width: 150 },
7777
{
7878
field: 'phone',
7979
title: '手机号',
@@ -82,6 +82,14 @@ export function useColumns(
8282
return cellValue || '暂无';
8383
},
8484
},
85+
{
86+
field: 'email',
87+
title: '邮箱',
88+
width: 150,
89+
formatter({ cellValue }) {
90+
return cellValue || '暂无';
91+
},
92+
},
8593
{
8694
field: 'status',
8795
title: '状态',
@@ -184,19 +192,6 @@ export function useColumns(
184192

185193
export function useEditSchema(roleSelectOptions: any): VbenFormSchema[] {
186194
return [
187-
{
188-
component: 'ApiTreeSelect',
189-
componentProps: {
190-
allowClear: true,
191-
api: getSysDeptTreeApi,
192-
class: 'w-full',
193-
labelField: 'name',
194-
valueField: 'id',
195-
childrenField: 'children',
196-
},
197-
fieldName: 'dept_id',
198-
label: '部门',
199-
},
200195
{
201196
component: 'Input',
202197
fieldName: 'username',
@@ -214,6 +209,29 @@ export function useEditSchema(roleSelectOptions: any): VbenFormSchema[] {
214209
fieldName: 'avatar',
215210
label: '头像地址',
216211
},
212+
{
213+
component: 'Input',
214+
fieldName: 'phone',
215+
label: '手机号码',
216+
},
217+
{
218+
component: 'Input',
219+
fieldName: 'email',
220+
label: '邮箱',
221+
},
222+
{
223+
component: 'ApiTreeSelect',
224+
componentProps: {
225+
allowClear: true,
226+
api: getSysDeptTreeApi,
227+
class: 'w-full',
228+
labelField: 'name',
229+
valueField: 'id',
230+
childrenField: 'children',
231+
},
232+
fieldName: 'dept_id',
233+
label: '所属部门',
234+
},
217235
{
218236
component: 'Select',
219237
componentProps: {
@@ -236,20 +254,6 @@ export function useEditSchema(roleSelectOptions: any): VbenFormSchema[] {
236254

237255
export function useAddSchema(roleSelectOptions: any): VbenFormSchema[] {
238256
return [
239-
{
240-
component: 'ApiTreeSelect',
241-
componentProps: {
242-
allowClear: true,
243-
api: getSysDeptTreeApi,
244-
class: 'w-full',
245-
labelField: 'name',
246-
valueField: 'id',
247-
childrenField: 'children',
248-
},
249-
fieldName: 'dept_id',
250-
label: '部门',
251-
rules: 'required',
252-
},
253257
{
254258
component: 'Input',
255259
fieldName: 'username',
@@ -267,6 +271,30 @@ export function useAddSchema(roleSelectOptions: any): VbenFormSchema[] {
267271
label: '密码',
268272
rules: 'required',
269273
},
274+
{
275+
component: 'Input',
276+
fieldName: 'phone',
277+
label: '手机号码',
278+
},
279+
{
280+
component: 'Input',
281+
fieldName: 'email',
282+
label: '邮箱',
283+
},
284+
{
285+
component: 'ApiTreeSelect',
286+
componentProps: {
287+
allowClear: true,
288+
api: getSysDeptTreeApi,
289+
class: 'w-full',
290+
labelField: 'name',
291+
valueField: 'id',
292+
childrenField: 'children',
293+
},
294+
fieldName: 'dept_id',
295+
label: '所属部门',
296+
rules: 'required',
297+
},
270298
{
271299
component: 'Select',
272300
componentProps: {

0 commit comments

Comments
 (0)