Browse Source

修改样式

See999 4 years ago
parent
commit
c2a5a0b42e

+ 1 - 1
config/dev.env.js View File

1
 module.exports = {
1
 module.exports = {
2
   NODE_ENV: '"development"',
2
   NODE_ENV: '"development"',
3
   ENV_CONFIG: '"dev"',
3
   ENV_CONFIG: '"dev"',
4
-  BASE_API:'"http://api.test1.sgjyun.com"',//'"http://localhost:9534"'
4
+  BASE_API:'"http://localhost:9534"',//'"http://localhost:9534"'
5
   //BASE_API: '"http://localhost:9534"'
5
   //BASE_API: '"http://localhost:9534"'
6
   // BASE_API:'"http://api.scrm.kuyicloud.com"',//'"http://localhost:9534"'
6
   // BASE_API:'"http://api.scrm.kuyicloud.com"',//'"http://localhost:9534"'
7
   // BASE_API:'"http://localhost:9536"',
7
   // BASE_API:'"http://localhost:9536"',

+ 2 - 2
config/index.js View File

16
     // can be overwritten by process.env.HOST
16
     // can be overwritten by process.env.HOST
17
     // if you want dev by ip, please set host: '0.0.0.0'
17
     // if you want dev by ip, please set host: '0.0.0.0'
18
 
18
 
19
-    host: "test1.sgjyun.com",
19
+    // host: "test1.sgjyun.com",
20
     //  host: 'microweb.kuyicloud.com',
20
     //  host: 'microweb.kuyicloud.com',
21
-    //host: "localhost",
21
+    host: "localhost",
22
     // host: 'jk.kuyicloud.com',
22
     // host: 'jk.kuyicloud.com',
23
     port: 8090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
23
     port: 8090, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
24
     // host: 'test1.sgjyun.com',
24
     // host: 'test1.sgjyun.com',

BIN
src/assets/logo/logo1.png View File


+ 41 - 39
src/styles/sidebar.scss View File

13
     height: 100%;
13
     height: 100%;
14
     position: fixed;
14
     position: fixed;
15
     font-size: 0px;
15
     font-size: 0px;
16
-    top: 60px;
16
+    // top: 60px;
17
     bottom: 0;
17
     bottom: 0;
18
     left: 0;
18
     left: 0;
19
     z-index: 1001;
19
     z-index: 1001;
47
     }
47
     }
48
     .el-menu {
48
     .el-menu {
49
       border: none;
49
       border: none;
50
-      min-height: 130%;
50
+      height: 90%;
51
+      // min-height: 130%;
52
+      overflow-y: auto;
51
       width: 100% !important;
53
       width: 100% !important;
52
     }
54
     }
53
   }
55
   }
54
-  .hideSidebar {
55
-    .sidebar-container {
56
-      width: 36px !important;
57
-    }
58
-    .main-container {
59
-      margin-left: 36px;
60
-    }
61
-    .submenu-title-noDropdown {
62
-      padding-left: 10px !important;
63
-      position: relative;
64
-      .el-tooltip {
65
-        padding: 0 10px !important;
66
-      }
67
-    }
68
-    .el-submenu {
69
-      overflow: hidden;
70
-      &>.el-submenu__title {
71
-        padding-left: 10px !important;
56
+  // .hideSidebar {
57
+  //   .sidebar-container {
58
+  //     width: 36px !important;
59
+  //   }
60
+  //   .main-container {
61
+  //     margin-left: 36px;
62
+  //   }
63
+  //   .submenu-title-noDropdown {
64
+  //     padding-left: 10px !important;
65
+  //     position: relative;
66
+  //     .el-tooltip {
67
+  //       padding: 0 10px !important;
68
+  //     }
69
+  //   }
70
+  //   .el-submenu {
71
+  //     overflow: hidden;
72
+  //     &>.el-submenu__title {
73
+  //       padding-left: 10px !important;
72
         
74
         
73
-        .el-submenu__icon-arrow {
74
-          display: none;
75
-        }
76
-      }
77
-    }
78
-    .el-menu--collapse {
79
-      .el-submenu {
80
-        &>.el-submenu__title {
81
-          &>span {
82
-            height: 0;
83
-            width: 0;
84
-            overflow: hidden;
85
-            visibility: hidden;
86
-            display: inline-block;
87
-          }
88
-        }
89
-      }
90
-    }
91
-  }
75
+  //       .el-submenu__icon-arrow {
76
+  //         display: none;
77
+  //       }
78
+  //     }
79
+  //   }
80
+  //   .el-menu--collapse {
81
+  //     .el-submenu {
82
+  //       &>.el-submenu__title {
83
+  //         &>span {
84
+  //           height: 0;
85
+  //           width: 0;
86
+  //           overflow: hidden;
87
+  //           visibility: hidden;
88
+  //           display: inline-block;
89
+  //         }
90
+  //       }
91
+  //     }
92
+  //   }
93
+  // }
92
   .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
