Index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="container">
  3. <el-container>
  4. <el-header>
  5. <Headside @lefthide="left_hide"></Headside>
  6. </el-header>
  7. <el-aside :class="[{'shortElaside':isCollapse},{'lognElaside':!isCollapse}]">
  8. <Navside :isCollapse="isCollapse" @TabsAdd="handleTabsAdd"></Navside>
  9. </el-aside>
  10. <el-container class="indexContainer">
  11. <el-main>
  12. <keep-alive>
  13. <router-view></router-view>
  14. </keep-alive>
  15. </el-main>
  16. <el-footer>
  17. <p class="footerP">Copyright © 2020 <a href="http://signal.tickdig.com:85/#/">HTTP://SIGNAL.TICKDIG.COM/</a> TICKDIG 版权所有</p>
  18. </el-footer>
  19. </el-container>
  20. </el-container>
  21. </div>
  22. </template>
  23. <script>
  24. // @ is an alias to /src
  25. import Headside from '@/components/Headside.vue'
  26. import Navside from '@/components/Navside.vue'
  27. // import Tabs from '@/components/Tabs.vue'
  28. import Navs from '../api/Navs';
  29. export default {
  30. name: 'Home',
  31. data() {
  32. return {
  33. isCollapse: true,
  34. aSideState: false,
  35. thisClick: 0,
  36. tabwildState: 1,
  37. navs: Navs,
  38. handleTabsList: [{
  39. title: '系统首页',
  40. name: '1',
  41. clmurl: '/',
  42. }],
  43. editableTabsValue: '1'
  44. }
  45. },
  46. methods: {
  47. left_hide() {
  48. this.aSideState = !this.aSideState;
  49. this.isCollapse = !this.isCollapse;
  50. },
  51. handleTabsAdd: function (data) {
  52. let that = this;
  53. let str = ""; //存放第一层遍历的值
  54. let strArray = []; //存放第二层遍历的值
  55. let item = {};
  56. if (data == 99) {
  57. // 退出直接后面不处理了
  58. return false
  59. }
  60. if (data == 1) {
  61. // 首页直接处理了
  62. item = {
  63. title: '系统首页',
  64. name: '系统首页',
  65. clmurl: '/',
  66. };
  67. } else {
  68. for (var i = 0; i < Navs.length; i++) {
  69. str += Navs[i].id; //获取第一层的值
  70. for (var j = 0; j < Navs[i].childs.length; j++) {
  71. if (Navs[i].childs[j].clmid == data) {
  72. strArray.push(Navs[i].childs[j])
  73. }
  74. }
  75. }
  76. item = {
  77. title: strArray[0].clmname,
  78. name: strArray[0].clmname,
  79. clmurl: strArray[0].clmurl,
  80. };
  81. }
  82. // 去掉重复的
  83. that.handleTabsList.map(function (e, i) {
  84. if (e.title == item.title) {
  85. that.handleTabsList.splice(i, 1)
  86. }
  87. });
  88. that.handleTabsList.push(item);
  89. that.editableTabsValue = item.title;
  90. },
  91. },
  92. components: {
  93. Headside, Navside
  94. }
  95. }
  96. </script>
  97. <!-- Add "scoped" attribute to limit CSS to this component only -->
  98. <style>
  99. .el-main {
  100. padding: 10px;
  101. }
  102. .container {
  103. position: absolute;
  104. top: 0;
  105. left: 0;
  106. right: 0;
  107. bottom: 0;
  108. width: 100%;
  109. height: 100%;
  110. background-color: #01355B;
  111. background: url("../assets/img/mainBg.png") top center no-repeat;
  112. background-size: 100% 100%;
  113. overflow-y: hidden;
  114. }
  115. .container::-webkit-scrollbar { /*滚动条整体样式*/
  116. width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
  117. height: 1px;
  118. }
  119. .container::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
  120. border-radius: 10px;
  121. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  122. background: #01355B;
  123. }
  124. .container::-webkit-scrollbar-track { /*滚动条里面轨道*/
  125. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  126. border-radius: 10px;
  127. background: none;
  128. }
  129. .el-header {
  130. height: 60px !important;
  131. padding: 0 !important;
  132. }
  133. .shortElaside {
  134. width: 60px !important;
  135. overflow: hidden;
  136. height: 100%;
  137. float: left;
  138. }
  139. .lognElaside {
  140. width: 320px !important;
  141. overflow: hidden;
  142. height: 100%;
  143. float: left;
  144. }
  145. /deep/ .nav {
  146. width: 60px;
  147. }
  148. .el-main {
  149. /*overflow: hidden;*/
  150. }
  151. .indexContainer {
  152. position: absolute;
  153. top: 60px;
  154. left: 70px;
  155. bottom: 3px;
  156. width: 96%;
  157. overflow: visible;
  158. }
  159. .el-main::-webkit-scrollbar { /*滚动条整体样式*/
  160. width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
  161. height: 1px;
  162. }
  163. .el-main::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
  164. border-radius: 10px;
  165. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  166. background: #01355B;
  167. }
  168. .el-main::-webkit-scrollbar-track { /*滚动条里面轨道*/
  169. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  170. border-radius: 10px;
  171. background: none;
  172. }
  173. .footerP {
  174. margin: 5px 0;
  175. padding: 0;
  176. }
  177. .footerP a {
  178. color: #2c3e50;
  179. }
  180. .el-footer {
  181. height: 30px !important;
  182. padding: 0 5px;
  183. }
  184. </style>