提交代码

master
胡锐 7 months ago
parent de6fa34226
commit 5aa3324715
  1. 4
      src/app/pages/account/sys-role/sys-role.component.html
  2. 24
      src/app/pages/account/sys-role/sys-role.component.less
  3. 19
      src/app/pages/account/sys-role/sys-role.component.ts

@ -18,12 +18,10 @@
</div> </div>
</form> </form>
<nz-table #basicTable <nz-table #basicTable
[nzBordered]="true" [nzBordered]="true"
[nzFrontPagination]="false" [nzFrontPagination]="false"
[nzShowQuickJumper]="true" [nzShowQuickJumper]="true"
[nzScroll]="{ x: '1100px' }"
[nzShowTotal]="totalTemplate" [nzShowTotal]="totalTemplate"
[(nzPageIndex)]="tablePageNum" [(nzPageIndex)]="tablePageNum"
(nzPageIndexChange)="queryData()" (nzPageIndexChange)="queryData()"
@ -32,7 +30,7 @@
<thead> <thead>
<tr> <tr>
<th nzWidth="80px">角色名称</th> <th nzWidth="80px">角色名称</th>
<th nzWidth="150px">角色描述</th> <th nzWidth="100px">角色描述</th>
<th nzWidth="50px">创建时间</th> <th nzWidth="50px">创建时间</th>
<th nzWidth="50px">修改时间</th> <th nzWidth="50px">修改时间</th>
<th nzWidth="50px">操作</th> <th nzWidth="50px">操作</th>

@ -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] { [nz-form-label] {
overflow: visible; overflow: visible;
} }
button { button {
margin-left: 8px; margin-left: 8px;
} }
.collapse {
margin-left: 8px;
font-size: 12px;
}
.search-area { .search-area {
text-align: right; text-align: right;
} }

@ -1,5 +1,11 @@
import {Component, ViewChild} from '@angular/core'; 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 {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";
@ -18,9 +24,8 @@ import {NzModalComponent, NzModalModule, NzModalService} from "ng-zorro-antd/mod
import {NzMessageService} from "ng-zorro-antd/message"; import {NzMessageService} from "ng-zorro-antd/message";
import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; import {NzInputNumberComponent} from "ng-zorro-antd/input-number";
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select";
import {DATA} from "../../../data/login/localStorage.namespace";
import {MenuService} from "../../../servies/menu/menu.service"; 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({ @Component({
selector: 'app-sys-role', selector: 'app-sys-role',
@ -49,6 +54,7 @@ import {NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions} from "ng-zorro-an
NzModalModule, NzModalModule,
NgIf, NgIf,
NzTreeComponent, NzTreeComponent,
NzTableModule
], ],
templateUrl: './sys-role.component.html', templateUrl: './sys-role.component.html',
styleUrl: './sys-role.component.less' styleUrl: './sys-role.component.less'
@ -75,9 +81,9 @@ export class SysRoleComponent {
// 当前需要分配权限角色 // 当前需要分配权限角色
currentAssignRoleId: any = null; currentAssignRoleId: any = null;
// 菜单树 // 菜单树
menuTree: any = []; menuTree: NzTreeNodeOptions[] = [];
// 菜单已勾选数据 // 菜单已勾选数据
menuTreeCheckedKeys: any = []; menuTreeCheckedKeys = [];
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent; @ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
@ -123,6 +129,7 @@ export class SysRoleComponent {
* *
*/ */
searchFormSubmit(): void { searchFormSubmit(): void {
this.tablePageNum = 1;
this.queryData(); this.queryData();
} }
@ -221,7 +228,6 @@ export class SysRoleComponent {
this.currentAssignRoleId = roleId; this.currentAssignRoleId = roleId;
this.menuService.queryRoleMenuArray(roleId, (data: any) => { this.menuService.queryRoleMenuArray(roleId, (data: any) => {
this.menuTreeCheckedKeys = data['return_data']; this.menuTreeCheckedKeys = data['return_data'];
console.log(this.menuTreeCheckedKeys);
}); });
this.assignRoleMenuVisible = true; this.assignRoleMenuVisible = true;
} }
@ -267,6 +273,7 @@ export class SysRoleComponent {
this.menuService.assignMenu(param, (data: any) => { this.menuService.assignMenu(param, (data: any) => {
if (data['return_code'] == '000000') { if (data['return_code'] == '000000') {
this.message.create('success', '操作成功'); this.message.create('success', '操作成功');
this.closeAssignRoleMenu();
} else { } else {
this.message.create('error', data['return_msg']); this.message.create('error', data['return_msg']);
} }

Loading…
Cancel
Save