asd123a20 %!s(int64=4) %!d(string=hai) anos
pai
achega
007f17e7b7
Modificáronse 3 ficheiros con 14 adicións e 7 borrados
  1. 4 3
      src/views/advancedConfig.vue
  2. 7 1
      src/views/home.vue
  3. 3 3
      src/views/network/wan.vue

+ 4 - 3
src/views/advancedConfig.vue

@@ -9,7 +9,7 @@
           <template slot="title">
             <span>{{ item.name }}</span>
           </template>
-          <el-menu-item @click="handleOpen(i)" v-for="(i, x) in item.children" :index="`${index}-${x}`" :key="x">{{ i.name }}</el-menu-item>
+          <el-menu-item @click="handleOpen(i, `${index}-${x}`)" v-for="(i, x) in item.children" :index="`${index}-${x}`" :key="x">{{ i.name }}</el-menu-item>
         </el-submenu>
       </el-menu>
       <router-view class="view" />
@@ -29,10 +29,11 @@ export default {
     }
   },
   mounted () {
-    // this.$router.push('advancedConfig/wan')
+    this.defaultActive = sessionStorage.getItem('menu') || '0-0'
   },
   methods: {
-    handleOpen (e) {
+    handleOpen (e, i) {
+      sessionStorage.setItem('menu', i)
       this.$router.push(`${e.path}`)
     }
   }

+ 7 - 1
src/views/home.vue

@@ -24,13 +24,19 @@ export default {
       activeIndex: '1'
     }
   },
-  mounted () {},
+  mounted () {
+    this.activeIndex = sessionStorage.getItem('tab') || '1'
+  },
   methods: {
     handleSelect (key, keyPath) {
       if (key === '1' && this.$route.path !== '/devinfo') {
+        // sessionStorage.removeItem('tab')
+        sessionStorage.setItem('tab', '1')
         this.$router.push({ path: '/devinfo' })
       }
       if (key === '2' && this.$route.path !== '/advancedConfig') {
+        // sessionStorage.removeItem('tab')
+        sessionStorage.setItem('tab', '2')
         this.$router.push({ path: '/advancedConfig' })
       }
     }

+ 3 - 3
src/views/network/wan.vue

@@ -87,10 +87,10 @@ export default {
       }
     },
     // 重启网卡  (先调用停止,在调用启动)
-    reboot () {
-      const dw = this.wandown()
+    async reboot () {
+      const dw = await this.wandown()
       if (dw.errcode === 0) {
-        const up = this.wanup()
+        const up = await this.wanup()
         if (up.errcode === 0) {
           this.$message.success('重启成功')
         }