From 77536cfa95b1e3c5e60f94dce3a53aa2e93f121a Mon Sep 17 00:00:00 2001
From: zhangxiaoxu123 <819527061@qq.com>
Date: 星期三, 14 九月 2022 17:35:54 +0800
Subject: [PATCH] echarts添加显示隐藏按钮

---
 src/pages/components/showIndexTitle.vue |   70 ++++++++++++++++++++++++-----------
 1 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/src/pages/components/showIndexTitle.vue b/src/pages/components/showIndexTitle.vue
index 65a74d7..20cb7fd 100644
--- a/src/pages/components/showIndexTitle.vue
+++ b/src/pages/components/showIndexTitle.vue
@@ -2,8 +2,7 @@
   <div class="showIndexTitle-wrap">
     <h1 class="title">鐭冲搴勪汉绀惧眬涓氬姟杩愯鏁版嵁鍒嗘瀽骞冲彴</h1>
     <el-menu
-      default-active="/index"
-      :class="activeStyle"
+      :default-active="activeIndex"
       router
       mode="horizontal"
       class="el-menu-demo"
@@ -12,7 +11,6 @@
         <el-menu-item index="/index">
           <div class="showIndex-block">
             <h1>棣栭〉</h1>
-
           </div>
         </el-menu-item>
         <el-menu-item index="/jiuyeAndChuangye">
@@ -42,27 +40,27 @@
         </el-menu-item>
       </div>
       <div class="showIndex-right">
-        <el-menu-item index="/businessPolicy">
+        <!--<el-menu-item index="/businessPolicy">
           <div class="showIndex-block">
             <h1>钀ュ晢鏀跨瓥</h1>
           </div>
-        </el-menu-item>
+        </el-menu-item>-->
         <el-menu-item>
-          <div class="showIndex-block">
+          <div class="showIndex-block" @click="gotoTXL">
             <h1>閫氳褰�</h1>
           </div>
         </el-menu-item>
-        <el-menu-item>
-          <div class="showIndex-block">
+        <!--<el-menu-item>
+          <div class="showIndex-block" @click="gotoGZZB">
             <h1>宸ヤ綔鍛ㄦ姤</h1>
           </div>
-        </el-menu-item>
+        </el-menu-item>-->
         <el-menu-item>
-          <div class="showIndex-block">
+          <div class="showIndex-block" @click="gotoWDZX">
             <h1>鏂囨。涓績</h1>
           </div>
         </el-menu-item>
-        <el-menu-item index="/login">
+        <el-menu-item @click="goOut">
           <div class="showIndex-block">
             <h1>閫�鍑虹櫥褰�</h1>
           </div>
@@ -75,21 +73,49 @@
 <script>
 export default {
   name: "showIndexTitle",
-  watch: {
-    '$route' (toRouter, fromRouter) {
-        console.log(toRouter,'toRouter')
-        console.log(fromRouter,'fromRouter')
-        console.log('$route.path---',this.$route)
+  data() {
+    return {
+        activeIndex: '/index'
     }
   },
-    data() {
-      return {
-          activeStyle: false
-      }
-    },
+  mounted() {
+      this.$route.meta.routerParent && (this.activeIndex = '/' + this.$route.meta.routerParent)
+      window.passToken = this.passToken
+      window.passToken2 = this.passToken2
+      window.passToken3 = this.passToken3
+  },
   methods: {
+      passToken() {
+          return this.$store.state.user.token
+      },
+      passToken2() {
+          return this.$store.state.user.token
+      },
+      passToken3() {
+          return this.$store.state.user.token
+      },
+      goOut() {
+          this.$confirm('鏄惁閫�鍑虹郴缁�, 鏄惁缁х画?', '鎻愮ず', {
+              confirmButtonText: '纭畾',
+              cancelButtonText: '鍙栨秷',
+              type: 'warning'
+          }).then(() => {
+              this.$store.dispatch('logout').then(res => {
+                  this.$router.push('/login')
+              })
+          })
 
-  }
+      },
+      gotoTXL() {
+          window.android.passToken(this.$store.state.user.token)
+      },
+      gotoGZZB() {  //璺宠浆宸ヤ綔鍛ㄦ姤
+          window.android.passToken2(this.$store.state.user.token)
+      },
+      gotoWDZX() {  //鏂囨。涓績
+          window.android.passToken3(this.$store.state.user.token)
+      }
+  },
 };
 </script>
 

--
Gitblit v1.9.1