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 + }) }) } });