charles
2024-04-29 61ee015a91fdf32e271c2c86c7257fb3776d8c69
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<template>
  <div class="left-nav">
    <h1>
      <img
        class="icon"
        :src="`${publicPath}images/audio/railroad.png`"
        style="height: 30px"
      />
      <span v-show="!isCollapse" style="display:inline-block;width:180px;padding-left: 6px">语音智能分析应用</span>
    </h1>
    <div class="menu-btn" v-show="!isCollapse">
      <div :class="{item:true,'is-active':$route.path==='/home/audioAnalysis'}"  @click="$router.push('/home/audioAnalysis',()=>{})">音频分析检索</div>
      <div :class="{item:true,'is-active':$route.path==='/home/textManager'}" @click="$router.push('/home/textManager',()=>{})">文字库管理</div>
    </div>
  </div>
</template>
 
<script>
export default {
  props: {
    isCollapse: {
      type: Boolean,
      default: true,
    }
  },
  computed: {
    isAdmin() {
      if (
        sessionStorage.getItem("userInfo") &&
        sessionStorage.getItem("userInfo") !== ""
      ) {
        let loginName = JSON.parse(sessionStorage.getItem("userInfo")).username;
        return loginName === "admin" || loginName === "basic";
      }
      return false;
    },
  },
  data() {
    return {
      publicPath: process.env.BASE_URL,
      activeIndex: "guideIndex",
    };
  },
  mounted() {
    this.activeIndex = this.isAdmin ? "guideIndex" : "searchForVideoAnalyze";
    this.$emit("menuChange", this.activeIndex);
  },
  methods: {
    handleSelect(index, indePath) {
      this.activeIndex = index;
      sessionStorage.setItem("leftNavAct", this.activeIndex);
      this.$emit("menuChange", index);
    },
    handleOpen() {},
    handleClose() {},
  },
};
</script>
 
<style scoped lang="scss">
.left-nav {
  background: #fff;
  height: 100vh;
  h1 {
    display: flex;
    align-items: center;
    height: 65px;
    padding: 0 20px;
    font-size: 20px;
    border-bottom: 1px solid #eee;
    color: rgb(0, 150, 250);
  }
  .iconfont {
    padding-right: 10px;
  }
  .menu-btn{
    .item{
      width: 90%;
      margin: 0px auto;
      text-align: center;
      line-height: 40px;
      background-color: rgba(241, 241, 241, 1);
      border-radius: 20px;
      margin-top: 30px;
      font-family: 'PingFangSC-Regular', 'PingFang SC';
      font-weight: 400;
      font-style: normal;
      font-size: 16px;
      color: rgba(0, 0, 0, 0.647058823529412);
      &:hover{
        cursor: pointer;
      }
    }
    .is-active{
      background-color: deepskyblue;
      color: white;
    }
  }
}
</style>