diff --git a/.env.development b/.env.development index c737ca5..22bf9ae 100644 --- a/.env.development +++ b/.env.development @@ -5,6 +5,7 @@ VUE_APP_TITLE = 产品档案管理系统 ENV = 'development' # 开发环境 VUE_APP_BASE_API = '/configApi' +VUE_APP_BASE_API2 = '/api' VUE_APP_PREFIX ='' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/App.vue b/src/App.vue index 615b10c..ecb4b46 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,12 +26,11 @@ export default { mounted(){ setTimeout(async () => { let Authentication = await this.$api.toLogin.frimLogin(); - console.log(Authentication); localStorage.setItem( - "Authentication", + "MSSM-LIAONING__TOKEN", Authentication.data.result.userToken ); - }, 1000); + }, 10); } }; diff --git a/src/api/apparatus/index.js b/src/api/apparatus/index.js new file mode 100644 index 0000000..b4e23d9 --- /dev/null +++ b/src/api/apparatus/index.js @@ -0,0 +1,18 @@ +import request from "@/utils/request2"; +export default { + //分页条件查询器械品种 + apparatusList(query) { + return request({ + url: "/pharmaceuticals/ylqxJnyelcp", + method: "GET", + params: query, + }); + }, + //通过注册证编号查询单条器械品种数据 + // apparatusGet(zczh) { + // return request({ + // url: `/pharmaceuticals/ylqxJnyelcp/${zczh}`, + // method: "GET", + // }); + // }, +} diff --git a/src/api/external/index.js b/src/api/external/index.js index d68658c..6e7df23 100644 --- a/src/api/external/index.js +++ b/src/api/external/index.js @@ -3,16 +3,8 @@ import request from "@/utils/request"; //获取用户信息 export function getselfInfo() { return request({ - url: "/user/getSelfInfo", + url: "/api/admin/user/getSelfInfo", method: "GET", }); } -//修改密码 -export function changePass(query) { - return request({ - url: "/SystemManager/UserManager/modify/password", - method: "GET", - params: query, - }); -} diff --git a/src/api/index.js b/src/api/index.js index 541b2bc..859d435 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,8 @@ import toLogin from "./archives/toLogin"; import cosmetics from "./archives/cosmetics"; +import apparatus from "./apparatus"; export default { toLogin, - cosmetics + cosmetics, + apparatus }; \ No newline at end of file diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index c90b268..daece87 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -40,30 +40,6 @@ - @@ -204,10 +180,8 @@ export default { }); }, refreshSelectedTag(view) { - this.$tab.refreshPage(view); - if (this.$route.meta.link) { - this.$store.dispatch("tagsView/delIframeView", this.$route); - } + let obj = {path:view.path,name:view.name} + this.$tab.refreshPage(obj); }, closeSelectedTag(view) { this.$tab.closePage(view).then(({ visitedViews }) => { @@ -280,6 +254,7 @@ export default { this.visible = false; }, handleScroll() { + console.log(111); this.closeMenu(); }, }, diff --git a/src/permission.js b/src/permission.js index fa52238..7a1a655 100644 --- a/src/permission.js +++ b/src/permission.js @@ -12,69 +12,49 @@ function kickOut() { } } NProgress.configure({ showSpinner: false }); -const whiteList = [ - // "/login", - // "/register", - "/index", +const routerSList = [ '/drugArchives', '/cosmeticsArchives', '/health', - '/productInfo', - '/cosmeticsDetail' ]; 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") { - next({ path: "/" }); - NProgress.done(); + let token = localStorage.getItem('MSSM-LIAONING__TOKEN') + if (token) { + if(to.path == '/cosmeticsDetail' && routerSList.indexOf(from.path) == -1){ + next({ path: '/' }) + }else { + next() + } + 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 { - next(); + store + .dispatch("GetPermission") + .then((res) => { + console.log(res); + if (res.length > 0) { + next(); + } else { + kickOut(); + } + }) + .catch((error) => { + kickOut(); + }); } } else { - next() // 没有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 { - // 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(); - // } + Message.error("获取令牌失败!"); + kickOut(); + NProgress.done(); } }); diff --git a/src/plugins/tab.js b/src/plugins/tab.js index 6106b94..ad85d45 100644 --- a/src/plugins/tab.js +++ b/src/plugins/tab.js @@ -4,16 +4,18 @@ import router from "@/router"; export default { // 刷新当前tab页签 refreshPage(obj) { + console.log(obj); + console.log( router.currentRoute); const { path, query, matched } = router.currentRoute; - if (obj === undefined) { - matched.forEach((m) => { - if (m.components && m.components.default && m.components.default.name) { - if (!["Layout", "ParentView"].includes(m.components.default.name)) { - obj = { name: m.components.default.name, path: path, query: query }; - } - } - }); - } + // if (obj === undefined) { + // matched.forEach((m) => { + // if (m.components && m.components.default && m.components.default.name) { + // if (!["Layout", "ParentView"].includes(m.components.default.name)) { + // obj = { name: m.components.default.name, path: path, query: query }; + // } + // } + // }); + // } return store.dispatch("tagsView/delCachedView", obj).then(() => { const { path, query } = obj; diff --git a/src/router/index.js b/src/router/index.js index 46e4a80..e84a183 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -30,27 +30,27 @@ import Layout from "@/layout"; // 公共路由 export const constantRoutes = [ - { - path: "/redirect", - component: Layout, - hidden: true, - children: [ - { - path: "/redirect/:path(.*)", - component: () => import("@/views/redirect"), - }, - ], - }, - { - path: "/login", - component: () => import("@/views/login"), - hidden: true, - }, - { - path: "/register", - component: () => import("@/views/register"), - hidden: true, - }, + // { + // path: "/redirect", + // component: Layout, + // hidden: true, + // children: [ + // { + // path: "/redirect/:path(.*)", + // component: () => import("@/views/redirect"), + // }, + // ], + // }, + // { + // path: "/login", + // component: () => import("@/views/login"), + // hidden: true, + // }, + // { + // path: "/register", + // component: () => import("@/views/register"), + // hidden: true, + // }, { path: "/404", component: () => import("@/views/error/404"), @@ -61,8 +61,6 @@ export const constantRoutes = [ component: () => import("@/views/error/401"), hidden: true, }, - - { path: '', component: () => import("@/views/index"), @@ -71,37 +69,32 @@ export const constantRoutes = [ children: [ { path: "/drugArchives", - name: "药品档案", + name: "drugArchives", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/productsMsg/index.vue"), - meta: { title: "药品档案", icon: "netWork" }, + isDiy:true, + meta: { title: "药品档案", }, }, { path: "/cosmeticsArchives", - name: "化妆品档案", + name: "cosmeticsArchives", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/productsMsg/components/cosmeticsArchives.vue"), - meta: { title: "化妆品档案", icon: "netWork" }, + meta: { title: "化妆品档案", flag: true }, }, { path: "/cosmeticsDetail", - name: "化妆品详情", + name: "cosmeticsDetail", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/cosmeticsFile/detail.vue"), - meta: { title: "化妆品详情", icon: "netWork" }, + meta: { title: "详情", }, }, { path: "/health", - name: "医疗器械档案", + name: "health", icon: require("@/assets/images/tree4.svg"), component: () => import("@/views/productsMsg/components/health.vue"), - meta: { title: "医疗器械档案", icon: "netWork" }, - }, - { - path: "/productInfo", - name: "productInfo", - component:() => import("@/views/productsMsg/components/productInfo.vue"), - meta: { title: "产品档案", icon: "netWork" }, + meta: { title: "医疗器械档案", }, }, ] }, diff --git a/src/store/modules/myselfPermission.js b/src/store/modules/myselfPermission.js index affae83..eb91212 100644 --- a/src/store/modules/myselfPermission.js +++ b/src/store/modules/myselfPermission.js @@ -14,17 +14,21 @@ const selfPermission = { }, mutations: { + //动态按钮权限 SET_PERMISSIONLIST: (state, permissions) => { permissions.forEach((item) => { state.permissionList.push(item.menuPerms); }); }, + //动态路由 SET_ROUTER: (state, router) => { state.routerList = router; }, + //用户信息 SET_USERDATA: (state, data) => { state.userData = data; }, + //某个id SET_INSPECTORID: (state, id) => { state.inspectorId = id; }, @@ -35,30 +39,32 @@ const selfPermission = { return new Promise((resolve, reject) => { getselfInfo() .then((res) => { + console.log(res); let infoData = res.result; - - let query = { - id: infoData.userDto.cardId, - }; - getcarid(query).then((res) => { - commit( - "SET_INSPECTORID", - res.result.length > 0 ? res.result[0].id : null - ); - }); + // let query = { + // id: infoData.userDto.cardId, + // }; + // getcarid(query).then((res) => { + // commit( + // "SET_INSPECTORID", + // res.result.length > 0 ? res.result[0].id : null + // ); + // }); //存储用户信息 commit("SET_USERDATA", infoData.userDto); //过滤出按钮权限字符 - let menuButton = infoData.menuButton.filter( - (item) => item.appCode == "JCYGL" - ); - commit("SET_PERMISSIONLIST", menuButton); + // let menuButton = infoData.menuButton.filter( + // (item) => item.appCode == "JCYGL" + // ); + // commit("SET_PERMISSIONLIST", menuButton); //过滤菜单 let menuTree = infoData.menuTree.filter( - (item) => item.appCode == "JCYGL" + (item) => item.appCode == "CPGL" ); + console.log(menuTree); let fileTreeOut = filterTree(menuTree[0].childMenuList, []); + console.log(fileTreeOut); commit("SET_ROUTER", fileTreeOut); resolve(fileTreeOut.length > 0 ? fileTreeOut[0].path : []); diff --git a/src/store/modules/tagsView.js b/src/store/modules/tagsView.js index b4e4e55..3e0b44d 100644 --- a/src/store/modules/tagsView.js +++ b/src/store/modules/tagsView.js @@ -6,6 +6,9 @@ const state = { const mutations = { ADD_IFRAME_VIEW: (state, view) => { + // console.log(111); + // console.log(state); + // console.log(view); if (state.iframeViews.some((v) => v.path === view.path)) return; state.iframeViews.push( Object.assign({}, view, { @@ -14,6 +17,9 @@ const mutations = { ); }, ADD_VISITED_VIEW: (state, view) => { + // console.log(222); + // console.log(state); + // console.log(view); if (state.visitedViews.some((v) => v.path === view.path)) return; state.visitedViews.push( Object.assign({}, view, { @@ -22,12 +28,18 @@ const mutations = { ); }, ADD_CACHED_VIEW: (state, view) => { + // console.log(333); + // console.log(state); + // console.log(view); if (state.cachedViews.includes(view.name)) return; if (view.meta && !view.meta.noCache) { state.cachedViews.push(view.name); } }, DEL_VISITED_VIEW: (state, view) => { + // console.log(444); + // console.log(state); + // console.log(view); for (const [i, v] of state.visitedViews.entries()) { if (v.path === view.path) { state.visitedViews.splice(i, 1); @@ -39,16 +51,23 @@ const mutations = { ); }, DEL_IFRAME_VIEW: (state, view) => { + // console.log(555); + // console.log(state,view); state.iframeViews = state.iframeViews.filter( (item) => item.path !== view.path ); }, DEL_CACHED_VIEW: (state, view) => { + console.log(666); + console.log(state); + console.log(view); const index = state.cachedViews.indexOf(view.name); index > -1 && state.cachedViews.splice(index, 1); }, DEL_OTHERS_VISITED_VIEWS: (state, view) => { + // console.log(777); + // console.log(state,view); state.visitedViews = state.visitedViews.filter((v) => { return v.meta.affix || v.path === view.path; }); @@ -57,6 +76,8 @@ const mutations = { ); }, DEL_OTHERS_CACHED_VIEWS: (state, view) => { + // console.log(888); + // console.log(state,view); const index = state.cachedViews.indexOf(view.name); if (index > -1) { state.cachedViews = state.cachedViews.slice(index, index + 1); @@ -66,12 +87,16 @@ const mutations = { }, DEL_ALL_VISITED_VIEWS: (state) => { // keep affix tags + // console.log(999); + // console.log(state); const affixTags = state.visitedViews.filter((tag) => tag.meta.affix); state.visitedViews = affixTags; state.iframeViews = []; }, DEL_ALL_CACHED_VIEWS: (state) => { state.cachedViews = []; + // console.log(101010); + // console.log(state); }, UPDATE_VISITED_VIEW: (state, view) => { for (let v of state.visitedViews) { diff --git a/src/utils/request.js b/src/utils/request.js index 43e773b..e467a77 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -15,7 +15,7 @@ axios.defaults.headers["Content-Type"] = "application/json;charset=utf-8"; // 创建axios实例 const service = axios.create({ // axios中请求配置有baseURL选项,表示请求URL公共部分 - baseURL: location.origin + process.env.VUE_APP_BASE_API, + baseURL: location.origin + process.env.VUE_APP_BASE_API2, // 超时 timeout: 15000, }); diff --git a/src/utils/request2.js b/src/utils/request2.js index 76979a0..c905591 100644 --- a/src/utils/request2.js +++ b/src/utils/request2.js @@ -29,7 +29,7 @@ service.interceptors.request.use( const isRepeatSubmit = (config.headers || {}).repeatSubmit === false; if (!isToken) { config.headers["Authentication"] = localStorage.getItem( - "Authentication" + "MSSM-LIAONING__TOKEN" ); } // get请求映射params参数 diff --git a/src/views/cosmeticsFile/detail.vue b/src/views/cosmeticsFile/detail.vue index 7fb4a81..7bc3b43 100644 --- a/src/views/cosmeticsFile/detail.vue +++ b/src/views/cosmeticsFile/detail.vue @@ -1,6 +1,6 @@ - - diff --git a/src/views/productsMsg/components/cosmeticsArchives.vue b/src/views/productsMsg/components/cosmeticsArchives.vue index a862733..3151570 100644 --- a/src/views/productsMsg/components/cosmeticsArchives.vue +++ b/src/views/productsMsg/components/cosmeticsArchives.vue @@ -4,44 +4,42 @@
查询条件
- +
- + + + + + + + +
- - - - - - - -
重置 @@ -161,7 +159,8 @@ export default { methods: { //去内嵌页面 toDetail(e) { - console.log(e); + // console.log(e); + this.$router.push(`/cosmeticsDetail`) }, //搜索 searchList() { @@ -242,8 +241,8 @@ export default { } }, async changeType(e) { - this.reset() - this.getData(e) + this.reset(); + this.getData(e); }, }, }; @@ -281,7 +280,7 @@ export default { } .tabs { width: 100%; - height: 30%; + height: 25%; background: #fff; } } @@ -294,7 +293,7 @@ export default { text-align: center; } .tabsBottom { - height: 70%; + height: 75%; padding-top: 10px; .foot-main { height: 100%; diff --git a/src/views/productsMsg/components/health.vue b/src/views/productsMsg/components/health.vue index aaf4e95..2ecf0ec 100644 --- a/src/views/productsMsg/components/health.vue +++ b/src/views/productsMsg/components/health.vue @@ -1,549 +1,228 @@ - - - - - \ No newline at end of file +.pagination { + display: flex; + justify-content: space-between; + padding: 15px 20px; +} + \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index e9f6f06..eb7b903 100644 --- a/vue.config.js +++ b/vue.config.js @@ -48,6 +48,13 @@ module.exports = { "^/configApi": "", }, }, + "/api": { + target: "https://dev-mssm-liaoning.imian.org.cn", + changeOrigin: true, + pathRewrite: { + ["api"]: "", + }, + }, }, disableHostCheck: true, },