94
   .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
93
   .sidebar-container .el-submenu .el-menu-item {
95
   .sidebar-container .el-submenu .el-menu-item {
94
     // min-width: 180px !important;
96
     // min-width: 180px !important;

+ 11 - 2
src/views/layout/Layout.vue View File

4
       <navbar></navbar>
4
       <navbar></navbar>
5
     
5
     
6
     <div class="Header-container">
6
     <div class="Header-container">
7
-    <sidebar class="sidebar-container"></sidebar>
7
+    <sidebar class="sidebar-container" @callBackIndex="handleIndex"></sidebar>
8
     <div class="main-container">
8
     <div class="main-container">
9
-      <tags-view></tags-view>
9
+      <tags-view :index="index"></tags-view>
10
       <app-main></app-main>
10
       <app-main></app-main>
11
       <contact-box></contact-box>
11
       <contact-box></contact-box>
12
     </div>
12
     </div>
45
       }
45
       }
46
     }
46
     }
47
   },
47
   },
48
+  data(){
49
+    return{
50
+      index: 0,
51
+    }
52
+  },
48
   methods: {
53
   methods: {
49
     handleClickOutside() {
54
     handleClickOutside() {
50
       this.$store.dispatch('closeSideBar', { withoutAnimation: false })
55
       this.$store.dispatch('closeSideBar', { withoutAnimation: false })
56
+    },
57
+    handleIndex(data) {
58
+      // console.log({ prop: data });
59
+      this.index = data;
51
     }
60
     }
52
   }
61
   }
53
 }
62
 }

+ 6 - 4
src/views/layout/components/Navbar.vue View File

5
     </div>
5
     </div>
6
     <el-menu class="navbar" mode="horizontal">
6
     <el-menu class="navbar" mode="horizontal">
7
       <div>
7
       <div>
8
-        <span> {{this.$store.getters.xt_user.org.org_name}}
8
+        <span> 
9
+          {{this.$store.getters.xt_user.org.org_name}}
9
         </span>
10
         </span>
10
       </div>
11
       </div>
11
-      <div class="system-nav">
12
+      <!-- <div class="system-nav">
12
         <div class="system-nav-menu" v-if="this.$store.getters.xt_user.xt_role_exist">
13
         <div class="system-nav-menu" v-if="this.$store.getters.xt_user.xt_role_exist">
13
           <a :href="XTWebsit()">
14
           <a :href="XTWebsit()">
14
             <span><i class="icon iconfont icon-jiankangshuidi"></i> 血透管理</span>
15
             <span><i class="icon iconfont icon-jiankangshuidi"></i> 血透管理</span>
35
             <span><i class="icon iconfont icon-suoyou"></i> 应用</span>
36
             <span><i class="icon iconfont icon-suoyou"></i> 应用</span>
36
           </a>
37
           </a>
37
         </div>
38
         </div>
38
-      </div>
39
+      </div> -->
39
 
40
 
40
       <div class="right-menu">
41
       <div class="right-menu">
41
         <el-dropdown class="avatar-container right-menu-item" trigger="click"  @command="handleCommand">
