From 37af3cc0f990465d82518391b24201ee05f23688 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 10 Aug 2022 11:49:17 +0800 Subject: [PATCH] =?UTF-8?q?perf(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86-?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=AE=BE=E7=BD=AE):=20=E9=80=82=E9=85=8D?= =?UTF-8?q?=E6=96=B0=E7=89=88UI=E5=A2=9E=E5=8A=A0=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/dataease/plugins/server/PluginCommonServer.java | 2 +- frontend/src/components/AsyncComponent/index.vue | 10 +++++----- frontend/src/store/modules/permission.js | 5 ++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/backend/src/main/java/io/dataease/plugins/server/PluginCommonServer.java b/backend/src/main/java/io/dataease/plugins/server/PluginCommonServer.java index 0b4e8370ca..d178f435e7 100644 --- a/backend/src/main/java/io/dataease/plugins/server/PluginCommonServer.java +++ b/backend/src/main/java/io/dataease/plugins/server/PluginCommonServer.java @@ -33,7 +33,7 @@ public class PluginCommonServer { List menus = service.menus(); if (menus.stream().anyMatch(menu -> { atomicReference.set(menu); - return menu.getMenuId() == menuId; + return menu.getMenuId().equals(menuId); })) { String jsName = atomicReference.get().getComponent(); HttpServletResponse response = ServletUtils.response(); diff --git a/frontend/src/components/AsyncComponent/index.vue b/frontend/src/components/AsyncComponent/index.vue index 806d5e9de3..e3cd7d212c 100644 --- a/frontend/src/components/AsyncComponent/index.vue +++ b/frontend/src/components/AsyncComponent/index.vue @@ -49,12 +49,12 @@ export default { } else { res = await window.SyncComponentCache[this.url] } - const Fn = Function - this.mode = new Fn(`return ${res.data || res}`)() - /* if (res && res.data) { + + if (res) { const Fn = Function - this.mode = new Fn(`return ${res.data || res}`)() - } */ + const dynamicCode = res.data || res + this.mode = new Fn(`return ${dynamicCode}`)() + } } } }, diff --git a/frontend/src/store/modules/permission.js b/frontend/src/store/modules/permission.js index a3acca2db6..be81c6b7f1 100644 --- a/frontend/src/store/modules/permission.js +++ b/frontend/src/store/modules/permission.js @@ -29,11 +29,10 @@ const actions = { commit('SET_CURRENT_PATH', path) } } - +export const fullScreenRouters = ['XpackThemeForm'] export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由字符串,转换为组件对象 return routers.map(router => { - // 如果是菜单类型 且 是一级菜单 需要包装一层父级目录 - if (router.type === 1 && router.pid === 0 && router.component && router.component !== 'Layout') { + if (!fullScreenRouters.includes(router.component) && router.type === 1 && router.pid === 0 && router.component && router.component !== 'Layout') { router = decorate(router) } if (router.isPlugin) {