From c2b34c15bfa28c70c28ffa5cd9f30d8205d5eba3 Mon Sep 17 00:00:00 2001 From: zhangjun1 Date: Wed, 3 Jan 2024 15:29:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B7=B3=E8=BD=AC=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E7=AD=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 16 +- src/components/bg-menu/menu-list.vue | 32 ++- src/components/login-by-account.vue | 2 +- src/components/login-by-code.vue | 2 +- src/main.js | 7 +- src/page/main/authority/user/edit/index.vue | 238 ++++++++++++++++++ .../main/authority/user/edit/system-form.vue | 175 +++++++++++++ vite.config.js | 5 + 8 files changed, 465 insertions(+), 12 deletions(-) create mode 100644 src/page/main/authority/user/edit/index.vue create mode 100644 src/page/main/authority/user/edit/system-form.vue diff --git a/src/App.vue b/src/App.vue index bf78208..a7e6fe7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,13 +3,12 @@
-
@@ -108,6 +107,7 @@ export default { return { readFlag: false, menuIndex: "", + dealArr: [], }; }, created() { @@ -162,7 +162,17 @@ export default { highlightParentRule(pathArr) { return pathArr.includes(this.$route.path); }, - ada() {}, + dealUrl(arr) { + (arr || []).forEach((e) => { + if (e.path.includes("#")) { + e.path = e.path.split("#")[1]; + } + if (e.children && e.children.length) { + this.dealUrl(e.children); + } + }); + return arr || []; + }, }, }; diff --git a/src/components/bg-menu/menu-list.vue b/src/components/bg-menu/menu-list.vue index 4c0c639..e58ad1d 100644 --- a/src/components/bg-menu/menu-list.vue +++ b/src/components/bg-menu/menu-list.vue @@ -48,10 +48,34 @@ const props = defineProps({ default: 0, }, }); -const childMenuAction = (item) => { - // if (isDeveloping(item.path)) return; - // window.open(item.path); - router.push(item.path); +const childMenuAction = (v) => { + if (v.menuType !== 1 && v.children && v.children.length) { + for (let index = 0; index < v.children.length; index++) { + const e = v.children[index]; + if (e.menuType !== 2) { + pathToUrl(e); + break; + } + } + } else { + pathToUrl(v); + } +}; + +const pathToUrl = (item) => { + //判断是否是新窗口打开 + if (item.new_window) { + window.open(item.sourcePath ? item.sourcePath : item.path, "_blank"); + } else { + // 当前窗口打开 + if (item.path.indexOf("#") > -1) { + // 携带#说明是其它项目,使用window.location.href + window.location.href = item.path; + } else { + // 不携带#说明是本项目,使用router.push + router.push(item.path); + } + } }; diff --git a/src/components/login-by-account.vue b/src/components/login-by-account.vue index 857f244..5e655b6 100644 --- a/src/components/login-by-account.vue +++ b/src/components/login-by-account.vue @@ -146,7 +146,7 @@ const getUser = () => { store.commit("setMenuObj", menuObj); // } generateRoutes(); - router.push("/forewarning/list"); + router.push("/"); } }); }; diff --git a/src/components/login-by-code.vue b/src/components/login-by-code.vue index 9fdc3a8..5138b20 100644 --- a/src/components/login-by-code.vue +++ b/src/components/login-by-code.vue @@ -166,7 +166,7 @@ const getUser = () => { store.commit("setMenuObj", menuObj); // } generateRoutes(); - router.push("/forewarning/list"); + router.push("/"); } }); }; diff --git a/src/main.js b/src/main.js index 7cf1da1..a65492d 100644 --- a/src/main.js +++ b/src/main.js @@ -100,12 +100,13 @@ Promise.all([getUser(), getMenu("1e99371c-187f-4966-94cf-32f116f42ce6")]) // if (res[0].data.data.userType == 1) {//超管 store.commit("setMenu", data); - menu.menuToRouter(data); - store.commit("setRoute", data); + let routeData = JSON.parse(JSON.stringify(data)); + menu.menuToRouter(routeData); + store.commit("setRoute", routeData); //存储菜单对象信息 let menuObj = {}; - getMenuObj(data, "", menuObj); + getMenuObj(routeData, "", menuObj); store.commit("setMenuObj", menuObj); // } diff --git a/src/page/main/authority/user/edit/index.vue b/src/page/main/authority/user/edit/index.vue new file mode 100644 index 0000000..61353d0 --- /dev/null +++ b/src/page/main/authority/user/edit/index.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/src/page/main/authority/user/edit/system-form.vue b/src/page/main/authority/user/edit/system-form.vue new file mode 100644 index 0000000..1432472 --- /dev/null +++ b/src/page/main/authority/user/edit/system-form.vue @@ -0,0 +1,175 @@ + + + diff --git a/vite.config.js b/vite.config.js index a1716c5..d136a1c 100644 --- a/vite.config.js +++ b/vite.config.js @@ -71,6 +71,11 @@ export default { changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL secure: false, //解决证书缺失问题 }, + "/aiops/systemmonitor/ui/": { + target: "https://xc-cloud.dev.wodcloud.com/", // 所要代理的目标地址 + changeOrigin: true, // true/false, Default: false - changes the origin of the host header to the target URL + secure: false, //解决证书缺失问题 + }, }, }, build: { -- 2.26.0