File tree 4 files changed +27
-11
lines changed
src/app/pages/system/user
4 files changed +27
-11
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,10 @@ export class UserDeleteBtnComponent implements OnInit {
21
21
try {
22
22
await this . userService . removeUser ( this . id ) ;
23
23
this . refresh . emit ( ) ;
24
- } finally {
25
- this . loading = false ;
24
+ } catch ( e ) {
25
+ // ignore
26
26
}
27
+ this . loading = false ;
27
28
}
28
29
29
30
cancel ( ) { }
Original file line number Diff line number Diff line change @@ -64,8 +64,9 @@ export class UserUpdateBtnComponent implements OnInit {
64
64
}
65
65
this . closeDrawer ( ) ;
66
66
this . refresh . emit ( ) ;
67
- } finally {
68
- this . submitting = false ;
67
+ } catch ( e ) {
68
+ // ignore
69
69
}
70
+ this . submitting = false ;
70
71
}
71
72
}
Original file line number Diff line number Diff line change 7
7
< nz-card >
8
8
< form nz-form [nzLayout] ="'inline' ">
9
9
< nz-form-item >
10
- < nz-form-label > 姓名 </ nz-form-label >
10
+ < nz-form-label > 登录账号 </ nz-form-label >
11
11
< nz-form-control >
12
12
< nz-input-group >
13
13
< input
14
14
[(ngModel)] ="tableQuery.username "
15
15
name ="username "
16
16
nz-input
17
- placeholder ="请输入关键字 "
17
+ placeholder ="请输入登录账号 "
18
+ />
19
+ </ nz-input-group >
20
+ </ nz-form-control >
21
+ </ nz-form-item >
22
+ < nz-form-item >
23
+ < nz-form-label > 真实姓名</ nz-form-label >
24
+ < nz-form-control >
25
+ < nz-input-group >
26
+ < input
27
+ [(ngModel)] ="tableQuery.realname "
28
+ name ="realname "
29
+ nz-input
30
+ placeholder ="请输入真实姓名 "
18
31
/>
19
32
</ nz-input-group >
20
33
</ nz-form-control >
Original file line number Diff line number Diff line change @@ -5,14 +5,15 @@ import { UserRecord } from '../user.interface';
5
5
import { UserService } from '../user.service' ;
6
6
7
7
@Component ( {
8
- selector : 'app -list' ,
8
+ selector : 'user -list' ,
9
9
templateUrl : './list.component.html' ,
10
10
styleUrls : [ './list.component.less' ] ,
11
11
} )
12
12
export class ListComponent implements OnInit {
13
13
loading : boolean = false ;
14
14
tableQuery = {
15
15
username : '' ,
16
+ realname : '' ,
16
17
} ;
17
18
tableData : IPageRes < UserRecord > = {
18
19
pageIndex : 1 ,
@@ -23,18 +24,17 @@ export class ListComponent implements OnInit {
23
24
24
25
constructor ( private userService : UserService ) { }
25
26
26
- async ngOnInit ( ) {
27
- await this . reset ( ) ;
28
- }
27
+ ngOnInit ( ) { }
29
28
30
29
async search ( ) {
31
30
this . loading = true ;
32
31
const { pageIndex, pageSize } = this . tableData ;
33
- const { username } = this . tableQuery ;
32
+ const { username, realname } = this . tableQuery ;
34
33
const { total, items } = await this . userService . fetchPageList ( {
35
34
pageIndex,
36
35
pageSize,
37
36
username,
37
+ realname,
38
38
} ) ;
39
39
this . tableData . total = total ;
40
40
this . tableData . items = items ;
@@ -46,6 +46,7 @@ export class ListComponent implements OnInit {
46
46
this . tableData . pageSize = 10 ;
47
47
this . tableQuery = {
48
48
username : '' ,
49
+ realname : '' ,
49
50
} ;
50
51
await this . search ( ) ;
51
52
}
You can’t perform that action at this time.
0 commit comments