index.vue 3.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <el-scrollbar wrapClass="scrollbar-wrapper">
  3. <!-- <div class="sideColumn">
  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 />
  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"
  27. >
  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.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>
  53. </el-menu>
  54. </el-scrollbar>
  55. </template>
  56. <script>
  57. import { mapGetters } from "vuex";
  58. import SidebarItem from "./SidebarItem";
  59. import Hamburger from "@/components/Hamburger";
  60. export default {
  61. components: { SidebarItem,Hamburger },
  62. computed: {
  63. ...mapGetters(["permission_routers", "sidebar"]),
  64. isCollapse() {
  65. return !this.sidebar.opened;
  66. }
  67. },
  68. data(){
  69. return{
  70. uniqueOpened:true,
  71. activeClass: 0,
  72. index: 0
  73. }
  74. },
  75. methods:{
  76. toggleSideBar() {
  77. this.$store.dispatch("toggleSideBar");
  78. },
  79. b(index) {
  80. // this.index = index;
  81. // this.activeClass = index;
  82. // console.log('b',index)
  83. this.$emit("callBackIndex", index);
  84. },
  85. XTWebsit() {
  86. return process.env.XT_HOST
  87. },
  88. CDMWebsit() {
  89. return process.env.CDM_HOST;
  90. },
  91. SCRMWebsit() {
  92. return process.env.SRCM_HOST;
  93. },
  94. MircoMallWebsit() {
  95. return process.env.MIRCO_MALL_HOST;
  96. },
  97. }
  98. };
  99. </script>
  100. <style rel="stylesheet/scss" lang="scss" scoped>
  101. .sideColumn{
  102. background-color: rgb(48, 65, 86);
  103. .head {
  104. text-align: center;
  105. padding: 20px 0 0 0;
  106. .tx {
  107. .img {
  108. width: 45px;
  109. height: 45px;
  110. border-radius: 50%;
  111. -o-object-fit: cover;
  112. object-fit: cover;
  113. -o-object-position: center;
  114. object-position: center;
  115. }
  116. }
  117. .title {
  118. font-size: 14px;
  119. color: #bfcbd9;
  120. padding: 10px 10px 15px 10px;
  121. line-height: 22px;
  122. }
  123. }
  124. .headShrink{
  125. .tx{
  126. .img{
  127. width: 30px;
  128. height: 30px;
  129. }
  130. }
  131. .title{
  132. display: none;
  133. }
  134. }
  135. }
  136. .logo {
  137. width: 100px;
  138. height: 32px;
  139. margin: 20px auto;
  140. img {
  141. width: 100%;
  142. height: 100%;
  143. display: block;
  144. }
  145. }
  146. </style>
  147. <style lang="scss">
  148. .scrollbar-wrapper {
  149. background-color: #1F2D3D;
  150. .el-menu{
  151. background-color: #1F2D3D !important;
  152. }
  153. .el-menu-item{
  154. height: 32px !important;
  155. line-height: 32px !important;
  156. background-color: #1F2D3D !important;
  157. color: #fff !important;
  158. i{
  159. color: #fff;
  160. }
  161. }
  162. }
  163. </style>