|
|
|
@ -24,6 +24,7 @@ import {NzFlexDirective} from "ng-zorro-antd/flex"; |
|
|
|
|
import {NzOptionComponent, NzSelectComponent} from "ng-zorro-antd/select"; |
|
|
|
|
import {NzInputNumberComponent} from "ng-zorro-antd/input-number"; |
|
|
|
|
import {NzMessageService} from "ng-zorro-antd/message"; |
|
|
|
|
import {DATA} from "../../../data/login/localStorage.namespace"; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-menu', |
|
|
|
@ -78,6 +79,7 @@ export class MenuComponent { |
|
|
|
|
private fb: NonNullableFormBuilder, |
|
|
|
|
private message: NzMessageService) { |
|
|
|
|
this.queryMenuData(); |
|
|
|
|
this.queryMenuTree2(); |
|
|
|
|
|
|
|
|
|
this.editMenuForm = this.fb.group({ |
|
|
|
|
id: [], |
|
|
|
@ -91,15 +93,20 @@ export class MenuComponent { |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
queryMenuTree2() { |
|
|
|
|
this.menuService.queryRoleMenuTree2('', (data: any) => { |
|
|
|
|
this.menuTree = data['return_data']; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询菜单数据 |
|
|
|
|
*/ |
|
|
|
|
queryMenuData() { |
|
|
|
|
this.menuService.queryMenuList((data: any) => { |
|
|
|
|
console.log(data); |
|
|
|
|
this.menuData = data['return_data']; |
|
|
|
|
// 获取菜单树形结构
|
|
|
|
|
this.queryMenuTree(); |
|
|
|
|
// this.queryMenuTree();
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -206,11 +213,12 @@ export class MenuComponent { |
|
|
|
|
console.log('submit', this.editMenuForm.value); |
|
|
|
|
this.menuService.editMenu(this.editMenuForm.value, (data: any) => { |
|
|
|
|
if (data['return_code'] == '000000') { |
|
|
|
|
console.log("获取数据", data); |
|
|
|
|
// 刷新数据
|
|
|
|
|
this.queryMenuData(); |
|
|
|
|
this.queryMenuTree2(); |
|
|
|
|
|
|
|
|
|
this.message.create('success', '操作成功'); |
|
|
|
|
|
|
|
|
|
this.editMenuVisible = false; |
|
|
|
|
// 关闭弹窗
|
|
|
|
|
this.closeEditMenu(); |
|
|
|
|
} else { |
|
|
|
|