42
         <el-dropdown class="avatar-container right-menu-item" trigger="click"  @command="handleCommand">
161
     width: 162px;
162
     width: 162px;
162
     display: flex;
163
     display: flex;
163
     align-items: center;
164
     align-items: center;
164
-    height: 60px;
165
+    height: 50px;
165
     text-align: center;
166
     text-align: center;
166
     justify-content: center;
167
     justify-content: center;
167
     padding: 10px 0;
168
     padding: 10px 0;
179
     display: flex;
180
     display: flex;
180
     justify-content: space-between;
181
     justify-content: space-between;
181
     width: calc(100% - 180px);
182
     width: calc(100% - 180px);
183
+    // width: 100%;
182
     align-items: center;
184
     align-items: center;
183
     color: #fff;
185
     color: #fff;
184
     border: none;
186
     border: none;

+ 79 - 4
src/views/layout/components/Sidebar/SidebarItem.vue View File

1
 <template>
1
 <template>
2
   <div v-if="!item.hidden&&item.children" class="menu-wrapper">
2
   <div v-if="!item.hidden&&item.children" class="menu-wrapper">
3
 
3
 
4
-      <router-link v-if="hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow" :to="resolvePath(onlyOneChild.path)">
4
+      <!-- <router-link v-if="hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow" :to="resolvePath(onlyOneChild.path)">
5
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
5
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
6
           <svg-icon v-if="onlyOneChild.meta&&onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
6
           <svg-icon v-if="onlyOneChild.meta&&onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
7
           <span v-if="onlyOneChild.meta&&onlyOneChild.meta.title" slot="title">{{generateTitle(onlyOneChild.meta.title)}}</span>
7
           <span v-if="onlyOneChild.meta&&onlyOneChild.meta.title" slot="title">{{generateTitle(onlyOneChild.meta.title)}}</span>
18
           <sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :item="child" :key="child.path" :base-path="resolvePath(child.path)"></sidebar-item>
18
           <sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :item="child" :key="child.path" :base-path="resolvePath(child.path)"></sidebar-item>
19
 
19
 
20
           <template v-else>
20
           <template v-else>
21
-            <!-- <router-link :key="child.name" :to="resolvePath(child.path)"> -->
22
               <el-menu-item v-if="child.unfinished == true" :key="child.name" @click.native="unfinishAction()"  :index="resolvePath(child.path)">
21
               <el-menu-item v-if="child.unfinished == true" :key="child.name" @click.native="unfinishAction()"  :index="resolvePath(child.path)">
23
                 <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
22
                 <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
24
                 <span v-if="child.meta&&child.meta.title" slot="title">{{generateTitle(child.meta.title)}}</span>
23
                 <span v-if="child.meta&&child.meta.title" slot="title">{{generateTitle(child.meta.title)}}</span>
25
               </el-menu-item>
24
               </el-menu-item>
26
-            <!-- </router-link> -->
27
             <router-link v-else :to="resolvePath(child.path)" :key="child.name">
25
             <router-link v-else :to="resolvePath(child.path)" :key="child.name">
28
               <el-menu-item :index="resolvePath(child.path)">
26
               <el-menu-item :index="resolvePath(child.path)">
29
                 <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
27
                 <svg-icon v-if="child.meta&&child.meta.icon" :icon-class="child.meta.icon"></svg-icon>
33
           </template>
31
           </template>
34
           
32
           
35
         </template>
33
         </template>
36
-      </el-submenu>
34
+      </el-submenu> -->
37
 
35
 
36
+      <div v-if="hasOneShowingChild(item.children) && !onlyOneChild.children && !item.alwaysShow" @click="onClick(item)">
37
+        <router-link :to="resolvePath(onlyOneChild.path)">
38
+          <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
39
+            <svg-icon v-if="onlyOneChild.meta && onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
40
+            <span v-if="onlyOneChild.meta && onlyOneChild.meta.title" slot="title">{{ generateTitle(onlyOneChild.meta.title) }}</span>
41
+          </el-menu-item>
42
+        </router-link>
43
+        
44
+      </div>
45
+
46
+        <div v-else @click="onClick(item)">
47
+          <router-link :to="resolvePath(item.children[0].path)">
48
+            <el-menu-item :index="item.path">
49
+              <template slot="title">
50
+                <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
51
+                <span v-if="item.meta && item.meta.title" slot="title">
52
+                  {{ generateTitle(item.meta.title) }}
53
+                </span>
54
+              </template>
55
+            </el-menu-item>
56
+          </router-link>
57
+        </div>
38
   </div>
