Console.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class="console">
  3. <div class="other-people">
  4. <div class="image-border image-border1"></div>
  5. <div class="image-border image-border2"></div>
  6. <div class="image-border image-border3"></div>
  7. <div class="image-border image-border4"></div>
  8. <div class="other-people-title">
  9. 控制台
  10. </div>
  11. <div class="cslist cubeContent">
  12. <div class="cstitle">
  13. 安全监控首页
  14. </div>
  15. <div class="loft cspart">
  16. <div class="lt_title">
  17. 楼层
  18. </div>
  19. <el-row :gutter="21">
  20. <el-col :span="8" v-for="(loft,i) in loftList">
  21. <div :class="[{'active':loftIndex == i+1 }]" @click="ClickGetInfo(1,i)">
  22. <div class="grid-content bg-purple"> {{loft.name}}</div>
  23. </div>
  24. </el-col>
  25. </el-row>
  26. </div>
  27. <div class="manage cspart">
  28. <div class="lt_title">
  29. 楼层管理区域
  30. </div>
  31. <el-row :gutter="21">
  32. <el-col :span="8" v-for="(manage,j) in manageList">
  33. <div :class="[{'active':manageIndex ==j+1 }]" @click="ClickGetInfo(2,j)">
  34. <div class="grid-content bg-purple">{{manage.name}}</div>
  35. </div>
  36. </el-col>
  37. </el-row>
  38. </div>
  39. <div class="equip cspart">
  40. <div class="lt_title">
  41. SignalDigger设备
  42. </div>
  43. <el-row :gutter="21">
  44. <el-col :span="8" v-for="(equip,t) in equipList">
  45. <div :class="[{'active':equipIndex == t+1 }]" @click="ClickGetInfo(3,t)">
  46. <div class="grid-content bg-purple"> {{equip.name}}</div>
  47. </div>
  48. </el-col>
  49. </el-row>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </template>
  55. <script>
  56. import {getLoftInfo} from '../api/getApiRes.js'
  57. export default {
  58. data() {
  59. return {
  60. loftList: [],
  61. manageList: [],
  62. equipList: [],
  63. loftIndex: 0,
  64. manageIndex: 0,
  65. equipIndex: 0,
  66. };
  67. },
  68. mounted() {
  69. this.getLoftList();
  70. },
  71. methods: {
  72. // 获取楼层信息
  73. ClickGetInfo(list, index) {
  74. // 切换到选中
  75. this.loftIndex = 0;
  76. this.manageIndex = 0;
  77. this.equipIndex = 0;
  78. let thisBtn = {};
  79. switch (parseInt(list)) {
  80. case 1:
  81. this.loftIndex = index + 1;
  82. thisBtn = this.loftList[index];
  83. break;
  84. case 2:
  85. this.manageIndex = index + 1;
  86. thisBtn = this.manageList[index];
  87. break;
  88. case 3:
  89. this.equipIndex = index + 1;
  90. thisBtn = this.equipList[index];
  91. break;
  92. }
  93. },
  94. // 获取楼层信息
  95. getLoftList() {
  96. let postdata = {};
  97. getLoftInfo(postdata).then(res => {
  98. let json = res;
  99. if (json.Code == 0) {
  100. this.loftList = json.Rs;
  101. this.manageList = json.Rs;
  102. this.equipList = json.Rs;
  103. } else {
  104. that.$message.error(json.Memo);
  105. }
  106. })
  107. }
  108. }
  109. }
  110. </script>
  111. <style scoped>
  112. .console {
  113. float: left;
  114. color: #6DC1FF;
  115. }
  116. .other-people {
  117. width: 350px;
  118. min-height: 919px;
  119. margin-left: 0;
  120. }
  121. .cstitle {
  122. width: 314px;
  123. height: 45px;
  124. overflow: hidden;
  125. display: block;
  126. margin: 0 auto;
  127. background: #0B2851;
  128. border: 1px solid #005EA2;
  129. line-height: 45px;
  130. margin-bottom: 26px;
  131. }
  132. .cspart {
  133. width: 314px;
  134. overflow: hidden;
  135. display: block;
  136. margin: 0 auto;
  137. margin-bottom: 22px;
  138. }
  139. .lt_title {
  140. text-align: left;
  141. font-size: 14px;
  142. margin-bottom: 16px;
  143. }
  144. .cspart .bg-purple {
  145. height: 30px;
  146. background: rgba(27, 86, 200, 0.14);
  147. border: 1px solid #005EA2;
  148. line-height: 30px;
  149. margin-bottom: 9px;
  150. cursor: pointer;
  151. font-size: 12px;
  152. }
  153. .active {
  154. background: #0162AA;
  155. border-color: #6DC1FF;
  156. color: #6DC1FF
  157. }
  158. .bg-purple {
  159. overflow: hidden;
  160. }
  161. </style>