From 45b0b55adf0e6bdc6e8f995a5abdb0ecc5953b48 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Thu, 18 Apr 2024 17:06:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/sys-role/sys-role.component.html | 26 +++++++++++++------ .../account/sys-role/sys-role.component.ts | 25 +++++++++++++----- 2 files changed, 36 insertions(+), 15 deletions(-) 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(); }