58
   </div>
39
 </template>
59
 </template>
40
 
60
 
42
 import path from 'path'
62
 import path from 'path'
43
 import { generateTitle } from '@/utils/i18n'
63
 import { generateTitle } from '@/utils/i18n'
44
 
64
 
65
+import { mapGetters } from "vuex";
66
+
45
 export default {
67
 export default {
46
   name: 'SidebarItem',
68
   name: 'SidebarItem',
47
   props: {
69
   props: {
59
       default: ''
81
       default: ''
60
     }
82
     }
61
   },
83
   },
84
+  computed: {
85
+    ...mapGetters(["permission_routers"])
86
+  },
62
   data() {
87
   data() {
63
     return {
88
     return {
64
       onlyOneChild: null
89
       onlyOneChild: null
87
     unfinishAction: function() {
112
     unfinishAction: function() {
88
       this.$message.error("功能开发中")
113
       this.$message.error("功能开发中")
89
     },
114
     },
115
+    onClick(index) {
116
+      this.permission_routers.map((item, i) => {
117
+        if (this.isObjectValueEqual(item, index)) {
118
+          this.$emit("a", i);
119
+        }
120
+      });
121
+    },
122
+    isObjectValueEqual(a, b) {
123
+      var aProps = Object.getOwnPropertyNames(a);
124
+      var bProps = Object.getOwnPropertyNames(b);
125
+
126
+      if (aProps.length != bProps.length) {
127
+        return false;
128
+      }
129
+
130
+      for (var i = 0; i < aProps.length; i++) {
131
+        var propName = aProps[i];
132
+
133
+        if (a[propName] !== b[propName]) {
134
+          return false;
135
+        }
136
+      }
137
+
138
+      return true;
139
+    }
90
   }
140
   }
91
 }
141
 }
92
 </script>
142
 </script>
93
 
143
 
144
+<style lang="scss">
145
+.menu-wrapper{
146
+  .el-menu-item{
147
+   background-color:#1F2D3D !important;
148
+   color: #fff !important;
149
+  }
150
+  .el-menu{
151
+    background-color:#1F2D3D !important;
152
+  }
153
+  .el-submenu__title{
154
+    background-color:#1F2D3D !important;
155
+    color: #fff !important;
156
+    height: 32px !important;
157
+    line-height: 32px !important;
158
+  }
159
+  .router-link-exact-active{
160
+    color: rgb(64, 158, 255) !important;
161
+    .el-menu-item{
162
+      color: rgb(64, 158, 255) !important;
163
+    }
164
+  }
165
+}
166
+
167
+</style>
168
+

+ 86 - 3
src/views/layout/components/Sidebar/index.vue View File

1
 <template>
1
 <template>
2
   <el-scrollbar wrapClass="scrollbar-wrapper">
2
   <el-scrollbar wrapClass="scrollbar-wrapper">
3
-    <div class="sideColumn">
3
+    <!-- <div class="sideColumn">
4
        <hamburger class="hamburger-container" :toggleClick="toggleSideBar" :isActive="sidebar.opened"></hamburger>      
4
        <hamburger class="hamburger-container" :toggleClick="toggleSideBar" :isActive="sidebar.opened"></hamburger>      
5
+    </div> -->
6
+    <!-- <el-menu
7
+      mode="vertical"
8
+      :unique-opened="uniqueOpened"
9
+      :show-timeout="200"
10
+      :default-active="$route.path"
11
+      :collapse="isCollapse"
12
+      background-color="#304156"
13
+      text-color="#bfcbd9"
14
+      active-text-color="#409EFF"
15
+    > -->
16
+    <div class="logo">
17
+      <img src="../../../../assets/logo/logo1.png" alt />
5
     </div>
