zhangxiaoxu123
2022-09-13 08b5ddfa9a0a2ed52bd7d7b98ca16ef4dcc610a6
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"
@@ -41,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>
@@ -74,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>