Main.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <div class="mainContainer">
  3. <div class="lt" v-show="showLeft">
  4. <div class="sum-title">
  5. 控制台
  6. </div>
  7. <div class="cube">
  8. <Region :region-list="regionList"></Region>
  9. </div>
  10. <div class="cube">
  11. <Detecter :region-list="regionList"></Detecter>
  12. </div>
  13. <div class="cube">
  14. <Task></Task>
  15. </div>
  16. </div>
  17. <div class="md">
  18. <div class="cube">
  19. <signMap></signMap>
  20. </div>
  21. <br>
  22. <div class="cube">
  23. <WifiSign :wifi-rs="WifiRs"></WifiSign>
  24. </div>
  25. <br>
  26. <Scan :scan-rs="ScanRs"></Scan>
  27. </div>
  28. <div class="rt">
  29. <div class="cube">
  30. <BigRader :total-rs="totalRs"></BigRader>
  31. </div>
  32. <br>
  33. <transition name="el-zoom-in-center">
  34. <div class="cube">
  35. <HistoryRecord :history-rs="historyRs"></HistoryRecord>
  36. </div>
  37. </transition>
  38. <transition name="el-zoom-in-center">
  39. <div class="cube">
  40. <HistoryRecord :history-rs="historyRs"></HistoryRecord>
  41. </div>
  42. </transition>
  43. </div>
  44. </div>
  45. </template>
  46. <script>
  47. import signMap from '@/components/signMap.vue'
  48. import Region from '@/components/Region.vue'
  49. import Detecter from '@/components/Detecter.vue'
  50. import Task from '@/components/Task.vue'
  51. import WifiSign from '@/components/WifiSign.vue'
  52. import Scan from '@/components/Scan.vue'
  53. import HistoryRecord from '@/components/HistoryRecord.vue'
  54. import EquipInfo from '@/components/EquipInfo.vue'
  55. import runTimeRecord from '@/components/runTimeRecord.vue'
  56. import BigRader from '@/components/BigRader.vue'
  57. import {
  58. getLoftInfo,
  59. RegionDetInfolist,
  60. } from '../api/getApiRes.js'
  61. import { mapGetters, mapActions, mapState } from "vuex";
  62. import Global from "../Global"
  63. let qs = require('qs');
  64. export default {
  65. data() {
  66. return {
  67. WifiRs: [],
  68. ScanRs: [],
  69. historyRs: [],
  70. totalRs: [],
  71. equipRs: [],
  72. regionList: [],
  73. showLeft: true
  74. }
  75. },
  76. mounted() {
  77. this.init();
  78. this.showLeft = parseInt(this.$store.state.status.count) % 2 == 0
  79. },
  80. computed:{
  81. ...mapGetters({
  82. 'getCount': 'status/getCount'
  83. })
  84. },
  85. watch: {
  86. '$route': function (val) {
  87. if (val.path == '/') {
  88. this.init()
  89. }
  90. },
  91. '$store.state.status.count': function (val) {
  92. this.showLeft = parseInt(val) % 2 == 0
  93. },
  94. },
  95. methods: {
  96. init() {
  97. this.getDate()
  98. },
  99. getDate() {
  100. let that = this;
  101. let param = {
  102. token: localStorage.token,
  103. };
  104. let postdata = qs.stringify(param);
  105. that.regionList = [];
  106. getLoftInfo(postdata).then(res => {
  107. let json = res;
  108. if (json.Code == 0) {
  109. console.log(json);
  110. that.regionList = json.Rs
  111. } else {
  112. that.$message.error(json.Memo);
  113. }
  114. })
  115. },
  116. // Wifi柱状图信息传入探测器Id
  117. getDetectorWifixyInfolist(postdata) {
  118. let that = this;
  119. DetectorWifixyInfolist(postdata).then(res => {
  120. let json = res;
  121. if (json.Code == 0) {
  122. that.WifiRs = json;
  123. } else {
  124. that.$message.error(json.Memo + ',错误代码:' + json.Code);
  125. }
  126. })
  127. },
  128. ClickGetInfo(index) {
  129. }
  130. },
  131. components: {
  132. signMap,
  133. Region,
  134. Detecter,
  135. WifiSign,
  136. Scan,
  137. HistoryRecord,
  138. EquipInfo,
  139. runTimeRecord,
  140. Task,
  141. BigRader,
  142. }
  143. }
  144. </script>
  145. <style scoped>
  146. @import "../assets/css/cube.css";
  147. .mainContainer {
  148. width: 100%;
  149. overflow: hidden;
  150. display: block;
  151. margin: 0 auto;
  152. }
  153. .mainContainer .lt {
  154. width: 20%;
  155. float: left;
  156. border: 1px solid rgba(0, 147, 253, 0.24);
  157. overflow: hidden;
  158. padding-bottom: 10px;
  159. background: rgba(0, 130, 255, 0.05);
  160. margin-right: 20px;
  161. }
  162. .mainContainer .md {
  163. width: 50%;
  164. float: left;
  165. border: 1px solid rgba(0, 147, 253, 0.24);
  166. overflow: hidden;
  167. padding-bottom: 10px;
  168. background: rgba(0, 130, 255, 0.05);
  169. margin-right: 20px;
  170. }
  171. .mainContainer .rt {
  172. width: 30%;
  173. float: right;
  174. }
  175. .rt .cube {
  176. float: right;
  177. }
  178. .sum-title {
  179. width: 150px;
  180. height: 36px;
  181. font-size: 16px;
  182. line-height: 36px;
  183. color: #6DC1FF;
  184. margin: 0 auto;
  185. text-align: center;
  186. background: url("../assets/img/main/tit.png") top center no-repeat;
  187. background-size: 100%;
  188. }
  189. </style>