18
     </div>
6
     <el-menu
19
     <el-menu
7
       mode="vertical"
20
       mode="vertical"
8
       :unique-opened="uniqueOpened"
21
       :unique-opened="uniqueOpened"
9
       :show-timeout="200"
22
       :show-timeout="200"
10
       :default-active="$route.path"
23
       :default-active="$route.path"
11
-      :collapse="isCollapse"
12
       background-color="#304156"
24
       background-color="#304156"
13
       text-color="#bfcbd9"
25
       text-color="#bfcbd9"
14
       active-text-color="#409EFF"
26
       active-text-color="#409EFF"
15
     >
27
     >
16
-      <sidebar-item v-for="route in permission_routers" :key="route.name" :item="route" :base-path="route.path"></sidebar-item>
28
+      <sidebar-item v-for="route in permission_routers" :key="route.name" :item="route" :base-path="route.path" @a="b"></sidebar-item>
29
+      <el-menu-item v-if="this.$store.getters.xt_user.xt_role_exist" index="100">
30
+        <a :href="CDMWebsit()">
31
+          <i class="icon iconfont icon-manbing-xuanzhong" style="margin-right:4px"></i>
32
+          <span
33
+            slot="title"
34
+          >血透管理</span>
35
+        </a>
36
+      </el-menu-item>
37
+      <el-menu-item v-if="this.$store.getters.xt_user.cdm_role_exist" index="100">
38
+        <a :href="CDMWebsit()">
39
+          <i class="icon iconfont icon-manbing-xuanzhong" style="margin-right:4px"></i>
40
+          <span
41
+            slot="title"
42
+          >慢病管理</span>
43
+        </a>
44
+      </el-menu-item>
45
+      <el-menu-item v-if="this.$store.getters.xt_user.mall_role_exist" index="102">
46
+        <a :href="MircoMallWebsit()">
47
+          <i class="icon iconfont icon-service_fill" style="margin-right:4px"></i>
48
+          <span
49
+            slot="title"
50
+          >分销商城</span>
51
+        </a>
52
+      </el-menu-item>
17
     </el-menu>
53
     </el-menu>
18
   </el-scrollbar>
54
   </el-scrollbar>
19
 </template>
55
 </template>
35
   data(){
71
   data(){
36
     return{
72
     return{
37
       uniqueOpened:true,
73
       uniqueOpened:true,
74
+      activeClass: 0,
75
+      index: 0
38
     }
76
     }
39
   },
77
   },
40
   methods:{
78
   methods:{
41
     toggleSideBar() {
79
     toggleSideBar() {
42
       this.$store.dispatch("toggleSideBar");
80
       this.$store.dispatch("toggleSideBar");
43
     },
81
     },
82
+    b(index) {
83
+      // this.index = index;
84
+      // this.activeClass = index;
85
+      // console.log('b',index)
86
+      this.$emit("callBackIndex", index);
87
+    },
88
+    XTWebsit() {
89
+      return process.env.XT_HOST
90
+    },
91
+    CDMWebsit() {
92
+      return process.env.CDM_HOST;
93
+    },
94
+    SCRMWebsit() {
95
+      return process.env.SRCM_HOST;
96
+    },
97
+    MircoMallWebsit() {
98
+      return process.env.MIRCO_MALL_HOST;
99
+    },
44
   }
100
   }
45
 };
101
 };
46
 </script>
102
 </script>
83
   }
139
   }
84
 }
140
 }
85
 }
141
 }
142
+.logo {
143
+  width: 100px;
144
+  height: 32px;
145
+  margin: 20px auto;
146
+  img {
147
+    width: 100%;
148
+    height: 100%;
149
+    display: block;
150
+  }
151
+}
86
 
152
 
87
 </style>
153
 </style>
