See999 5 vuotta sitten
vanhempi
commit
62c616d084

+ 6 - 8
src/views/layout/Layout.vue Näytä tiedosto

@@ -1,17 +1,13 @@
1 1
 <template>
2 2
   <div class="app-wrapper" :class="classObj">
3
-    <div
4
-      v-if="device === 'mobile' && sidebar.opened"
5
-      class="drawer-bg"
6
-      @click="handleClickOutside"
7
-    ></div>
3
+    <div v-if="device === 'mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside"></div>
8 4
     <navbar></navbar>
9 5
 
10 6
     <div class="Header-container">
11 7
       <sidebar class="sidebar-container" @callBackIndex="handleIndex"></sidebar>
12 8
       <!-- <sidebar class="newSide" @callBackIndex="handleIndex"></sidebar> -->
13 9
       <div class="main-container">
14
-        <tags-view :index="index"></tags-view>
10
+        <tags-view :index="index" :num="num"></tags-view>
15 11
         <app-main></app-main>
16 12
       </div>
17 13
     </div>
@@ -49,16 +45,18 @@ export default {
49 45
   },
50 46
   data() {
51 47
     return {
52
-      index: 0
48
+      index: 0,
49
+      num: 1
53 50
     };
54 51
   },
55 52
   methods: {
56 53
     handleClickOutside() {
57 54
       this.$store.dispatch("closeSideBar", { withoutAnimation: false });
58 55
     },
59
-    handleIndex(data) {
56
+    handleIndex(data, num) {
60 57
       // console.log({ prop: data });
61 58
       this.index = data;
59
+      this.num = num;
62 60
     }
63 61
   }
64 62
 };

+ 8 - 4
src/views/layout/components/Sidebar/SidebarItem.vue Näytä tiedosto

@@ -41,7 +41,7 @@
41 41
             v-if="child.meta.isChild != true"
42 42
             :key="child.name"
43 43
           >
44
-            <el-menu-item :index="resolvePath(child.path)">
44
+            <el-menu-item @click="onClick(item)" :index="resolvePath(child.path)">
45 45
               <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
46 46
               <span v-if="child.meta && child.meta.title" slot="title">
