From 09c0cee3bb46a197e057177e6c70cc408dbf12ea Mon Sep 17 00:00:00 2001 From: leiqiaochu Date: Mon, 9 Oct 2023 10:33:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=9B=B8=E5=85=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/menu.ts | 26 +++++++++++----------- src/views/init-home/Menu/index.vue | 14 ++++++++++++ src/views/system/Menu/Detail/BasicInfo.vue | 3 +++ src/views/system/Menu/Setting/index.vue | 2 +- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/store/menu.ts b/src/store/menu.ts index 6ccee966..94d0da40 100644 --- a/src/store/menu.ts +++ b/src/store/menu.ts @@ -34,19 +34,19 @@ const defaultOwnParams = [ } ] }, - // { - // terms: [ - // { - // terms: [ - // { - // value: "%show\":true%", - // termType: "like", - // column: "options" - // } - // ] - // } - // ] - // } + { + terms: [ + { + terms: [ + { + value: "%show\":true%", + termType: "like", + column: "options" + } + ] + } + ] + } ] } ] diff --git a/src/views/init-home/Menu/index.vue b/src/views/init-home/Menu/index.vue index d4270dde..914ccb6d 100644 --- a/src/views/init-home/Menu/index.vue +++ b/src/views/init-home/Menu/index.vue @@ -96,12 +96,26 @@ const menuCount = (menus: any[]) => { return pre + _count; }, 0); }; +/** + * 添加options show用于控制菜单是否显示函数 + */ +const dealMenu = (data:any) =>{ + data.forEach((item:any)=>{ + item.options = { + show: true + } + if(item.children){ + dealMenu(item.children) + } + }) +} /** * 初始化菜单 */ const initMenu = async () => { return new Promise(async (resolve) => { // 用户中心 + dealMenu(menuDatas.current) console.log([...menuDatas.current!, USER_CENTER_MENU_DATA]); const res = await updateMenus([...menuDatas.current!, USER_CENTER_MENU_DATA]); if (res.status === 200) { diff --git a/src/views/system/Menu/Detail/BasicInfo.vue b/src/views/system/Menu/Detail/BasicInfo.vue index 5cf55a52..807d27b4 100644 --- a/src/views/system/Menu/Detail/BasicInfo.vue +++ b/src/views/system/Menu/Detail/BasicInfo.vue @@ -371,6 +371,9 @@ const form = reactive({ const accessSupportValue = form.data.accessSupport; const params = { ...form.data, + options:{ + show:true + }, accessSupport: { value: accessSupportValue, label: diff --git a/src/views/system/Menu/Setting/index.vue b/src/views/system/Menu/Setting/index.vue index e1389292..5fc19416 100644 --- a/src/views/system/Menu/Setting/index.vue +++ b/src/views/system/Menu/Setting/index.vue @@ -268,7 +268,7 @@ onMounted(() => { // )) // console.log(AllMenu); // 处理排序 - treeData.value = handleSortsArr(AllMenu); + treeData.value = handleSortsArr(systemMenu.value); } }); });