|
|
@ -14,7 +14,6 @@ import {NzCardComponent} from "ng-zorro-antd/card"; |
|
|
|
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
|
|
|
import {NzColDirective, NzRowDirective} from "ng-zorro-antd/grid"; |
|
|
|
import {NzButtonComponent} from "ng-zorro-antd/button"; |
|
|
|
import {NzButtonComponent} from "ng-zorro-antd/button"; |
|
|
|
import {NzDescriptionsComponent, NzDescriptionsItemComponent} from "ng-zorro-antd/descriptions"; |
|
|
|
import {NzDescriptionsComponent, NzDescriptionsItemComponent} from "ng-zorro-antd/descriptions"; |
|
|
|
import {MenuTypePipe} from "../../../pipes/menu/menu-type.pipe"; |
|
|
|
|
|
|
|
import {NzFormDirective, NzFormLabelComponent, NzFormModule} from "ng-zorro-antd/form"; |
|
|
|
import {NzFormDirective, NzFormLabelComponent, NzFormModule} from "ng-zorro-antd/form"; |
|
|
|
import {FormGroup, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; |
|
|
|
import {FormGroup, NonNullableFormBuilder, ReactiveFormsModule, Validators} from "@angular/forms"; |
|
|
|
import {NzInputDirective, NzInputGroupComponent} from "ng-zorro-antd/input"; |
|
|
|
import {NzInputDirective, NzInputGroupComponent} from "ng-zorro-antd/input"; |
|
|
@ -25,6 +24,8 @@ import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; |
|
|
|
import {NzMessageService} from "ng-zorro-antd/message"; |
|
|
|
import {NzMessageService} from "ng-zorro-antd/message"; |
|
|
|
import {NzSpinComponent} from "ng-zorro-antd/spin"; |
|
|
|
import {NzSpinComponent} from "ng-zorro-antd/spin"; |
|
|
|
import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; |
|
|
|
import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; |
|
|
|
|
|
|
|
import {DictionaryPipe} from "../../../pipes/common/dictionary.pipe"; |
|
|
|
|
|
|
|
import {Dictionary} from "../../../data/common/dictionary.namespace"; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-menu', |
|
|
|
selector: 'app-menu', |
|
|
@ -42,7 +43,6 @@ import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; |
|
|
|
NzRowDirective, |
|
|
|
NzRowDirective, |
|
|
|
NzColDirective, |
|
|
|
NzColDirective, |
|
|
|
NzButtonComponent, |
|
|
|
NzButtonComponent, |
|
|
|
MenuTypePipe, |
|
|
|
|
|
|
|
NzModalModule, |
|
|
|
NzModalModule, |
|
|
|
NzFormDirective, |
|
|
|
NzFormDirective, |
|
|
|
ReactiveFormsModule, |
|
|
|
ReactiveFormsModule, |
|
|
@ -58,7 +58,8 @@ import {NzTreeSelectComponent} from "ng-zorro-antd/tree-select"; |
|
|
|
NgForOf, |
|
|
|
NgForOf, |
|
|
|
NzInputNumberComponent, |
|
|
|
NzInputNumberComponent, |
|
|
|
NzSpinComponent, |
|
|
|
NzSpinComponent, |
|
|
|
NzTreeSelectComponent |
|
|
|
NzTreeSelectComponent, |
|
|
|
|
|
|
|
DictionaryPipe |
|
|
|
], |
|
|
|
], |
|
|
|
templateUrl: './menu.component.html', |
|
|
|
templateUrl: './menu.component.html', |
|
|
|
styleUrl: './menu.component.less' |
|
|
|
styleUrl: './menu.component.less' |
|
|
@ -78,11 +79,15 @@ export class MenuComponent { |
|
|
|
editMenuTitle = ''; |
|
|
|
editMenuTitle = ''; |
|
|
|
// 树视图展示状态
|
|
|
|
// 树视图展示状态
|
|
|
|
treeView= false; |
|
|
|
treeView= false; |
|
|
|
|
|
|
|
menuTypeArray:Dictionary[] = []; |
|
|
|
constructor(private menuService: MenuService, |
|
|
|
constructor(private menuService: MenuService, |
|
|
|
private fb: NonNullableFormBuilder, |
|
|
|
private fb: NonNullableFormBuilder, |
|
|
|
private modal: NzModalService, |
|
|
|
private modal: NzModalService, |
|
|
|
private message: NzMessageService) { |
|
|
|
private message: NzMessageService) { |
|
|
|
|
|
|
|
// 菜单类型
|
|
|
|
|
|
|
|
this.menuTypeArray = new DictionaryPipe().getDictionaryList('MENU_TYPE'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取菜单数据
|
|
|
|
this.queryMenuTree(); |
|
|
|
this.queryMenuTree(); |
|
|
|
|
|
|
|
|
|
|
|
this.editMenuForm = this.fb.group({ |
|
|
|
this.editMenuForm = this.fb.group({ |
|
|
@ -114,7 +119,6 @@ export class MenuComponent { |
|
|
|
queryMenuData() { |
|
|
|
queryMenuData() { |
|
|
|
this.menuService.queryMenuList((data: any) => { |
|
|
|
this.menuService.queryMenuList((data: any) => { |
|
|
|
this.menuData = data['return_data']; |
|
|
|
this.menuData = data['return_data']; |
|
|
|
console.log("父类菜单数据" , this.menuData); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -148,7 +152,7 @@ export class MenuComponent { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (edit == false && this.menuDetail?.id == null) { |
|
|
|
if (edit == false && this.menuDetail?.id == null) { |
|
|
|
this.modal.confirm({ |
|
|
|
this.modal.warning({ |
|
|
|
nzTitle: '提示', |
|
|
|
nzTitle: '提示', |
|
|
|
nzContent: '请点击需要修改的菜单', |
|
|
|
nzContent: '请点击需要修改的菜单', |
|
|
|
}); |
|
|
|
}); |
|
|
@ -180,7 +184,6 @@ export class MenuComponent { |
|
|
|
submitEditMenuForm() { |
|
|
|
submitEditMenuForm() { |
|
|
|
if (this.editMenuForm.valid) { |
|
|
|
if (this.editMenuForm.valid) { |
|
|
|
this.treeView = false; |
|
|
|
this.treeView = false; |
|
|
|
console.log(this.editMenuForm.value['menuPSid']); |
|
|
|
|
|
|
|
this.editMenuForm.value['menuPSid']!=null?this.editMenuForm.value['menuPSid']:null; |
|
|
|
this.editMenuForm.value['menuPSid']!=null?this.editMenuForm.value['menuPSid']:null; |
|
|
|
this.menuService.editMenu(this.editMenuForm.value, (data: any) => { |
|
|
|
this.menuService.editMenu(this.editMenuForm.value, (data: any) => { |
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
if (data['return_code'] == '000000') { |
|
|
|