蒋科 2 mesi fa
parent
commit
7d301673fb

+ 5 - 2
src/layout/components/AppMain.vue

@@ -2,9 +2,12 @@
   <section class="app-main">
     <transition name="fade-transform" mode="out-in">
       <keep-alive>
-        <router-view :key="key" />
+        <router-view v-if="$route.meta.keepAlive" :key="key" />
       </keep-alive>
     </transition>
+    <transition name="fade-transform" mode="out-in">
+      <router-view v-if="!$route.meta.keepAlive" :key="key" />
+    </transition>
   </section>
 </template>
 
@@ -26,7 +29,7 @@ export default {
 
 <style lang="scss" scoped>
 .hasheaderView{
-  
+
   .app-main {
     /* 84 = navbar + tags-view = 50 + 34 */
     min-height: 100%;

+ 6 - 6
src/router/index.js

@@ -46,37 +46,37 @@ export const constantRoutes = [
         path: '/',
         component: () => import('@/views/equipment-monitoring/index'),
         name: 'EquipmentMonitoring',
-        meta: { title: '设备监控'}
+        meta: { title: '设备监控',keepAlive:false}
       },
       {
         path: '/manage-log/robot',
         component: () => import('@/views/manage-log/robot'),
         name: 'Robot',
-        meta: { title: '机器人日志' }
+        meta: { title: '机器人日志',keepAlive:true }
       },
       {
         path: '/manage-log/battery-charger',
         component: () => import('@/views/manage-log/battery-charger'),
         name: 'BatteryCharger',
-        meta: { title: '充电机日志' }
+        meta: { title: '充电机日志',keepAlive:true }
       },
       {
         path: '/manage-log/order-charger',
         component: () => import('@/views/manage-log/order-charger'),
         name: 'OrderCharger',
-        meta: { title: '订单日志' }
+        meta: { title: '订单日志',keepAlive:true  }
       },
       {
         path: '/manage-log/bms',
         component: () => import('@/views/manage-log/bms'),
         name: 'Bms',
-        meta: { title: 'BMS日志' }
+        meta: { title: 'BMS日志',keepAlive:true  }
       },
       {
         path: '/manage-log/data-export',
         component: () => import('@/views/manage-log/data-export'),
         name: 'DataExport',
-        meta: { title: '数据导出' }
+        meta: { title: '数据导出',keepAlive:false }
       },
     ]
   },

+ 0 - 2
src/views/manage-log/data-export.vue

@@ -202,8 +202,6 @@ export default {
   destroyed() {
     //清除定时器
     this.clearListTimer();
-    console.log('232323');
-
   },
   methods: {
     //定时请求导出列表

+ 2 - 2
src/views/manage-log/robot.vue

@@ -350,13 +350,13 @@ export default {
           let differenceABSet = Array.from(
             new Set(
               [...this.logOptions].filter((x) =>
-                this.robotValue.includes(x.alarmCode)
+                this.robotValue.includes(x.logCode)
               )
             )
           );
           const curArray=[...differenceABSet]
           curArray.map(item=>{
-            addParams.signals.push(item.alarmCode)
+            addParams.signals.push(item.logCode)
           })
           exportFile(addParams).then((res) => {
             if (res.code === 0) {