index.vue 4.2 KB

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