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