From fcf0e3f66f6f838a062105dc0ba8977ced43197b Mon Sep 17 00:00:00 2001 From: dhy1725534722 <1725534722@qq.com> Date: Tue, 1 Aug 2023 10:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8F=9C=E5=8D=95=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 8 +-- src/router/index.js | 127 ++++++++++++++++---------------------------- src/views/index.vue | 56 +++++++++---------- 3 files changed, 78 insertions(+), 113 deletions(-) diff --git a/src/permission.js b/src/permission.js index c65d0ac..ab778d1 100644 --- a/src/permission.js +++ b/src/permission.js @@ -23,9 +23,11 @@ const whiteList = [ "/statistics", "/administrative", - "/enterpriseMsg", - "/productsMsg", - "/logout", + "/A/enterpriseMsg", + '/productsMsg/drugArchives', + '/productsMsg/cosmeticsArchives', + '/productsMsg/health', + '/B/logout' ]; router.beforeEach((to, from, next) => { NProgress.start(); diff --git a/src/router/index.js b/src/router/index.js index 171a7dd..6098fd8 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -61,7 +61,6 @@ export const constantRoutes = [ component: () => import("@/views/error/401"), hidden: true, }, - { path: '', component: () => import("@/views/index"), @@ -75,103 +74,67 @@ export const constantRoutes = [ component: () => import("@/views/administrative/index"), meta: { title: "行政审批", icon: "netWork" }, }, + ] + }, + { + path: '/A', + component: () => import("@/views/index"), + redirect: "enterpriseMsg", + isDiy: true, + children: [ { - path: '/enterpriseMsg', + path: 'enterpriseMsg', name: "企业档案", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/enterpriseMsg/index"), meta: { title: "企业档案", icon: "netWork" }, }, + ] + }, + { + path: '/B', + component: () => import("@/views/index"), + redirect: "logout", + isDiy: true, + children: [ { - path: "/logout", + path: "logout", name: "依法注销", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/logout/index"), meta: { title: "依法注销", icon: "netWork" }, }, + ] + }, + { + path: '/productsMsg', + component: () => import("@/views/index"), + redirect: "drugArchives", + isDiy: true, + children: [ { - path: '/productsMsg', - name: "产品档案", + path: "drugArchives", + name: "药品档案", icon: require("@/assets/images/tree4.svg"), - component: () => import("@/views/productsMsg/index"), - meta: { title: "产品档案", icon: "netWork" }, - } + component: () => import("@/views/productsMsg/components/drugArchives.vue"), + meta: { title: "药品档案", icon: "netWork" }, + }, + { + path: "cosmeticsArchives", + name: "化妆品档案", + icon: require("@/assets/images/tree4.svg"), + component: () => import("@/views/productsMsg/components/cosmeticsArchives.vue"), + meta: { title: "化妆品档案", icon: "netWork" }, + }, + { + path: "health", + name: "医疗器械档案", + icon: require("@/assets/images/tree4.svg"), + component: () => import("@/views/productsMsg/components/health.vue"), + meta: { title: "医疗器械档案", icon: "netWork" }, + }, ] }, - // { - // path: '', - // component: () => import("@/views/index"), - // redirect: "/administrative", - // isDiy: true, - // children: [ - // { - // path: "/administrative", - // name: "行政审批", - // icon: require("@/assets/images/tree4.svg"), - // component: () => import("@/views/administrative/index"), - // meta: { title: "行政审批", icon: "netWork" }, - // }, - // ] - // }, - // { - // path: '/A', - // component: () => import("@/views/index"), - // redirect: "enterpriseMsg", - // isDiy: true, - // children: [ - // { - // path: 'enterpriseMsg', - // name: "企业档案", - // icon: require("@/assets/images/tree4.svg"), - // component: () => import("@/views/enterpriseMsg/index"), - // meta: { title: "企业档案", icon: "netWork" }, - // }, - // ] - // }, - // { - // path: '/B', - // component: () => import("@/views/index"), - // redirect: "logout", - // isDiy: true, - // children: [ - // { - // path: "logout", - // name: "依法注销", - // icon: require("@/assets/images/tree4.svg"), - // component: () => import("@/views/logout/index"), - // meta: { title: "依法注销", icon: "netWork" }, - // }, - // ] - // }, - // { - // path: '/productsMsg', - // component: () => import("@/views/index"), - // redirect: "drugArchives", - // isDiy: true, - // children: [ - // { - // path: "drugArchives", - // name: "药品档案", - // icon: require("@/assets/images/tree4.svg"), - // component: () => import("@/views/productsMsg/components/drugArchives.vue"), - // meta: { title: "药品档案", icon: "netWork" }, - // }, - // { - // path: "cosmeticsArchives", - // name: "化妆品档案", - // icon: require("@/assets/images/tree4.svg"), - // component: () => import("@/views/productsMsg/components/cosmeticsArchives.vue"), - // meta: { title: "化妆品档案", icon: "netWork" }, - // }, - // { - // path: "health", - // name: "医疗器械档案", - // icon: require("@/assets/images/tree4.svg"), - // component: () => import("@/views/productsMsg/components/health.vue"), - // meta: { title: "医疗器械档案", icon: "netWork" }, - // }, - // ] - // }, //可以按着若依的思路来写,把菜单全部都设置成一级路由,然后有下拉选择框的去进行区别判断设置成二级子路由 ]; diff --git a/src/views/index.vue b/src/views/index.vue index 0ff23c2..bc8e791 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -88,7 +88,7 @@ export default { meta: { title: "行政审批", icon: "netWork" }, }, { - path: "/enterpriseMsg", + path: "/A/enterpriseMsg", name: "企业档案", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/enterpriseMsg/index"), @@ -101,35 +101,35 @@ export default { component: () => import("@/views/index"), redirect: "drugArchives", isDiy: true, - // children: [ - // { - // path: "/productsMsg/drugArchives", - // name: "药品档案", - // icon: require("@/assets/images/tree4.svg"), - // component: () => - // import("@/views/productsMsg/components/drugArchives.vue"), - // meta: { title: "药品档案", icon: "netWork" }, - // }, - // { - // path: "/productsMsg/cosmeticsArchives", - // name: "化妆品档案", - // icon: require("@/assets/images/tree4.svg"), - // component: () => - // import("@/views/productsMsg/components/cosmeticsArchives.vue"), - // meta: { title: "化妆品档案", icon: "netWork" }, - // }, - // { - // path: "/productsMsg/health", - // name: "医疗器械档案", - // icon: require("@/assets/images/tree4.svg"), - // component: () => - // import("@/views/productsMsg/components/health.vue"), - // meta: { title: "医疗器械档案", icon: "netWork" }, - // }, - // ], + children: [ + { + path: "/productsMsg/drugArchives", + name: "药品档案", + icon: require("@/assets/images/tree4.svg"), + component: () => + import("@/views/productsMsg/components/drugArchives.vue"), + meta: { title: "药品档案", icon: "netWork" }, + }, + { + path: "/productsMsg/cosmeticsArchives", + name: "化妆品档案", + icon: require("@/assets/images/tree4.svg"), + component: () => + import("@/views/productsMsg/components/cosmeticsArchives.vue"), + meta: { title: "化妆品档案", icon: "netWork" }, + }, + { + path: "/productsMsg/health", + name: "医疗器械档案", + icon: require("@/assets/images/tree4.svg"), + component: () => + import("@/views/productsMsg/components/health.vue"), + meta: { title: "医疗器械档案", icon: "netWork" }, + }, + ], }, { - path: "/logout", + path: "/B/logout", name: "依法注销", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/logout/index"),