charles
2024-06-05 fefe4a3011fb472788abb2e7ffdbbc5a4f58623c
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<template>
  <div class="left-nav">
    <div class="left-nav-title">
      <img src="@/assets/logo2.svg" />
      <div>语音智能分析应用</div>
    </div>
    <div style="margin: 20px 0"></div>
    <div class="left-nav-body">
      <img
          class="icon"
          :src="`${publicPath}images/audio/u606.png`"
      />
      <div v-show="!isCollapse" :class="{item:true,'is-active':$route.path==='/home/uploadAudio','span-sty':true}"  @click="$router.push('/home/uploadAudio',()=>{})">音频上传</div>
    </div>
    <div class="left-nav-body">
      <img
          class="icon"
          :src="`${publicPath}images/audio/u819.png`"
      />
      <span v-show="!isCollapse" :class="{item:true,'is-active':$route.path==='/home/audioAnalysis','span-sty':true}"  @click="$router.push('/home/audioAnalysis',()=>{})">音频分析检索</span>
    </div>
    <div class="left-nav-body">
      <img
          class="icon"
          :src="`${publicPath}images/audio/u=1143771061,298321605&fm=253&fmt=auto&app=138&f=JPEG.webp`"
      />
      <span v-show="!isCollapse" :class="{item:true,'is-active':$route.path==='/home/textManager','span-sty':true}" @click="$router.push('/home/textManager',()=>{})">文字库管理</span>
    </div>
<!--    <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/uploadAudio'}"  @click="$router.push('/home/uploadAudio',()=>{})">音频上传</div>
      <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-title{
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  color: white;
  padding-top: 80px;
}
.left-nav-body{
  display: flex;
  align-items: center;
  height: 50px;
  //padding: 0 20px;
  font-size: 12px;
  padding-left: 60px;
  //border-bottom: 1px solid #eee;
  color:white;
  //border: 1px solid burlywood;
}
.left-nav-body:hover{
  background-color: rgba(255, 255, 255, 0.2);}
.icon{
  background-color: white;
  width:20px;
  height:20px;
}
.span-sty{
  display:inline-block;
  width:180px;
  padding-left: 10px;
  cursor: pointer;
}
/**/
.left-nav {
  background: #03347a;
  height: 100vh;
  //width: 280px;
  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>