See999 5 anos atrás
pai
commit
9fbd0eebe9

+ 3 - 0
src/router/modules/scrm.js Ver arquivo

@@ -4,6 +4,9 @@ export default {
4 4
   path: '/scrm',
5 5
   component: Layout,
6 6
   redirct: 'noredirect',
7
+  src: process.env.SRCM_HOST,
8
+  name: 'scrm',
9
+  other:true,
7 10
   children: [{
8 11
     path: process.env.SRCM_HOST,
9 12
     name: 'scrm',

+ 3 - 0
src/router/modules/shop.js Ver arquivo

@@ -4,6 +4,9 @@ export default {
4 4
   path: '/shop',
5 5
   component: Layout,
6 6
   redirct: 'noredirect',
7
+  src: process.env.MIRCO_MALL_HOST,
8
+  name: 'shop',
9
+  other:true,
7 10
   children: [{
8 11
     path: process.env.MIRCO_MALL_HOST,
9 12
     name: 'shop',

+ 14 - 11
src/router/modules/slow.js Ver arquivo

@@ -1,16 +1,19 @@
1 1
 import Layout from '@/views/layout/Layout'
2 2
 
3 3
 export default {
4
-  path: '/slow',
5
-  component: Layout,
6
-  redirct: 'noredirect',
7
-  children: [{
8
-    path: process.env.CDM_HOST,
4
+    path: '/slow',
5
+    component: Layout,
6
+    redirct: 'noredirect',
9 7
     name: 'slow',
10
-    meta: {
11
-      title: 'slow',
12
-      other:true,
13
-      noCache: true
14
-    }
15
-  }]
8
+    src: process.env.CDM_HOST,
9
+    other:true,
10
+    children: [{
11
+        path: process.env.CDM_HOST,
12
+        name: 'slow',
13
+        meta: {
14
+        title: 'slow',
15
+        other:true,
16
+        noCache: true
17
+        }
18
+    }]
16 19
 }

+ 4 - 2
src/store/modules/xt_permission.js Ver arquivo

@@ -42,11 +42,14 @@ function xt_filterAsyncRouter(routers) {
42 42
 
43 43
 function setupRouters(urls) {
44 44
   console.log(urls)
45
+  console.log(xt_asyncRouterMap)
45 46
   xt_asyncRouterMap.forEach(router => {
46
-    // console.log(router)
47
+    console.log(router)
48
+    
47 49
     if (Object.prototype.toString.call(router.children) === '[object Array]') {
48 50
       router.hidden = true
49 51
       router.children.forEach(c_router => {
52
+        
50 53
         if(router.path == "/slow"){
51 54
           if(IndexOf(urls, router.path) != -1){
52 55
             router.hidden = false
@@ -68,7 +71,6 @@ function setupRouters(urls) {
68 71
             router.hidden = true
69 72
           }
70 73
         }
71
-
72 74
         // console.log(c_router.path)
73 75
         if (IndexOf(urls, c_router.path) !== -1) {
74 76
         // if (urls.indexOf(c_router.path) !== -1) {

+ 39 - 39
src/store/modules/xt_user.js Ver arquivo

@@ -215,46 +215,46 @@ const xt_user = {
215 215
           })
216 216
 
217 217
           
218
-          let urlfors = infoJSON.urlfors
219
-          if(infoJSON.cdm_role_exist == true){
220
-            console.log("有")
221
-            urlfors.push("/slow")
222
-            this.commit('SET_URLFORS', {
223
-              urlfors: urlfors
224
-            })
225
-          }else{
226
-            this.commit('SET_URLFORS', {
227
-              urlfors: infoJSON.urlfors
228
-            })
229
-          }
230
-
231
-          if(infoJSON.scrm_role_exist == true){
232
-            urlfors.push("/scrm")
233
-            this.commit('SET_URLFORS', {
234
-              urlfors: urlfors
235
-            })
236
-          }else{
237
-            this.commit('SET_URLFORS', {
238
-              urlfors: infoJSON.urlfors
239
-            })
240
-          }
241
-
242
-          if(infoJSON.mall_role_exist == true){
243
-            console.log("有")
244
-            urlfors.push("/shop")
245
-            this.commit('SET_URLFORS', {
246
-              urlfors: urlfors
247
-            })
248
-          }else{
249
-            this.commit('SET_URLFORS', {
250
-              urlfors: infoJSON.urlfors
251
-            })
252
-          }
253
-          console.log(222222222222,infoJSON)
218
+          // let urlfors = infoJSON.urlfors
219
+          // if(infoJSON.cdm_role_exist == true){
220
+          //   console.log("有")
221
+          //   urlfors.push("/slow")
222
+          //   this.commit('SET_URLFORS', {
223
+          //     urlfors: urlfors
224
+          //   })
225
+          // }else{
226
+          //   this.commit('SET_URLFORS', {
227
+          //     urlfors: infoJSON.urlfors
228
+          //   })
229
+          // }
230
+
231
+          // if(infoJSON.scrm_role_exist == true){
232
+          //   urlfors.push("/scrm")
233
+          //   this.commit('SET_URLFORS', {
234
+          //     urlfors: urlfors
235
+          //   })
236
+          // }else{
237
+          //   this.commit('SET_URLFORS', {
238
+          //     urlfors: infoJSON.urlfors
239
+          //   })
240
+          // }
241
+
242
+          // if(infoJSON.mall_role_exist == true){
243
+          //   console.log("有")
244
+          //   urlfors.push("/shop")
245
+          //   this.commit('SET_URLFORS', {
246
+          //     urlfors: urlfors
247
+          //   })
248
+          // }else{
249
+          //   this.commit('SET_URLFORS', {
250
+          //     urlfors: infoJSON.urlfors
251
+          //   })
252
+          // }
253
+          // console.log(222222222222,infoJSON)
254 254
           
255
-          // commit('SET_URLFORS', {
256
-          //   urlfors: infoJSON.urlfors
257
-          // })
255
+          commit('SET_URLFORS', {
256
+            urlfors: infoJSON.urlfors
257
+          })
258 258
 
259 259
           resolve(infoJSON.user.user_id)
260 260
         } else {

+ 99 - 97
src/views/layout/components/Sidebar/SidebarItem.vue Ver arquivo

@@ -1,118 +1,120 @@
1 1
 <template>
2 2
   <div v-if="!item.hidden && item.children" class="menu-wrapper">
3
-    <div
4
-      v-if="
5
-        hasOneShowingChild(item.children) &&
6
-          !onlyOneChild.children &&
7
-          !item.alwaysShow
8
-      "
9
-      @click="onClick(item)"
10
-    >
11
-      <router-link v-if="!onlyOneChild.meta.other" :to="resolvePath(onlyOneChild.path)">
3
+    <div v-if="item.other">
4
+      <a :href="item.src" target="_blank">
12 5
         <el-menu-item
13
-          :index="resolvePath(onlyOneChild.path)"
14
-          :class="{ 'submenu-title-noDropdown': !isNest }"
15
-        >
16
-          <svg-icon
17
-            v-if="onlyOneChild.meta && onlyOneChild.meta.icon"
18
-            :icon-class="onlyOneChild.meta.icon"
19
-          ></svg-icon>
20
-          <span
21
-            v-if="onlyOneChild.meta && onlyOneChild.meta.title"
22
-            slot="title"
23
-          >{{ generateTitle(onlyOneChild.meta.title) }}</span>
24
-        </el-menu-item>
25
-      </router-link>
26
-      <a v-else :href="onlyOneChild.path" target="_blank">
27
-        <el-menu-item
28
-          :index="resolvePath(onlyOneChild.path)"
6
+          :index="resolvePath(item.src)"
29 7
           :class="{ 'submenu-title-noDropdown': !isNest }"
30 8
         >
31 9
           <i v-if="onlyOneChild.name == 'slow'" class="icon iconfont icon-manbing-xuanzhong" style="margin-right:4px"></i>
32 10
           <i v-if="onlyOneChild.name == 'scrm'" class="icon iconfont icon-pengyou" style="margin-right:4px"></i>
33 11
           <i v-if="onlyOneChild.name == 'shop'" class="icon iconfont icon-service_fill" style="margin-right:4px"></i>
34
-          <span
35
-            v-if="onlyOneChild.meta && onlyOneChild.meta.title"
36
-            slot="title"
37
-          >{{ generateTitle(onlyOneChild.meta.title) }}</span>
12
+          <span slot="title">{{ generateTitle(item.name) }}</span>
38 13
         </el-menu-item>
39 14
       </a>
40 15
     </div>
41
-
42 16
     <div v-else>
43
-      <el-submenu v-if="item.meta.isChild" id="mySubmenu" :index="item.name || item.path">
44
-        <template slot="title">
45
-          <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
46
-          <span v-if="item.meta && item.meta.title" slot="title">
47
-            {{
48
-            generateTitle(item.meta.title)
49
-            }}
50
-          </span>
51
-        </template>
52
-        <template v-for="child in item.children" v-if="!child.hidden">
53
-          <router-link
54
-            :to="resolvePath(child.path)"
55
-            v-if="child.meta.isChild != true"
56
-            :key="child.name"
17
+      <div
18
+        v-if="
19
+          hasOneShowingChild(item.children) &&
20
+            !onlyOneChild.children &&
21
+            !item.alwaysShow
22
+        "
23
+        @click="onClick(item)"
24
+      >
25
+        <router-link :to="resolvePath(onlyOneChild.path)">
26
+          <el-menu-item
27
+            :index="resolvePath(onlyOneChild.path)"
28
+            :class="{ 'submenu-title-noDropdown': !isNest }"
57 29
           >
58
-            <el-menu-item @click="onClick(item)" :index="resolvePath(child.path)">
59
-              <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
60
-              <span v-if="child.meta && child.meta.title" slot="title">
61
-                {{
30
+            <svg-icon
31
+              v-if="onlyOneChild.meta && onlyOneChild.meta.icon"
32
+              :icon-class="onlyOneChild.meta.icon"
33
+            ></svg-icon>
34
+            <span
35
+              v-if="onlyOneChild.meta && onlyOneChild.meta.title"
36
+              slot="title"
37
+            >{{ generateTitle(onlyOneChild.meta.title) }}</span>
38
+          </el-menu-item>
39
+        </router-link>
40
+        
41
+      </div>
42
+
43
+      <div v-else>
44
+        <el-submenu v-if="item.meta.isChild" id="mySubmenu" :index="item.name || item.path">
45
+          <template slot="title">
46
+            <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
47
+            <span v-if="item.meta && item.meta.title" slot="title">
48
+              {{
49
+              generateTitle(item.meta.title)
50
+              }}
51
+            </span>
52
+          </template>
53
+          <template v-for="child in item.children" v-if="!child.hidden">
54
+            <router-link
55
+              :to="resolvePath(child.path)"
56
+              v-if="child.meta.isChild != true"
57
+              :key="child.name"
58
+            >
59
+              <el-menu-item @click="onClick(item)" :index="resolvePath(child.path)">
60
+                <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
61
+                <span v-if="child.meta && child.meta.title" slot="title">
62
+                  {{
63
+                  generateTitle(child.meta.title)
64
+                  }}
65
+                </span>
66
+              </el-menu-item>
67
+            </router-link>
68
+
69
+            <router-link v-else :to="child.path" :key="child.name">
70
+              <el-menu-item @click="onClick(item,child.parentNum)" :index="resolvePath(child.path)">
71
+                <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
72
+                <span v-if="child.meta && child.meta.title" slot="title">
73
+                  {{
74
+                  generateTitle(child.meta.title)
75
+                  }}
76
+                </span>
77
+              </el-menu-item>
78
+            </router-link>
79
+          </template>
80
+        </el-submenu>
81
+        <div v-else @click="onClick(item)">
82
+          <router-link :to="resolvePath(item.children[0].path)">
83
+            <el-menu-item :index="item.name || item.path">
84
+              <template slot="title">
85
+                <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
86
+                <span v-if="item.meta && item.meta.title" slot="title">
87
+                  {{
88
+                  generateTitle(item.meta.title)
89
+                  }}
90
+                </span>
91
+              </template>
92
+
93
+              <!-- <template v-for="child in item.children" v-if="!child.hidden">
94
+          <sidebar-item
95
+            :is-nest="true"
96
+            class="nest-menu"
97
+            v-if="child.children && child.children.length > 0"
98
+            :item="child"
99
+            :key="child.path"
100
+            :base-path="resolvePath(child.path)"
101
+          ></sidebar-item>
102
+
103
+          <router-link v-else :to="resolvePath(child.path)" :key="child.name">
104
+            <el-menu-item :index="resolvePath(child.path)">
105
+              <svg-icon
106
+                v-if="child.meta && child.meta.icon"
107
+                :icon-class="child.meta.icon"
108
+              ></svg-icon>
109
+              <span v-if="child.meta && child.meta.title" slot="title">{{
62 110
                 generateTitle(child.meta.title)
63
-                }}
64
-              </span>
111
+              }}</span>
65 112
             </el-menu-item>
66 113
           </router-link>
67
-
68
-          <router-link v-else :to="child.path" :key="child.name">
69
-            <el-menu-item @click="onClick(item,child.parentNum)" :index="resolvePath(child.path)">
70
-              <svg-icon v-if="child.meta && child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
71
-              <span v-if="child.meta && child.meta.title" slot="title">
72
-                {{
73
-                generateTitle(child.meta.title)
74
-                }}
75
-              </span>
114
+              </template>-->
76 115
             </el-menu-item>
77 116
           </router-link>
78
-        </template>
79
-      </el-submenu>
80
-      <div v-else @click="onClick(item)">
81
-        <router-link :to="resolvePath(item.children[0].path)">
82
-          <el-menu-item :index="item.name || item.path">
83
-            <template slot="title">
84
-              <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
85
-              <span v-if="item.meta && item.meta.title" slot="title">
86
-                {{
87
-                generateTitle(item.meta.title)
88
-                }}
89
-              </span>
90
-            </template>
91
-
92
-            <!-- <template v-for="child in item.children" v-if="!child.hidden">
93
-        <sidebar-item
94
-          :is-nest="true"
95
-          class="nest-menu"
96
-          v-if="child.children && child.children.length > 0"
97
-          :item="child"
98
-          :key="child.path"
99
-          :base-path="resolvePath(child.path)"
100
-        ></sidebar-item>
101
-
102
-        <router-link v-else :to="resolvePath(child.path)" :key="child.name">
103
-          <el-menu-item :index="resolvePath(child.path)">
104
-            <svg-icon
105
-              v-if="child.meta && child.meta.icon"
106
-              :icon-class="child.meta.icon"
107
-            ></svg-icon>
108
-            <span v-if="child.meta && child.meta.title" slot="title">{{
109
-              generateTitle(child.meta.title)
110
-            }}</span>
111
-          </el-menu-item>
112
-        </router-link>
113
-            </template>-->
114
-          </el-menu-item>
115
-        </router-link>
117
+        </div>
116 118
       </div>
117 119
     </div>
118 120
   </div>