Bladeren bron

医院自主查询 keepalive

yuwandanmian 2 jaren geleden
bovenliggende
commit
4488742955

+ 0 - 1
src/App.vue

@@ -48,7 +48,6 @@ export default {
           this.lastTime = new Date().getTime();
         }
       }
-      console.log(this.currentTime - this.lastTime, this.timeOut)
     },
   },
 };

+ 1 - 1
src/menu/menu.js

@@ -83,7 +83,7 @@ export default {
       router.addRoutes(data)
       // 将路由元注入路由对象,必须添加
       router.options.routes.push(data)
-      // console.log(data)
+      console.log('router.options.routes', router.options.routes)
       //输出成功
       resolve()
     })

+ 32 - 23
src/router/index.js

@@ -7,6 +7,7 @@ Vue.use(Router);
 
 /* Layout */
 import Layout from '@/layout';
+import AppMain from '@/layout/components/AppMain.vue';
 
 /**
  * Note: sub-menu only appear when route children.length >= 1
@@ -194,30 +195,38 @@ export const constantRoutes = [
     ],
   },
   // 医院大数据自助查询系统
+  
   {
-    path: '/hospital-search',
-    name: 'HospitalSearch',
-    component: () => import('@/views/searchSystem/index'),
-    meta: { keepAlive:true },
-    hidden: true
-  },
-  {
-    path: '/hospital-caseViews',
-    name: 'HospitalCaseViews',
-    component: () => import('@/views/allcase/caseViews'),
-    hidden: true
-  },
-  {
-    path: '/hospital-details',
-    name: 'HospitalDetails',
-    component: () => import('@/views/data/query/details'),
-    hidden: true
-  },
-  {
-    path: '/hospital-chargeDetails',
-    name: 'HospitalChargeDetails',
-    hidden: true,
-    component: () => import('@/views/data/query/ChargeDetails')
+    path: '/hospital',
+    component: AppMain,
+    redirect: '/hospital-search',
+    children: [
+      {
+        path: '/hospital-search',
+        name: 'HospitalSearch',
+        component: () => import('@/views/searchSystem/index'),
+        meta: { keepAlive:true },
+        hidden: true
+      },
+      {
+        path: '/hospital-caseViews',
+        name: 'HospitalCaseViews',
+        component: () => import('@/views/allcase/caseViews'),
+        hidden: true
+      },
+      {
+        path: '/hospital-details',
+        name: 'HospitalDetails',
+        component: () => import('@/views/data/query/details'),
+        hidden: true
+      },
+      {
+        path: '/hospital-chargeDetails',
+        name: 'HospitalChargeDetails',
+        hidden: true,
+        component: () => import('@/views/data/query/ChargeDetails')
+      },
+    ]
   },
 ];
 

+ 2 - 2
src/views/login/index.vue

@@ -108,7 +108,7 @@ export default {
                 const routes = JSON.parse(sessionStorage.getItem('route'))
                 let bSwitch = 0
                 for(let i=0; i<routes.length; i++) {
-                  if(routes[i].path === '/hospital-search') {
+                  if(routes[i].path === '/hospital') {
                     bSwitch = 1
                     break
                   } else {
@@ -116,7 +116,7 @@ export default {
                   }
                 }
                 if (bSwitch) {
-                  this.$router.push({ path: '/hospital-search'});
+                  this.$router.push({ path: '/hospital'});
                 } else {
                   this.$router.push(this.redirect || '/');
                 }

+ 0 - 1
src/views/searchSystem/components/BLSearch.vue

@@ -411,7 +411,6 @@ import mPagination from "@/components/m-pagination";
 import { bassNormalSearchDownload, bassHighSearchDownload } from '@/api/excel'
 
 export default {
-  name: "Dashboard",
   components: {
     Title,
     mPagination,

+ 5 - 4
src/views/searchSystem/index.vue

@@ -3,13 +3,13 @@
     <div class="box_wrapper">
       <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
         <el-tab-pane label="病历搜索" name="0">
-          <BLSearchVue />
+          <BLSearchVue v-if="activeName ==0" />
         </el-tab-pane>
         <el-tab-pane label="病案首页搜索" name="1">
-          <CaseHomeSearchVue />
+          <CaseHomeSearchVue v-if="activeName ==1" />
         </el-tab-pane>
         <el-tab-pane label="医嘱搜索" name="2">
-          <DoctorOrderSearchVue />
+          <DoctorOrderSearchVue v-if="activeName ==2" />
         </el-tab-pane>
       </el-tabs>
       <el-button class="layout-btn" @click="onLayout">
@@ -37,7 +37,8 @@ export default {
   },
   methods: {
     handleClick(tab, event) {
-      console.log(tab, event);
+      console.log(tab.name);
+      this.activeName = tab.name
     },
     onLayout() {
       setToken('');