47 47
                 {{
@@ -52,7 +52,7 @@
52 52
           </router-link>
53 53
 
54 54
           <router-link v-else :to="child.path" :key="child.name">
55
-            <el-menu-item :index="resolvePath(child.path)">
55
+            <el-menu-item @click="onClick(item,child.parentNum)" :index="resolvePath(child.path)">
56 56
               <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
57 57
               <span v-if="child.meta && child.meta.title" slot="title">
58 58
                 {{
@@ -157,10 +157,14 @@ export default {
157 157
       return path.resolve(this.basePath, ...paths);
158 158
     },
159 159
     generateTitle,
160
-    onClick(index) {
160
+    onClick(index, num) {
161 161
       this.permission_routers.map((item, i) => {
162 162
         if (this.isObjectValueEqual(item, index)) {
163
-          this.$emit("a", i);
163
+          if (num) {
164
+            this.$emit("a", i, num);
165
+          } else {
166
+            this.$emit("a", i, 999);
167
+          }
164 168
         }
165 169
       });
166 170
     },

+ 2 - 3
src/views/layout/components/Sidebar/index.vue Näytä tiedosto

@@ -105,11 +105,10 @@ export default {
105 105
     resolvePath(...paths) {
106 106
       return path.resolve(this.basePath, ...paths);
107 107
     },
108
-    b(index) {
109
-      // console.log(index);
108
+    b(index, num) {
110 109
       // this.index = index;
111 110
       // this.activeClass = index;
112
-      this.$emit("callBackIndex", index);
111
+      this.$emit("callBackIndex", index, num);
113 112
     }
114 113
   },
115 114
   created() {

+ 79 - 22
src/views/layout/components/TagsView.vue Näytä tiedosto

@@ -27,27 +27,63 @@
27 27
       <li @click="closeAllTags">{{ $t("tagsView.closeAll") }}</li>
28 28
     </ul>-->
29 29
     <div class="tags-view-wrapper">
30
-      <div class="tagsBox">
31
-        <div
32
-          class="tagsOne"
33
-          v-if="permission_routers[newIndex].meta"
34
-          v-for="(item, i) in permission_routers[newIndex].children"
35
-          :key="i"
36
-        >
37
-          <router-link :to="item.path" v-if="!item.hidden && !item.is_menu">
38
-            <p
39
-              class="newTags"
40
-              :class="activeClass == i ? 'active' : ''"
41
-              @click="onClick(i)"
42
-            >{{ generateTitle(item.meta.title) }}</p>
43
-          </router-link>
30
+      <div style="height:100%">
31
+        <div style="height:100%" v-if="newIndex == 9">
32
+          <div class="tagsBox" v-if="routerList.length > 0 && newNum != 999">
33
+            <div
34
+              class="tagsOne"
35
+              v-if="routerList[newIndex].meta"
36
+              v-for="(item, i) in routerList[newIndex].children"
37
+              :key="i"
38
+            >
39
+              <router-link :to="item.path" v-if="item.num ? item.num == newNum : false">
40
+                <p
41
+                  class="newTags"
42
+                  :class="activeClass == i ? 'active' : ''"
43
+                  @click="onClick(i)"
44
+                >{{ generateTitle(item.meta.title) }}</p>
45
+              </router-link>
46
+            </div>
47
+          </div>
48
+          <div class="tagsBox" v-if="newNum == 999">
49
+            <div
50
+              class="tagsOne"
51
+              v-if="permission_routers[newIndex].meta"
52
+              v-for="(item, i) in permission_routers[newIndex].children"
53
+              :key="i"
54
+            >
55
+              <router-link :to="item.path" v-if="item.num ? item.num == newNum : false">
56
+                <p
57
+                  class="newTags"
58
+                  :class="activeClass == i ? 'active' : ''"
59
+                  @click="onClick(i)"
60
+                >{{ generateTitle(item.meta.title) }}</p>
61
+              </router-link>
62
+            </div>
63
+          </div>
44 64
         </div>
45
-        <div v-else class="tagsOne">
46
-          <p class="newTags" :class="activeClass == i ? 'active' : ''" @click="onClick(i)">
47
-            {{
48
-            generateTitle(permission_routers[newIndex].children[0].meta.title)
49
-            }}
50
-          </p>
65
+        <div class="tagsBox" v-if="newIndex != 9">
66
+          <div
67
+            class="tagsOne"
68
+            v-if="permission_routers[newIndex].meta"
69
+            v-for="(item, i) in permission_routers[newIndex].children"
70
+            :key="i"
71
+          >
72
+            <router-link :to="item.path" v-if="!item.hidden && !item.is_menu">
73
+              <p
74
+                class="newTags"
75
+                :class="activeClass == i ? 'active' : ''"
76
+                @click="onClick(i)"
77
+              >{{ generateTitle(item.meta.title) }}</p>
78
+            </router-link>
79
+          </div>
80
+          <div v-else class="tagsOne">
81
+            <p class="newTags" :class="activeClass == i ? 'active' : ''" @click="onClick(i)">
82
+              {{
83
+              generateTitle(permission_routers[newIndex].children[0].meta.title)
84
+              }}
85
+            </p>
86
+          </div>
51 87
         </div>
52 88
       </div>
53 89
     </div>
@@ -61,7 +97,10 @@ import { generateTitle } from "@/utils/i18n";
61 97
 import { mapGetters } from "vuex";
62 98
 
63 99
 export default {
64
-  props: ["index"],
100
+  props: {
101
+    index: Number,
102
+    num: Number
103
+  },
65 104
   components: { ScrollPane },
66 105
   data() {
67 106
     return {
@@ -70,7 +109,8 @@ export default {
70 109
       left: 0,
71 110
       selectedTag: {},
72 111
       newIndex: 0,
73
-      activeClass: ""
112
+      activeClass: 0,
113
+      newNum: 1
74 114
     };
75 115
   },
76 116
   computed: {
@@ -96,8 +136,25 @@ export default {
96 136
         this.activeClass = 0;
97 137
       }
98 138
       this.newIndex = this.index;
139
+    },
140
+    num(newVal) {
141
+      this.newNum = newVal;
142
+      if (newVal == 999) {
143
+        this.routerList = [];
144
+      } else {
145
+        this.routerList = this.permission_routers;
146
+      }
147
+      if (newVal == 1) {
148
+        this.activeClass = 2;
149
+      }
150
+      if (newVal == 2) {
151
+        this.activeClass = 6;
152
+      }
99 153
     }
100 154
   },
155
+  created() {
156
+    this.routerList = this.permission_routers;
157
+  },
101 158
   mounted() {
102 159
     // this.addViewTags();
103 160
   },

+ 2 - 3
src/xt_pages/home/index.vue Näytä tiedosto

@@ -112,7 +112,6 @@
112 112
             :total="total"
113 113
           ></el-pagination>
114 114
         </div>
115
-
116 115
       </div>
117 116
     </section>
118 117
   </div>
@@ -193,8 +192,8 @@ export default {
193 192
   methods: {
194 193
     dateCompare(date) {
195 194
       var date1 = Date.parse(new Date()) / 1000;
196
-      console.log(date);
197
-      console.log(date1);
195
+      // console.log(date);
196
+      // console.log(date1);
198 197
       if (date > date1) {
199 198
         return 1;
200 199
       } else {