|
|
@ -1,5 +1,5 @@ |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import {NzTableComponent, NzTbodyComponent, NzTheadComponent} from "ng-zorro-antd/table"; |
|
|
|
import {NzTableComponent, NzTbodyComponent, NzTheadComponent, NzThMeasureDirective} from "ng-zorro-antd/table"; |
|
|
|
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
|
|
|
import {NzDividerComponent} from "ng-zorro-antd/divider"; |
|
|
|
import {NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; |
|
|
|
import {NzFormDirective, NzFormModule} from "ng-zorro-antd/form"; |
|
|
|
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
|
|
|
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
|
|
@ -14,6 +14,8 @@ import {NzInputDirective} from "ng-zorro-antd/input"; |
|
|
|
import {NzFlexDirective} from "ng-zorro-antd/flex"; |
|
|
|
import {NzFlexDirective} from "ng-zorro-antd/flex"; |
|
|
|
import {DatePipe, NgForOf} from "@angular/common"; |
|
|
|
import {DatePipe, NgForOf} from "@angular/common"; |
|
|
|
import {RoleService} from "../../../servies/role/role.service"; |
|
|
|
import {RoleService} from "../../../servies/role/role.service"; |
|
|
|
|
|
|
|
import {NzModalService} from "ng-zorro-antd/modal"; |
|
|
|
|
|
|
|
import {NzMessageService} from "ng-zorro-antd/message"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-sys-role', |
|
|
|
selector: 'app-sys-role', |
|
|
@ -34,6 +36,7 @@ import {RoleService} from "../../../servies/role/role.service"; |
|
|
|
NzFlexDirective, |
|
|
|
NzFlexDirective, |
|
|
|
NgForOf, |
|
|
|
NgForOf, |
|
|
|
DatePipe, |
|
|
|
DatePipe, |
|
|
|
|
|
|
|
NzThMeasureDirective, |
|
|
|
], |
|
|
|
], |
|
|
|
templateUrl: './sys-role.component.html', |
|
|
|
templateUrl: './sys-role.component.html', |
|
|
|
styleUrl: './sys-role.component.less' |
|
|
|
styleUrl: './sys-role.component.less' |
|
|
@ -48,20 +51,21 @@ export class SysRoleComponent { |
|
|
|
searchForm: FormGroup; |
|
|
|
searchForm: FormGroup; |
|
|
|
|
|
|
|
|
|
|
|
constructor(private fb: NonNullableFormBuilder, |
|
|
|
constructor(private fb: NonNullableFormBuilder, |
|
|
|
private roleService: RoleService) { |
|
|
|
private roleService: RoleService, |
|
|
|
|
|
|
|
private message: NzMessageService) { |
|
|
|
// 初始化搜索框
|
|
|
|
// 初始化搜索框
|
|
|
|
this.searchForm = this.fb.group({ |
|
|
|
this.searchForm = this.fb.group({ |
|
|
|
roleName: [''], |
|
|
|
roleName: [''], |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.queryData(); |
|
|
|
this.queryData(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取数据 |
|
|
|
* 获取数据 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
queryData() { |
|
|
|
queryData(pageNum: number) { |
|
|
|
this.searchForm.value.pageNum = 1; |
|
|
|
this.searchForm.value.pageNum = pageNum; |
|
|
|
this.searchForm.value.pageSize = 10; |
|
|
|
this.searchForm.value.pageSize = 10; |
|
|
|
this.roleService.queryList(this.searchForm.value, (data: any) => { |
|
|
|
this.roleService.queryList(this.searchForm.value, (data: any) => { |
|
|
|
console.log(data); |
|
|
|
console.log(data); |
|
|
@ -74,9 +78,16 @@ export class SysRoleComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 搜索框重置 |
|
|
|
* 搜索表单提交 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
resetForm(): void { |
|
|
|
searchFormSubmit(): void { |
|
|
|
|
|
|
|
this.queryData(1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 搜索表单重置 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
searchFormReset(): void { |
|
|
|
this.searchForm.reset(); |
|
|
|
this.searchForm.reset(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|