fix: 修复菜单相关bug
This commit is contained in:
parent
dbdb044075
commit
09c0cee3bb
|
@ -34,19 +34,19 @@ const defaultOwnParams = [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// terms: [
|
terms: [
|
||||||
// {
|
{
|
||||||
// terms: [
|
terms: [
|
||||||
// {
|
{
|
||||||
// value: "%show\":true%",
|
value: "%show\":true%",
|
||||||
// termType: "like",
|
termType: "like",
|
||||||
// column: "options"
|
column: "options"
|
||||||
// }
|
}
|
||||||
// ]
|
]
|
||||||
// }
|
}
|
||||||
// ]
|
]
|
||||||
// }
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -96,12 +96,26 @@ const menuCount = (menus: any[]) => {
|
||||||
return pre + _count;
|
return pre + _count;
|
||||||
}, 0);
|
}, 0);
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 添加options show用于控制菜单是否显示函数
|
||||||
|
*/
|
||||||
|
const dealMenu = (data:any) =>{
|
||||||
|
data.forEach((item:any)=>{
|
||||||
|
item.options = {
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
if(item.children){
|
||||||
|
dealMenu(item.children)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 初始化菜单
|
* 初始化菜单
|
||||||
*/
|
*/
|
||||||
const initMenu = async () => {
|
const initMenu = async () => {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
// 用户中心
|
// 用户中心
|
||||||
|
dealMenu(menuDatas.current)
|
||||||
console.log([...menuDatas.current!, USER_CENTER_MENU_DATA]);
|
console.log([...menuDatas.current!, USER_CENTER_MENU_DATA]);
|
||||||
const res = await updateMenus([...menuDatas.current!, USER_CENTER_MENU_DATA]);
|
const res = await updateMenus([...menuDatas.current!, USER_CENTER_MENU_DATA]);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
|
|
@ -371,6 +371,9 @@ const form = reactive({
|
||||||
const accessSupportValue = form.data.accessSupport;
|
const accessSupportValue = form.data.accessSupport;
|
||||||
const params = {
|
const params = {
|
||||||
...form.data,
|
...form.data,
|
||||||
|
options:{
|
||||||
|
show:true
|
||||||
|
},
|
||||||
accessSupport: {
|
accessSupport: {
|
||||||
value: accessSupportValue,
|
value: accessSupportValue,
|
||||||
label:
|
label:
|
||||||
|
|
|
@ -268,7 +268,7 @@ onMounted(() => {
|
||||||
// ))
|
// ))
|
||||||
// console.log(AllMenu);
|
// console.log(AllMenu);
|
||||||
// 处理排序
|
// 处理排序
|
||||||
treeData.value = handleSortsArr(AllMenu);
|
treeData.value = handleSortsArr(systemMenu.value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue