优化菜单树的请求减少

This commit is contained in:
WangHao
2020-10-02 23:39:54 +08:00
parent 2ff53faf5a
commit d869b770e3
2 changed files with 18 additions and 2 deletions

View File

@ -479,6 +479,7 @@
/** 新增书签Url操作 */
addbookmarkurl:function(){
this.reset();
this.getTreeselect();
this.addopen = true;
// getMenu(e.getAttribute("data-menuId")).then(response => {
@ -548,6 +549,14 @@
},
/** 查询部门下拉树结构 */
getTreeselect() {
if (this.zNodes!=null&&this.zNodes.length!=0){
this.menuOptions = [];
const data = { menuId: 0, menuName: '顶级菜单', children: [] };
data.children = this.handleTree(this.zNodes, "menuId", "parentId");
this.menuOptions.push(data);
return;
}
listMenuByUserId().then(response => {
this.menuOptions = [];
const data = { menuId: 0, menuName: '顶级菜单', children: [] };