See999 4 gadus atpakaļ
vecāks
revīzija
5ffb3cd01d

+ 1 - 1
config/dev.env.js Parādīt failu

@@ -6,7 +6,7 @@
6 6
 module.exports = {
7 7
   NODE_ENV: '"development"',
8 8
   ENV_CONFIG: '"dev"',
9
-  BASE_API: '"http://api.mall.test.sgjyun.com"',//'"http://localhost:9529"', // //http://api.mall.test.sgjyun.com http://112.74.16.180:9527
9
+  BASE_API: '"http://localhost:9529"',//'"http://localhost:9529"', // //http://api.mall.test.sgjyun.com http://112.74.16.180:9527
10 10
 
11 11
   
12 12
   SSO_HOST: '"http://testsso.sgjyun.com"',

+ 2 - 1
config/index.js Parādīt failu

@@ -19,7 +19,8 @@ module.exports = {
19 19
 
20 20
     // host: 'xt.test.sgjyun.com',
21 21
     // host: 'xt.kuyicloud.com',
22
-    host: 'mall.test.sgjyun.com',
22
+    // host: 'mall.test.sgjyun.com',
23
+    host: 'localhost',
23 24
     port:9530, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
24 25
     autoOpenBrowser: true,
25 26
     errorOverlay: true,

+ 9 - 4
package-lock.json Parādīt failu

@@ -4730,7 +4730,8 @@
4730 4730
         "ansi-regex": {
4731 4731
           "version": "2.1.1",
4732 4732
           "bundled": true,
4733
-          "dev": true
4733
+          "dev": true,
4734
+          "optional": true
4734 4735
         },
4735 4736
         "aproba": {
4736 4737
           "version": "1.2.0",
@@ -5145,7 +5146,8 @@
5145 5146
         "safe-buffer": {
5146 5147
           "version": "5.1.2",
5147 5148
           "bundled": true,
5148
-          "dev": true
5149
+          "dev": true,
5150
+          "optional": true
5149 5151
         },
5150 5152
         "safer-buffer": {
5151 5153
           "version": "2.1.2",
@@ -5201,6 +5203,7 @@
5201 5203
           "version": "3.0.1",
5202 5204
           "bundled": true,
5203 5205
           "dev": true,
5206
+          "optional": true,
5204 5207
           "requires": {
5205 5208
             "ansi-regex": "^2.0.0"
5206 5209
           }
@@ -5244,12 +5247,14 @@
5244 5247
         "wrappy": {
5245 5248
           "version": "1.0.2",
5246 5249
           "bundled": true,
5247
-          "dev": true
5250
+          "dev": true,
5251
+          "optional": true
5248 5252
         },
5249 5253
         "yallist": {
5250 5254
           "version": "3.0.3",
5251 5255
           "bundled": true,
5252
-          "dev": true
5256
+          "dev": true,
5257
+          "optional": true
5253 5258
         }
5254 5259
       }
5255 5260
     },

Binārs
src/assets/logo/logo1.png Parādīt failu


+ 39 - 39
src/styles/sidebar.scss Parādīt failu

@@ -13,7 +13,7 @@
13 13
     height: 100%;
14 14
     position: fixed;
15 15
     font-size: 0px;
16
-    top: 60px;
16
+    // top: 60px;
17 17
     bottom: 0;
18 18
     left: 0;
19 19
     z-index: 1001;
@@ -47,48 +47,48 @@
47 47
     }
48 48
     .el-menu {
49 49
       border: none;
50
-      min-height: 100%;
50
+      // min-height: 100%;
51 51
       width: 100% !important;
52 52
     }
53 53
   }
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;
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;
72 72
         
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
-  }
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
+  // }
92 92
   .sidebar-container .nest-menu .el-submenu>.el-submenu__title,
