From 5aa3324715ac6a2a5dc20ea0195c5008434ec8f1 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Mon, 22 Apr 2024 11:29:16 +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 | 4 +--- .../account/sys-role/sys-role.component.less | 24 ------------------- .../account/sys-role/sys-role.component.ts | 19 ++++++++++----- 3 files changed, 14 insertions(+), 33 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 469c116..892ef8d 100644 --- a/src/app/pages/account/sys-role/sys-role.component.html +++ b/src/app/pages/account/sys-role/sys-role.component.html @@ -18,12 +18,10 @@ - 角色名称 - 角色描述 + 角色描述 创建时间 修改时间 操作 diff --git a/src/app/pages/account/sys-role/sys-role.component.less b/src/app/pages/account/sys-role/sys-role.component.less index e4646c3..dab6f69 100644 --- a/src/app/pages/account/sys-role/sys-role.component.less +++ b/src/app/pages/account/sys-role/sys-role.component.less @@ -1,33 +1,9 @@ -.ant-advanced-search-form { - padding: 24px; - background: #fbfbfb; - border: 1px solid #d9d9d9; - border-radius: 6px; -} - -.search-result-list { - margin-top: 16px; - border: 1px dashed #e9e9e9; - border-radius: 6px; - background-color: #fafafa; - min-height: 200px; - text-align: center; - padding-top: 80px; -} - [nz-form-label] { overflow: visible; } - button { margin-left: 8px; } - -.collapse { - margin-left: 8px; - font-size: 12px; -} - .search-area { text-align: right; } 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 a835579..d592149 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,11 @@ import {Component, ViewChild} from '@angular/core'; -import {NzTableComponent, NzTbodyComponent, NzTheadComponent, NzThMeasureDirective} from "ng-zorro-antd/table"; +import { + NzTableComponent, + NzTableModule, + 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"; @@ -18,9 +24,8 @@ import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/mod import {NzMessageService} from "ng-zorro-antd/message"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; -import {DATA} from "../../../data/login/localStorage.namespace"; import {MenuService} from "../../../servies/menu/menu.service"; -import {NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions} from "ng-zorro-antd/tree"; +import {NzTreeComponent, NzTreeNodeOptions} from "ng-zorro-antd/tree"; @Component({ selector: 'app-sys-role', @@ -49,6 +54,7 @@ import {NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions} from "ng-zorro-an NzModalModule, NgIf, NzTreeComponent, + NzTableModule ], templateUrl: './sys-role.component.html', styleUrl: './sys-role.component.less' @@ -75,9 +81,9 @@ export class SysRoleComponent { // 当前需要分配权限角色 currentAssignRoleId: any = null; // 菜单树 - menuTree: any = []; + menuTree: NzTreeNodeOptions[] = []; // 菜单已勾选数据 - menuTreeCheckedKeys: any = []; + menuTreeCheckedKeys = []; @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; @@ -123,6 +129,7 @@ export class SysRoleComponent { * 搜索表单提交 */ searchFormSubmit(): void { + this.tablePageNum = 1; this.queryData(); } @@ -221,7 +228,6 @@ export class SysRoleComponent { this.currentAssignRoleId = roleId; this.menuService.queryRoleMenuArray(roleId, (data: any) => { this.menuTreeCheckedKeys = data['return_data']; - console.log(this.menuTreeCheckedKeys); }); this.assignRoleMenuVisible = true; } @@ -267,6 +273,7 @@ export class SysRoleComponent { this.menuService.assignMenu(param, (data: any) => { if (data['return_code'] == '000000') { this.message.create('success', '操作成功'); + this.closeAssignRoleMenu(); } else { this.message.create('error', data['return_msg']); }