From e1e1ed4a27dfdb29893fa5a2df3da3c73dd34180 Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Thu, 2 Nov 2023 10:13:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E8=8F=9C=E5=8D=95=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/utils/menu.ts | 5 +- src/views/init-home/Menu/index.vue | 8 +- src/views/init-home/data/baseMenu.ts | 234 +++++++++++++++++++++ src/views/system/Menu/Detail/BasicInfo.vue | 2 +- yarn.lock | 8 +- 6 files changed, 248 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 6976a7c2..c8700605 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.34-4", + "jetlinks-ui-components": "^1.0.34-7", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", "less": "^4.1.3", diff --git a/src/utils/menu.ts b/src/utils/menu.ts index 9b3b3e9d..45061013 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -320,6 +320,9 @@ export const handleSiderMenu = (menuData: any[]) => { if (menuData && menuData.length) { return menuData.map(item => { const { isApp, appUrl } = hasAppID(item) // 是否为第三方程序 + if ( item.options?.isShow !== undefined && item.isShow === undefined) { + item.isShow = item.options.isShow + } const meta = handleMeta(item, isApp) const route: any = { path: isApp ? appUrl : `${item.url}`, @@ -333,7 +336,7 @@ export const handleSiderMenu = (menuData: any[]) => { route.children = handleSiderMenu(route.children) } - route.meta.hideInMenu = hideInMenu(item.code) + // route.meta.hideInMenu = hideInMenu(item.code) return route }) diff --git a/src/views/init-home/Menu/index.vue b/src/views/init-home/Menu/index.vue index 914ccb6d..6ce235ff 100644 --- a/src/views/init-home/Menu/index.vue +++ b/src/views/init-home/Menu/index.vue @@ -101,9 +101,9 @@ const menuCount = (menus: any[]) => { */ const dealMenu = (data:any) =>{ data.forEach((item:any)=>{ - item.options = { - show: true - } + item.options = Object.assign({ + show: true + }, item?.options || {}) if(item.children){ dealMenu(item.children) } @@ -139,4 +139,4 @@ defineExpose({ margin-right: 16px; } } - \ No newline at end of file + diff --git a/src/views/init-home/data/baseMenu.ts b/src/views/init-home/data/baseMenu.ts index e4cdbae8..bdebabcd 100644 --- a/src/views/init-home/data/baseMenu.ts +++ b/src/views/init-home/data/baseMenu.ts @@ -13,6 +13,9 @@ export const USER_CENTER_MENU_DATA = { sortIndex: 9999, granted: true, owner: 'iot', + options: { + isShow: false, + }, permissions: [ { permission: 'system_config', @@ -4588,5 +4591,236 @@ export default [ supportDataAccess: false }, ], + }, + { + "id": "50a4a0582cc8b93590475efc96ffa86e", + "path": "3nkE", + "sortIndex": 5, + "level": 1, + "owner": "iot", + "name": "低码菜单", + "code": "code", + "url": "/code", + "icon": "MenuUnfoldOutlined", + showPage: ["low-code-editor","process-deployment", "low-code-info"], + "options": { + isShow: false, + }, + "accessSupport": { + "text": "不支持", + "value": "unsupported" + }, + "indirectMenus": [], + permissions: [ + { + "permission": "low-code-info", + "actions": [ + "add", "query", "save", "delete" + ] + }, + { + "permission": "low-code-editor", + "actions": [ + "query", "deploy" + ] + } + ], + "buttons": [ + { + "id": "form_query", + "name": "流程表单-查询", + "permissions": [ + { + "permission": "process-form", + "actions": [ + "query" + ] + } + ] + }, + { + "id": "form_save", + "name": "流程表单-保存", + "permissions": [ + { + "permission": "process-form", + "actions": [ + "save" + ] + } + ] + }, + { + "id": "form_delete", + "name": "流程表单-删除", + "permissions": [ + { + "permission": "process-form", + "actions": [ + "delete" + ] + } + ] + }, + { + "id": "definition_query", + "name": "流程定义-查询", + "permissions": [ + { + "permission": "process-definition", + "actions": [ + "query" + ] + } + ] + }, + { + "id": "definition_save", + "name": "流程定义-保存", + "permissions": [ + { + "permission": "process-definition", + "actions": [ + "save" + ] + } + ] + }, + { + "id": "definition_delete", + "name": "流程定义-删除", + "permissions": [ + { + "permission": "process-definition", + "actions": [ + "delete" + ] + } + ] + }, + { + "id": "release_query", + "name": "流程部署-查询", + "permissions": [ + { + "permission": "process-deployment", + "actions": [ + "query" + ] + } + ] + }, + { + "id": "release_save", + "name": "流程部署-保存", + "permissions": [ + { + "permission": "process-deployment", + "actions": [ + "save" + ] + } + ] + }, + { + "id": "release_delete", + "name": "流程部署-删除", + "permissions": [ + { + "permission": "process-deployment", + "actions": [ + "delete" + ] + } + ] + }, + { + "id": "runtime-dismiss", + "name": "流程运行时-驳回任务", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "reject" + ] + } + ] + }, + { + "id": "runtime-initiate", + "name": "流程运行时-发起流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "start" + ] + } + ] + }, + { + "id": "runtime-mine", + "name": "流程运行时-我的流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "self" + ] + } + ] + }, + { + "id": "runtime-sign", + "name": "流程运行时-签收任务", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "claim" + ] + } + ] + }, + { + "id": "runtime-complete", + "name": "流程运行时-完成任务", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "complete" + ] + } + ] + }, + { + "id": "runtime-create", + "name": "流程运行时-创建/启动流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "createAndStart" + ] + } + ] + }, + { + "id": "runtime-revoke", + "name": "流程运行时-撤销流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "repeal" + ] + } + ] + } + ], + "creatorId": "1199596756811550720", + "createTime": 1698735482730, + "supportDataAccess": false } ]; diff --git a/src/views/system/Menu/Detail/BasicInfo.vue b/src/views/system/Menu/Detail/BasicInfo.vue index 8ecea9a7..82f55070 100644 --- a/src/views/system/Menu/Detail/BasicInfo.vue +++ b/src/views/system/Menu/Detail/BasicInfo.vue @@ -386,7 +386,7 @@ const form = reactive({ const params = { ...form.data, owner: form.data?.owner ?? null, - options: { show: true }, + options: form.data?.options || { show: true }, accessSupport: { value: accessSupportValue, label: diff --git a/yarn.lock b/yarn.lock index eb31db18..11df283f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3738,10 +3738,10 @@ jetlinks-store@^0.0.3: resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz" integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q== -jetlinks-ui-components@^1.0.34-4: - version "1.0.34-4" - resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-4.tgz#92cfc6be685988385a489f3e924383c4831f3ed5" - integrity sha512-td+RgaBC5lQxRuDsHkCg9UEzCcSy4XikufnabVGz5IxU+UmXu+PJUjz2wo9vDe8sPSctyk/5jQU+N6GBPlp8JA== +jetlinks-ui-components@^1.0.34-7: + version "1.0.34-7" + resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-7.tgz#3a14e85edb4c5d11427d30f3925dc5f498478940" + integrity sha512-Rgbjig3QYP8CDVHLbco20Cf7sArYralO8yWtH5E5zylYAN2lINLUsgOlIVf9aweszZR/Ps+z/NLP0CoRQf1Xtw== dependencies: "@vueuse/core" "^9.12.0" "@vueuse/router" "^9.13.0"