diff --git a/src/app/pages/account/sys-role/sys-role.component.html b/src/app/pages/account/sys-role/sys-role.component.html index 52c37e2..71dab55 100644 --- a/src/app/pages/account/sys-role/sys-role.component.html +++ b/src/app/pages/account/sys-role/sys-role.component.html @@ -10,8 +10,9 @@
- - + + +
@@ -19,25 +20,34 @@ - 角色名称 - 角色描述 - 创建时间 - 修改时间 - 操作 + 角色名称 + 角色描述 + 创建时间 + 修改时间 + 操作 {{data.roleName}} - {{data.roleStatus}} + {{data.roleDesc}} {{data.createTime | date: 'yyyy-MM-dd HH:mm'}} {{data.updateTime | date: 'yyyy-MM-dd HH:mm'}} + 修改 + + 分配菜单 + + 删除 diff --git a/src/app/pages/account/sys-role/sys-role.component.ts b/src/app/pages/account/sys-role/sys-role.component.ts index abb6644..8453070 100644 --- a/src/app/pages/account/sys-role/sys-role.component.ts +++ b/src/app/pages/account/sys-role/sys-role.component.ts @@ -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(); }