From a484afad666da48aacbea41dd5d48d52afe3d99b Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Wed, 22 Jun 2022 15:16:08 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=E5=AE=8C=E5=96=84=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E5=88=86=E9=85=8D=E8=8F=9C=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../menu/editmenu/editmenu.component.spec.ts | 25 --------- .../menu/menu.component.spec.ts | 25 --------- .../system-management/menu/menu.component.ts | 2 +- .../role/menus/menus.component.html | 2 +- .../system-management/role/role.component.ts | 54 +++++++++---------- 5 files changed, 26 insertions(+), 82 deletions(-) delete mode 100644 src/app/system-management/menu/editmenu/editmenu.component.spec.ts delete mode 100644 src/app/system-management/menu/menu.component.spec.ts diff --git a/src/app/system-management/menu/editmenu/editmenu.component.spec.ts b/src/app/system-management/menu/editmenu/editmenu.component.spec.ts deleted file mode 100644 index 4f3b8fc..0000000 --- a/src/app/system-management/menu/editmenu/editmenu.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { EditmenuComponent } from './editmenu.component'; - -describe('EditmenuComponent', () => { - let component: EditmenuComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ EditmenuComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(EditmenuComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/system-management/menu/menu.component.spec.ts b/src/app/system-management/menu/menu.component.spec.ts deleted file mode 100644 index beb2d9b..0000000 --- a/src/app/system-management/menu/menu.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { MenuComponent } from './menu.component'; - -describe('MenuComponent', () => { - let component: MenuComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ MenuComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(MenuComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/system-management/menu/menu.component.ts b/src/app/system-management/menu/menu.component.ts index a4b6f4b..90a7e9a 100644 --- a/src/app/system-management/menu/menu.component.ts +++ b/src/app/system-management/menu/menu.component.ts @@ -114,7 +114,7 @@ export class MenuComponent implements OnInit { editOr(node) { console.log(node) const modal = this.modal.create({ - nzTitle: '编辑组织机构', + nzTitle: '编辑菜单', nzContent: EditmenuComponent, nzViewContainerRef: this.viewContainerRef, nzWidth: 288, diff --git a/src/app/system-management/role/menus/menus.component.html b/src/app/system-management/role/menus/menus.component.html index 21367cc..0688cc2 100644 --- a/src/app/system-management/role/menus/menus.component.html +++ b/src/app/system-management/role/menus/menus.component.html @@ -3,7 +3,7 @@ 菜单 - diff --git a/src/app/system-management/role/role.component.ts b/src/app/system-management/role/role.component.ts index f390725..f9549e7 100644 --- a/src/app/system-management/role/role.component.ts +++ b/src/app/system-management/role/role.component.ts @@ -165,38 +165,32 @@ export class RoleComponent implements OnInit { nzOnOk: async () => { await new Promise(resolve => { console.log('表单信息', instance.validateForm) - console.log('tree', instance.nzTreeComponent.getCheckedNodeList()) - let arr = [] - let treeData = instance.nzTreeComponent.getCheckedNodeList() - treeData.forEach(element => { - arr.push(element.key) - if (element.origin.children.length != 0) { - element.origin.children.forEach(ele => { - arr.push(ele.key) - }) - } - if (element.parentNode) { - arr.push(element.parentNode.key) - } - }); - - - - console.log(99999999999, arr) - console.log(777777777777) - return false - // let body = instance.validateForm.value.menus - // this.http.post('/api/services/app/Role/SetRoleMenus', body, { - // params: { - // roleId: item.id + // let arr = [] + // let treeData = instance.nzTreeComponent.getCheckedNodeList() + // console.log('tree', treeData) + // treeData.forEach(element => { + // arr.push(element.key) + // if (element.origin.children && element.origin.children.length != 0) { + // element.origin.children.forEach(ele => { + // arr.push(ele.key) + // }) + // } + // if (element.parentNode) { + // arr.push(element.parentNode.key) // } - // }).subscribe(data => { - // resolve(data) - // this.message.create('success', '分配成功!'); - // this.getAllRoles() - // return true - // }) + // }); + let body = instance.validateForm.value.menus + this.http.post('/api/services/app/Role/SetRoleMenus', body, { + params: { + roleId: item.id + } + }).subscribe(data => { + resolve(data) + this.message.create('success', '分配成功!'); + this.getAllRoles() + return true + }) }) } });