提交代码

master
胡锐 7 months ago
parent c0be78649b
commit 1fd3ee1d6f
  1. 16
      src/app/pages/system/menu/menu.component.ts
  2. 19
      src/app/servies/menu/menu.service.ts

@ -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 {

@ -23,7 +23,7 @@ export class MenuService {
}
/**
*
*
* @param roleId
* @param callBack
*/
@ -34,7 +34,7 @@ export class MenuService {
}
/**
*
*
* @param roleId
* @param callBack
*/
@ -48,6 +48,21 @@ export class MenuService {
});
}
/**
*
* @param roleId
* @param callBack
*/
public queryRoleMenuTree2(roleId: string, callBack:any) {
let paramStr = '';
if (roleId != null && roleId != '') {
paramStr = '?roleId=' + roleId;
}
this.http.get(environment.baseUrl + 'secMenu/queryRoleMenuTree2'+paramStr).subscribe(data => {
callBack(data);
});
}
/**
*
* @param params

Loading…
Cancel
Save