154
+<style lang="scss">
155
+.scrollbar-wrapper {
156
+  background-color: #1F2D3D;
157
+  .el-menu{
158
+    background-color: #1F2D3D !important;
159
+  }
160
+  .el-menu-item{
161
+    height: 32px !important;
162
+    line-height: 32px !important;
163
+    background-color: #1F2D3D !important;
164
+    color: #fff !important;
165
+    i{
166
+      color: #fff;
167
+    }
168
+  }
169
+}
170
+</style>
88
 
171
 

+ 86 - 18
src/views/layout/components/TagsView.vue View File

1
 <template>
1
 <template>
2
   <div class="tags-view-container">
2
   <div class="tags-view-container">
3
-    <scroll-pane class='tags-view-wrapper' ref='scrollPane'>
3
+    <!-- <scroll-pane class='tags-view-wrapper' ref='scrollPane'>
4
       <router-link 
4
       <router-link 
5
         ref='tag' 
5
         ref='tag' 
6
         class="tags-view-item" 
6
         class="tags-view-item" 
17
       <li @click="closeSelectedTag(selectedTag)">{{$t('tagsView.close')}}</li>
17
       <li @click="closeSelectedTag(selectedTag)">{{$t('tagsView.close')}}</li>
18
       <li @click="closeOthersTags">{{$t('tagsView.closeOthers')}}</li>
18
       <li @click="closeOthersTags">{{$t('tagsView.closeOthers')}}</li>
19
       <li @click="closeAllTags">{{$t('tagsView.closeAll')}}</li>
19
       <li @click="closeAllTags">{{$t('tagsView.closeAll')}}</li>
20
-    </ul>
20
+    </ul> -->
21
+    <div class="tags-view-wrapper">
22
+        <div class="tagsBox">
23
+          <div class="tagsOne"
24
+            v-if="permission_routers[newIndex].meta"
25
+            v-for="(item, i) in permission_routers[newIndex].children"
26
+            :key="i"
27
+          >
28
+            <router-link :to="item.path" v-if="!item.hidden && !item.is_menu">
29
+              <p
30
+                class="newTags"
31
+                :class="activeClass == i ? 'active' : ''"
32
+                @click="onClick(i)"
33
+              >{{ generateTitle(item.meta.title) }}</p>
34
+            </router-link>
35
+          </div>
36
+          <div v-else class="tagsOne">
37
+            <p class="newTags" :class="activeClass == i ? 'active' : ''" @click="onClick(i)">
38
+              {{
39
+              generateTitle(permission_routers[newIndex].children[0].meta.title)
40
+              }}
41
+            </p>
42
+          </div>
43
+        </div>
44
+      </div>
21
   </div>
45
   </div>
22
 </template>
46
 </template>
23
 
47
 
24
 <script>
48
 <script>
25
 import ScrollPane from '@/components/ScrollPane'
49
 import ScrollPane from '@/components/ScrollPane'
26
 import { generateTitle } from '@/utils/i18n'
50
 import { generateTitle } from '@/utils/i18n'
51
+
52
+import { mapGetters } from "vuex";
27
   
53
   