93 93
   .sidebar-container .el-submenu .el-menu-item {
94 94
     // min-width: 180px !important;

+ 11 - 2
src/views/layout/Layout.vue Parādīt failu

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

+ 1 - 1
src/views/layout/components/AppMain.vue Parādīt failu

@@ -28,7 +28,7 @@ export default {
28 28
   min-height: calc(100vh - 120px);
29 29
   position: relative;
30 30
   overflow: hidden;
31
-  margin-top: 50px;
31
+  margin-top: 40px;
32 32
    background: #f3f3f3;
33 33
   
34 34
 }

+ 3 - 4
src/views/layout/components/Navbar.vue Parādīt failu

@@ -11,7 +11,7 @@
11 11
         </span>
12 12
         <!-- </el-dropdown> -->
13 13
       </div>
14
-      <div class="system-nav" v-if="this.$store.getters.xt_user.xt_role_exist">
14
+      <!-- <div class="system-nav" v-if="this.$store.getters.xt_user.xt_role_exist">
15 15
         <div class="system-nav-menu ">
16 16
           <a :href="XTWebsit()">
17 17
             <span><i class="icon iconfont icon-jiankangshuidi"></i> 血透管理</span>
@@ -19,7 +19,6 @@
19 19
         </div>
20 20
         <div class="system-nav-menu" v-if="this.$store.getters.xt_user.cdm_role_exist">
21 21
           <a :href="CDMWebsit()">
22
-          <!-- <a href=" http://cdm.test.sgjyun.com/"> -->
23 22
             <span><i class="icon iconfont icon-manbing-xuanzhong"></i> 慢病管理</span>
24 23
           </a>
25 24
         </div>
@@ -38,7 +37,7 @@
38 37
             <span><i class="icon iconfont icon-suoyou"></i> 应用</span>
39 38
           </a>
40 39
         </div>
41
-      </div>
40
+      </div> -->
42 41
 
43 42
       <div class="right-menu">
44 43
         <el-dropdown class="avatar-container right-menu-item" trigger="click"   @command="handleCommand">
@@ -168,7 +167,7 @@
168 167
     width: 162px;
169 168
     display: flex;
170 169
     align-items: center;
171
-    height: 60px;
170
+    height: 50px;
172 171
     text-align: center;
173 172
     justify-content: center;
174 173
     padding: 10px 0;

+ 80 - 3
src/views/layout/components/Sidebar/SidebarItem.vue Parādīt failu

@@ -1,7 +1,7 @@
1 1
 <template>
2 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 5
         <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
6 6
           <svg-icon v-if="onlyOneChild.meta&&onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
7 7
           <span v-if="onlyOneChild.meta&&onlyOneChild.meta.title" slot="title">{{generateTitle(onlyOneChild.meta.title)}}</span>
@@ -24,7 +24,30 @@
24 24
             </el-menu-item>
25 25
           </router-link>
26 26
         </template>
27
-      </el-submenu>
27
+      </el-submenu> -->
28
+
29
+      <div v-if="hasOneShowingChild(item.children) && !onlyOneChild.children && !item.alwaysShow" @click="onClick(item)">
30
+        <router-link :to="resolvePath(onlyOneChild.path)">
31
+          <el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{ 'submenu-title-noDropdown': !isNest }">
32
+            <svg-icon v-if="onlyOneChild.meta && onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
33
+            <span v-if="onlyOneChild.meta && onlyOneChild.meta.title" slot="title">{{ generateTitle(onlyOneChild.meta.title) }}</span>
34
+          </el-menu-item>
35
+        </router-link>
36
+        
37
+      </div>
38
+
39
+        <div v-else @click="onClick(item)">
40
+          <router-link :to="resolvePath(item.children[0].path)">
41
+            <el-menu-item :index="item.path">
42
+              <template slot="title">
43
+                <svg-icon v-if="item.meta && item.meta.icon" :icon-class="item.meta.icon"></svg-icon>
44
+                <span v-if="item.meta && item.meta.title" slot="title">
45
+                  {{ generateTitle(item.meta.title) }}
46
+                </span>
47
+              </template>
48
+            </el-menu-item>
49
+          </router-link>
50
+        </div>
28 51
 
29 52
   </div>
30 53
 </template>
@@ -33,6 +56,8 @@
33 56
 import path from 'path'
34 57
 import { generateTitle } from '@/utils/i18n'
35 58
 
59
+import { mapGetters } from "vuex";
60
+
36 61
 export default {
37 62
   name: 'SidebarItem',
38 63
   props: {
@@ -49,6 +74,9 @@ export default {
49 74
       type: String,
50 75
       default: ''
51 76
     }
77
+  },
78
+   computed: {
79
+    ...mapGetters(["permission_routers"])
52 80
   },
53 81
   data() {
54 82
     return {
@@ -74,8 +102,57 @@ export default {
74 102
     resolvePath(...paths) {
75 103
       return path.resolve(this.basePath, ...paths)
76 104
     },
77
-    generateTitle
105
+    generateTitle,
106
+    onClick(index) {
107
+      this.permission_routers.map((item, i) => {
108
+        if (this.isObjectValueEqual(item, index)) {
109
+          this.$emit("a", i);
110
+        }
111
+      });
112
+    },
113
+    isObjectValueEqual(a, b) {
114
+      var aProps = Object.getOwnPropertyNames(a);
115
+      var bProps = Object.getOwnPropertyNames(b);
116
+
117
+      if (aProps.length != bProps.length) {
118
+        return false;
119
+      }
120
+
121
+      for (var i = 0; i < aProps.length; i++) {
122
+        var propName = aProps[i];
123
+
124
+        if (a[propName] !== b[propName]) {
125
+          return false;
126
+        }
127
+      }
128
+
129
+      return true;
130
+    }
78 131
   }
79 132
 }
80 133
 </script>
81 134
 
135
+<style lang="scss">
136
+.menu-wrapper{
137
+  .el-menu-item{
138
+   background-color:#1F2D3D !important;
139
+   color: #fff !important;
140
+  }
141
+  .el-menu{
142
+    background-color:#1F2D3D !important;
143
+  }
144
+  .el-submenu__title{
145
+    background-color:#1F2D3D !important;
146
+    color: #fff !important;
147
+    height: 32px !important;
148
+    line-height: 32px !important;
149
+  }
150
+  .router-link-exact-active{
151
+    color: rgb(64, 158, 255) !important;
152
+    .el-menu-item{
153
+      color: rgb(64, 158, 255) !important;
154
+    }
155
+  }
156
+}
157
+
158
+</style>

+ 86 - 2
src/views/layout/components/Sidebar/index.vue Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <el-scrollbar wrapClass="scrollbar-wrapper">
3
-    <div class="sideColumn">
3
+    <!-- <div class="sideColumn">
4 4
        <hamburger class="hamburger-container" :toggleClick="toggleSideBar" :isActive="sidebar.opened"></hamburger>      
5 5
     </div>
6 6
     <el-menu
@@ -12,8 +12,44 @@
12 12
       background-color="#304156"
13 13
       text-color="#bfcbd9"
14 14
       active-text-color="#409EFF"
15
+    > -->
16
+    <div class="logo">
17
+      <img src="../../../../assets/logo/logo1.png" alt />
18
+    </div>
19
+    <el-menu
20
+      mode="vertical"
21
+      :unique-opened="uniqueOpened"
22
+      :show-timeout="200"
23
+      :default-active="$route.path"
24
+      background-color="#304156"
25
+      text-color="#bfcbd9"
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="XTWebsit()">
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.scrm_role_exist" index="102">
46
+        <a :href="SCRMWebsit()">
47
+          <i class="icon iconfont icon-service_fill" style="margin-right:4px"></i>
48
+          <span
49
+            slot="title"
50
+          >SCRM</span>
51
+        </a>
52
+      </el-menu-item>
17 53
     </el-menu>
18 54
   </el-scrollbar>
19 55
 </template>
@@ -35,12 +71,32 @@ export default {
35 71
   data(){
36 72
     return{
37 73
       uniqueOpened:true,
74
+      activeClass: 0,
75
+      index: 0
38 76
     }
39 77
   },
40 78
   methods:{
41 79
     toggleSideBar() {
42 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 102
 </script>
@@ -83,6 +139,34 @@ export default {
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 153
 </style>
88 154
 
155
+<style lang="scss">
156
+.scrollbar-wrapper {
157
+  background-color: #1F2D3D;
158
+  .el-menu{
159
+    background-color: #1F2D3D !important;
160
+  }
161
+  .el-menu-item{
162
+    height: 32px !important;
163
+    line-height: 32px !important;
164
+    background-color: #1F2D3D !important;
165
+    color: #fff !important;
166
+    i{
167
+      color: #fff;
168
+    }
169
+  }
170
+}
171
+</style>
172
+

+ 85 - 18
src/views/layout/components/TagsView.vue Parādīt failu

@@ -1,6 +1,6 @@
1 1
 <template>
2 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 4
       <router-link 
5 5
         ref='tag' 
6 6
         class="tags-view-item" 
@@ -17,41 +17,83 @@
17 17
       <li @click="closeSelectedTag(selectedTag)">{{$t('tagsView.close')}}</li>
18 18
       <li @click="closeOthersTags">{{$t('tagsView.closeOthers')}}</li>
19 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 45
   </div>
22 46
 </template>
23 47
 
24 48
 <script>
25 49
 import ScrollPane from '@/components/ScrollPane'
26 50
 import { generateTitle } from '@/utils/i18n'
51
+
52
+import { mapGetters } from "vuex";
27 53
   
28 54
 export default {
29 55
   components: { ScrollPane },
56
+  props: {
57
+    index: Number,
58
+  },
30 59
   data() {
31 60
     return {
32 61
       visible: false,
33 62
       top: 0,
34 63
       left: 0,
35
-      selectedTag: {}
64
+      selectedTag: {},
65
+      newIndex: 0,
66
+      activeClass: 0,
36 67
     }
37 68
   },
38 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 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
+    this.newIndex = 3
55 97
   },
56 98
   mounted() {
57 99
     this.addViewTags()
@@ -116,7 +158,11 @@ export default {
116 158
     },
117 159
     closeMenu() {
118 160
       this.visible = false
119
-    }
161
+    },
162
+    onClick(index) {
163
+      // console.log(index);
164
+      this.activeClass = index;
165
+    },
120 166
   }
121 167
 }
122 168
 </script>
@@ -125,13 +171,14 @@ export default {
125 171
 .tags-view-container {
126 172
   height: 60px;
127 173
   .tags-view-wrapper {
174
+    width: 100%;
128 175
     background: #fff;
129 176
     height: 50px;
130 177
     border-bottom: 1px solid #d8dce5;
131 178
     box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
132 179
     position: fixed;
133 180
     z-index: 1000;
134
-    top: 60px;
181
+    top: 50px;
135 182
     overflow-x: scroll;
136 183
     /* 针对缺省样式 (必须的) */
137 184
       &::-webkit-scrollbar {
@@ -222,6 +269,26 @@ export default {
222 269
       }
223 270
     }
224 271
   }
272
+  .tagsBox {
273
+    display: flex;
274
+    align-items: center;
275
+    height: 100%;
276
+    .tagsOne {
277
+      .newTags {
278
+        border: 1px solid rgba(235, 238, 240, 1);
279
+        border-radius: 2px;
280
+        padding: 8px 12px;
281
+        margin-left: 10px;
282
+        font-size: 14px;
283
+      }
284
+    }
285
+    .active {
286
+      border: 1px solid rgba(64, 158, 255, 1);
287
+      background: rgba(64, 158, 255, 1);
288
+      border-radius: 2px;
289
+      color: #fff;
290
+    }
291
+  }
225 292
 }
226 293
 </style>
227 294