1
0

index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <div style="padding: 0px 35px; display: flex; justify-content: space-between">
  3. <div style="z-index: 100">
  4. <border-panel
  5. height="492px"
  6. :header-type="4"
  7. width="544px"
  8. style="margin-bottom: 6px"
  9. title="总体情况"
  10. >
  11. <TotalityInfo
  12. :data="ztqkData"
  13. v-if="ztqkData && ztqkDwtjData"
  14. :dwData="ztqkDwtjData"
  15. />
  16. </border-panel>
  17. <border-panel
  18. height="450px"
  19. :header-type="4"
  20. width="544px"
  21. style="margin-bottom: 6px"
  22. title="视频监控"
  23. >
  24. <IotVideo
  25. :list="caremaData"
  26. v-if="caremaData && caremaData.length > 0"
  27. />
  28. </border-panel>
  29. </div>
  30. <div class="map-container cover">
  31. <MapCharts />
  32. <div style="position: absolute;width: 500px; left:90px; top: 10px;">
  33. <SearchBox :area.sync="qx" />
  34. </div>
  35. </div>
  36. <div style="z-index: 100">
  37. <border-panel
  38. height="469px"
  39. width="540px"
  40. :header-type="4"
  41. style="margin-bottom: 10px"
  42. title="区域分布"
  43. >
  44. <RegionalDistribution :qx="qx" />
  45. </border-panel>
  46. <border-panel
  47. height="469px"
  48. width="540px"
  49. :header-type="4"
  50. style="margin-bottom: 6px"
  51. title="告警处置"
  52. >
  53. <AlarmHandling :qx="qx" />
  54. </border-panel>
  55. </div>
  56. </div>
  57. </template>
  58. <script>
  59. import TotalityInfo from "./components/TotalityInfo.vue";
  60. import IotVideo from "./components/IotVideo.vue";
  61. import AlarmHandling from "./components/AlarmHandling.vue";
  62. import RegionalDistribution from "./components/RegionalDistribution.vue";
  63. import MapCharts from "../Home/components/MapCharts.vue";
  64. import SearchBox from '../../components/SearchBox.vue'
  65. import {
  66. getZtqk,
  67. getZtqkDwtj,
  68. getGqcz,
  69. getDeviceList,
  70. } from "@/api/iot.js";
  71. export default {
  72. name: "IotPage",
  73. components: {
  74. TotalityInfo,
  75. RegionalDistribution,
  76. IotVideo,
  77. AlarmHandling,
  78. MapCharts,
  79. SearchBox
  80. },
  81. data() {
  82. return {
  83. qx: "重庆市",
  84. ztqkData: null,
  85. ztqkDwtjData: null,
  86. caremaData: [],
  87. };
  88. },
  89. methods: {
  90. async getList() {
  91. // 获取总体情况
  92. const ztqkParam = {
  93. pageNum: 1,
  94. pageSize: 100,
  95. name: this.qx === '重庆市' ? "" : this.qx,
  96. };
  97. getZtqk(ztqkParam).then((res) => {
  98. this.ztqkData = res.data.rows[0];
  99. });
  100. // 检测点位统计
  101. const ztqkDwtjParam = {
  102. pageNum: 1,
  103. pageSize: 100,
  104. name: this.qx === '重庆市' ? "" : this.qx,
  105. };
  106. getZtqkDwtj(ztqkDwtjParam).then((res) => {
  107. this.ztqkDwtjData = res.data.rows[0];
  108. });
  109. let caremaData = [];
  110. // 获取视频数据
  111. const deviceParam = {
  112. pageNum: 1,
  113. pageSize: 100,
  114. qx: this.qx === '重庆市' ? "" : this.qx,
  115. zt: "在线",
  116. sblx: "生命通道监测",
  117. };
  118. const res = await getDeviceList(deviceParam);
  119. caremaData = caremaData.concat(res.data.rows);
  120. const deviceParam2 = {
  121. pageNum: 1,
  122. pageSize: 100,
  123. qx: this.qx === '重庆市' ? "" : this.qx,
  124. zt: "在线",
  125. sblx: "消防控制室监控",
  126. };
  127. const res2 = await getDeviceList(deviceParam2);
  128. caremaData = caremaData.concat(res2.data.rows);
  129. // 随机取10个
  130. const showCaremarData = [];
  131. for (let i = 0; i < 10; i++) {
  132. const no = Math.ceil(Math.random() * caremaData.length);
  133. showCaremarData.push(caremaData.find((p, j) => j === no));
  134. }
  135. this.caremaData = showCaremarData;
  136. },
  137. },
  138. created() {
  139. this.getList();
  140. },
  141. };
  142. </script>
  143. <style scoped lang="less">
  144. .map-container {
  145. position: fixed;
  146. z-index: 50;
  147. left: 50%;
  148. transform: translateX(-50%);
  149. display: flex;
  150. padding-top: 150px;
  151. align-items: center;
  152. width: 920px;
  153. }
  154. // .map-container::after {
  155. // position: absolute;
  156. // content: "";
  157. // width: 100%;
  158. // height: 100%;
  159. // top: 0;
  160. // left: 0;
  161. // box-shadow: 0 0 100px 100px #070b13 inset;
  162. // pointer-events: none;
  163. // }
  164. </style>