28
 export default {
54
 export default {
29
   components: { ScrollPane },
55
   components: { ScrollPane },
56
+  props: {
57
+    index: Number,
58
+  },
30
   data() {
59
   data() {
31
     return {
60
     return {
32
       visible: false,
61
       visible: false,
33
       top: 0,
62
       top: 0,
34
       left: 0,
63
       left: 0,
35
-      selectedTag: {}
64
+      selectedTag: {},
65
+      newIndex: 0,
66
+      activeClass: 0,
36
     }
67
     }
37
   },
68
   },
38
   computed: {
69
   computed: {
39
-    visitedViews() {
40
-      return this.$store.state.tagsView.visitedViews
41
-    }
70
+    // visitedViews() {
71
+    //   return this.$store.state.tagsView.visitedViews
72
+    // },
73
+    ...mapGetters(["permission_routers"])
42
   },
74
   },
43
   watch: {
75
   watch: {
44
-    $route() {
45
-      this.addViewTags()
46
-      this.moveToCurrentTag()
76
+    // $route() {
77
+    //   this.addViewTags()
78
+    //   this.moveToCurrentTag()
79
+    // },
80
+    // visible(value) {
81
+    //   if (value) {
82
+    //     document.body.addEventListener('click', this.closeMenu)
83
+    //   } else {
84
+    //     document.body.removeEventListener('click', this.closeMenu)
85
+    //   }
86
+    // }
87
+    index(newVal) {
88
+      console.log(newVal)
89
+      // if (this.newIndex != newVal) {
90
+      //   this.activeClass = 0;
91
+      // }
92
+      this.newIndex = newVal;
47
     },
93
     },
48
-    visible(value) {
49
-      if (value) {
50
-        document.body.addEventListener('click', this.closeMenu)
51
-      } else {
52
-        document.body.removeEventListener('click', this.closeMenu)
53
-      }
54
-    }
94
+  },
95
+  created(){
96
+    console.log(this.permission_routers)
97
+    this.newIndex = 3
55
   },
98
   },
56
   mounted() {
99
   mounted() {
57
     this.addViewTags()
100
     this.addViewTags()
116
     },
159
     },
117
     closeMenu() {
160
     closeMenu() {
118
       this.visible = false
161
       this.visible = false
119
-    }
162
+    },
163
+    onClick(index) {
164
+      // console.log(index);
165
+      this.activeClass = index;
166
+    },
120
   }
167
   }
121
 }
168
 }
122
 </script>
169
 </script>
125
 .tags-view-container {
172
 .tags-view-container {
126
   height: 60px;
173
   height: 60px;
127
   .tags-view-wrapper {
174
   .tags-view-wrapper {
175
+    width: 100%;
128
     background: #fff;
176
     background: #fff;
129
     height: 50px;
177
     height: 50px;
130
     border-bottom: 1px solid #d8dce5;
178
     border-bottom: 1px solid #d8dce5;
131
     box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
179
     box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
132
     position: fixed;
180
     position: fixed;
133
     z-index: 1000;
181
     z-index: 1000;
134
-    top: 60px;
182
+    top: 50px;
135
     overflow-x: scroll;
183
     overflow-x: scroll;
136
     /* 针对缺省样式 (必须的) */
184
     /* 针对缺省样式 (必须的) */
137
       &::-webkit-scrollbar {
185
       &::-webkit-scrollbar {
222
       }
270
       }
223
     }
271
     }
224
   }
272
   }
273
+  .tagsBox {
274
+    display: flex;
275
+    align-items: center;
276
+    height: 100%;
277
+    .tagsOne {
278
+      .newTags {
279
+        border: 1px solid rgba(235, 238, 240, 1);
280
+        border-radius: 2px;
281
+        padding: 8px 12px;
282
+        margin-left: 10px;
283
+        font-size: 14px;
284
+      }
285
+    }
286
+    .active {
287
+      border: 1px solid rgba(64, 158, 255, 1);
288
+      background: rgba(64, 158, 255, 1);
289
+      border-radius: 2px;
290
+      color: #fff;
291
+    }
292
+  }
225
 }
293
 }
226
 </style>
294
 </style>
227
 
295
 

+ 8 - 8
src/xt_permission.js View File

10
 
10
 
11
 router.beforeEach((to, from, next) => {
11
 router.beforeEach((to, from, next) => {
12
   // 线上注释
12
   // 线上注释
13
-  // if (store.getters.permission_routers === undefined) {
14
-  //   store.dispatch('xt_GenerateRoutes', []).then(() => {
15
-  //     next()
16
-  //   })
17
-  // } else {
18
-  //   next()
19
-  // }
20
-  // return
13
+  if (store.getters.permission_routers === undefined) {
14
+    store.dispatch('xt_GenerateRoutes', []).then(() => {
15
+      next()
16
+    })
17
+  } else {
18
+    next()
19
+  }
20
+  return
21
   // 线上注释
21
   // 线上注释
22
 
22
 
23
   NProgress.start()
23
   NProgress.start()