shaogen1995 3 年之前
父节点
当前提交
a2c42e4862
共有 2 个文件被更改,包括 36 次插入4 次删除
  1. 35 3
      webM/src/views/Layout/index.vue
  2. 1 1
      webM/src/views/Publications/Catalogues.vue

+ 35 - 3
webM/src/views/Layout/index.vue

@@ -61,7 +61,14 @@
             v-for="(item, index) in menaData"
             :key="index"
           >
-            <span>{{ item.name }}</span>
+            <div class="oneMean">
+              {{ item.name }}
+              <van-icon
+                :name="menaSon === index ? 'arrow-down' : 'arrow'"
+                @click.stop="oneMeanChange(index,item.show)"
+              />
+              <!-- <van-icon name="arrow-down" /> -->
+            </div>
             <template
               v-if="
                 menaSon === index || item.show.includes($route.meta.myTitle)
@@ -272,14 +279,22 @@ export default {
   },
   //方法集合
   methods: {
+    // 一级菜单箭头的展开和收起
+    oneMeanChange(index,show) {
+      if(show.includes(this.$route.meta.myTitle)) return
+      if (this.menaSon === index) this.menaSon = null;
+      else this.menaSon = index;
+    },
     // 封装一个地址栏改变监听$route的方法
     routeChange() {
       let t = this.$route.params.t;
       // 对于二级菜单高亮的重定义
       let temp = this.$route.path;
-      if(temp.includes('Layout/Search')){
+      // 首页的重定义
+      if (temp === "/Layout/Home") this.menaSon = null;
+      if (temp.includes("Layout/Search")) {
         if (t && t !== "null") this.txt = t;
-      }else this.txt=''
+      } else this.txt = "";
       let myId = this.$route.query.id;
       myId = Number(myId);
       if (temp === "/Layout/VisitInfo") temp = "/Layout/Visit/2";
@@ -607,6 +622,23 @@ export default {
           color: #c1aa7b;
           font-size: 20px;
           padding-bottom: 20px;
+          .oneMean {
+            position: relative;
+            & > i {
+              width: 50px;
+              height: 50px;
+              line-height: 50px;
+              text-align: right;
+              font-size: 24px;
+              font-weight: 400;
+              color: #c1aa7b;
+              z-index: 10;
+              position: absolute;
+              right: 0px;
+              top: 50%;
+              transform: translateY(-50%);
+            }
+          }
           .rowSon {
             padding-left: 30px;
             font-size: 16px;

+ 1 - 1
webM/src/views/Publications/Catalogues.vue

@@ -123,7 +123,7 @@ export default {
     position: relative;
     transition: all 0.3s;
     .page {
-      z-index: 999;
+      z-index: 990;
       background-color: rgba(183, 149, 80, .3);
       width: 68px;
       height: 40px;