From 0381821f8e724540066159cfd8253966c39c2ac8 Mon Sep 17 00:00:00 2001 From: dhy1725534722 <1725534722@qq.com> Date: Tue, 1 Aug 2023 09:49:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 127 ++++--- src/views/{netWorkStat => drugFile}/index.vue | 74 +++- src/views/index.vue | 56 +-- src/views/productsMsg/index.vue | 333 +++++++++++++++++- 4 files changed, 513 insertions(+), 77 deletions(-) rename src/views/{netWorkStat => drugFile}/index.vue (59%) diff --git a/src/router/index.js b/src/router/index.js index 6098fd8..171a7dd 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -61,6 +61,7 @@ export const constantRoutes = [ component: () => import("@/views/error/401"), hidden: true, }, + { path: '', component: () => import("@/views/index"), @@ -74,67 +75,103 @@ 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: "drugArchives", - name: "药品档案", + path: '/productsMsg', + 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" }, - }, + component: () => import("@/views/productsMsg/index"), + 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/netWorkStat/index.vue b/src/views/drugFile/index.vue similarity index 59% rename from src/views/netWorkStat/index.vue rename to src/views/drugFile/index.vue index ebe8348..bcb0ba2 100644 --- a/src/views/netWorkStat/index.vue +++ b/src/views/drugFile/index.vue @@ -1,6 +1,21 @@ @@ -86,6 +101,7 @@ export default { display: flex; align-items: center; background: #f2f2f2; + padding: 10px; & > div { flex: 1; height: 100%; @@ -119,5 +135,59 @@ export default { .main { height: calc(100% - 40px); } + .right-content { + background-color: #fff; + .name-content { + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px; + border-bottom: 1px solid #F2F3F5; + .drug-name { + display: flex; + align-items: center; + font-size: 18px; + font-family: Source Han Sans SC-Bold, Source Han Sans SC; + font-weight: bold; + color: #323233; + .name { + + } + .tag { + color: #1349C5; + margin-left: 4px; + } + .info-Tag { + // margin-top: vh(9); + margin-left: 12px; + display: flex; + align-items: center; + font-size: 12px; + font-family: Source Han Sans CN; + font-weight: 400; + div { + padding: 4px 11px; + margin-right: 10px; + background: #DDEBFA; + border-radius: 4px; + color: #1E80EB; + &:last-child { + margin-right: 0; + background: #FDEBEB; + border-radius: 4px; + color: #E42424; + } + } + + } + } + .close-icon { + cursor: pointer; + i { + font-size: 25px; + } + } + } + } } diff --git a/src/views/index.vue b/src/views/index.vue index d7da493..d739866 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -88,7 +88,7 @@ export default { meta: { title: "行政审批", icon: "netWork" }, }, { - path: "/A/enterpriseMsg", + path: "/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: "/B/logout", + path: "/logout", name: "依法注销", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/logout/index"), diff --git a/src/views/productsMsg/index.vue b/src/views/productsMsg/index.vue index 5b0c7a5..6e3983c 100644 --- a/src/views/productsMsg/index.vue +++ b/src/views/productsMsg/index.vue @@ -1,3 +1,332 @@ \ No newline at end of file +
+
+
+ + +
+
+ 全文检索: +
+ +
+
+
+ 企业名称: +
+ +
+
+
+ 批准文号: +
+ +
+
+
+ 处方内容: +
+ +
+
+
+ 功能主治: +
+ +
+
+
+ 产品名称: +
+ +
+
+
+
+ 批号有效期: +
+
+
+ + + +
+ +
~
+
+ + + +
+
+
+
+ 产品标签: +
+ + + + + + +
+
+
+ 产品筛选: +
+ + + + + + +
+
+
+
+
+
+ +
+
+ + + + + + \ No newline at end of file From 8661a7e3de4455260dbd23ca60f9755359c272a2 Mon Sep 17 00:00:00 2001 From: dhy1725534722 <1725534722@qq.com> Date: Tue, 1 Aug 2023 10:16:17 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/permission.js | 84 +++++++------ src/views/index.vue | 284 ++++++++++++++++---------------------------- 2 files changed, 148 insertions(+), 220 deletions(-) diff --git a/src/permission.js b/src/permission.js index 52fea0a..c65d0ac 100644 --- a/src/permission.js +++ b/src/permission.js @@ -6,11 +6,11 @@ import "nprogress/nprogress.css"; import { getToken } from "@/utils/auth"; // 踢出系统 -// function kickOut() { -// if (process.env.NODE_ENV === "production") { -// location.href = location.origin + "/login"; -// } -// } +function kickOut() { + if (process.env.NODE_ENV === "production") { + location.href = location.origin + "/login"; + } +} NProgress.configure({ showSpinner: false }); const whiteList = [ "/login", @@ -21,10 +21,16 @@ const whiteList = [ "/personalData", "/changePassword", "/statistics", + + "/administrative", + "/enterpriseMsg", + "/productsMsg", + "/logout", ]; router.beforeEach((to, from, next) => { NProgress.start(); if (getToken()) { + console.log('有token'); to.meta.title && store.dispatch("settings/setTitle", to.meta.title); /* has token*/ if (to.path === "/login") { @@ -36,39 +42,39 @@ router.beforeEach((to, from, next) => { } else { // 没有token if (whiteList.indexOf(to.path) !== -1) { - // next(); - let token = localStorage.getItem("MSSM-LIAONING__TOKEN"); - if (token) { - if (store.state.myselfPermission.routerList.length > 0) { - let current = store.state.myselfPermission.routerList.filter( - (item) => item.path == to.path || from.path == "/" - ); - if (current.length > 0) { - next(); - } else { - Message.error("无权限访问!"); - } - } else { - store - .dispatch("GetPermission") - .then((res) => { - if (res.length > 0) { - next({ path: res }); - } else { - // kickOut(); - } - }) - .catch((error) => { - // kickOut(); - }); - } - } else { - // //没有token踢出去 - // Message.error("获取令牌失败!"); - // kickOut(); - next(); - - } + next() + // let token = localStorage.getItem("MSSM-LIAONING__TOKEN"); + // if (token) { + // if (store.state.myselfPermission.routerList.length > 0) { + // let current = store.state.myselfPermission.routerList.filter( + // (item) => item.path == to.path || from.path == "/" + // ); + // if (current.length > 0) { + // next(); + // } else { + // next(); + // // Message.error("无权限访问!"); + // } + // } else { + // store + // .dispatch("GetPermission") + // .then((res) => { + // console.log(res); + // if (res.length > 0) { + // next({ path: res }); + // } else { + // kickOut(); + // } + // }) + // .catch((error) => { + // kickOut(); + // }); + // } + // } else { + // //没有token踢出去 + // Message.error("获取令牌失败!"); + // kickOut(); + // } } else { // kickOut(); NProgress.done(); @@ -78,4 +84,4 @@ router.beforeEach((to, from, next) => { router.afterEach(() => { NProgress.done(); -}); +}); \ No newline at end of file diff --git a/src/views/index.vue b/src/views/index.vue index 7a84513..0ff23c2 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -2,8 +2,8 @@
- - - - +
@@ -139,20 +142,17 @@ export default { computed: { //获取自定义路由 myRouter() { + console.log(this.$router.options.routes); // let staticRouter = router.options.routes.filter( // (item) => item.isDiy == true // )[0].children; // return staticRouter; // return this.$store.state.myselfPermission.routerList; + console.log(this.$router.options.routes[6].children); return this.$router.options.routes[6].children; }, - }, - methods:{ - handleOpen(key, keyPath) { - console.log(key, keyPath); - }, - handleClose(key, keyPath) { - console.log(key, keyPath); + get1(e) { + console.log(e); }, }, created() {}, @@ -160,6 +160,28 @@ export default { + \ No newline at end of file