index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div style="padding: 0px 35px; display: flex; justify-content: space-between">
  3. <div>
  4. <border-panel
  5. height="302px"
  6. style="margin-bottom: 6px; cursor: pointer"
  7. title="基础信息"
  8. @click="openBasicModal"
  9. >
  10. <BasicInfo :qy="qy" />
  11. </border-panel>
  12. <border-panel height="346px" style="margin-bottom: 6px" title="隐患排查">
  13. <HiddenDangerDetection :qy="qy" />
  14. </border-panel>
  15. <border-panel height="296px" title="自主管理">
  16. <AutonomousManagement :qy="qy" />
  17. </border-panel>
  18. </div>
  19. <div class="display: flex;">
  20. <div class="map" style="position: relative;">
  21. <MapCharts />
  22. <div style="position: absolute; top:10px; width: 500px;">
  23. <SearchBox :area.sync="qy"/>
  24. </div>
  25. </div>
  26. <div>
  27. <border-panel
  28. title="警情动态"
  29. width="938px"
  30. height="321px"
  31. :header-type="1"
  32. >
  33. <AlarmingSituationDynamics :PoliceList="PoliceList" />
  34. </border-panel>
  35. </div>
  36. </div>
  37. <div>
  38. <border-panel height="311px" style="margin-bottom: 6px" title="风险预警">
  39. <RiskWarning :riskList="riskList" />
  40. </border-panel>
  41. <border-panel height="331px" style="margin-bottom: 6px" title="智慧消防">
  42. <WisdomFire :frieList="frieList" :iotList="iotList" />
  43. </border-panel>
  44. <border-panel height="298px" title="火灾指标">
  45. <FireIndex />
  46. <template #ext-header>
  47. <!-- TODO 实现火灾指标日期范围切换事件 -->
  48. <button-block :items="['月', '年']" />
  49. </template>
  50. </border-panel>
  51. </div>
  52. <basic-modal top="120px" ref="basicInfoModal" title="基本信息">
  53. <BasicInfoModalContent :qy="qy" />
  54. </basic-modal>
  55. </div>
  56. </template>
  57. <script>
  58. import BasicInfo from "./components/BasicInfo.vue";
  59. import AlarmingSituationDynamics from "./components/AlarmingSituationDynamics.vue";
  60. import AutonomousManagement from "./components/AutonomousManagement.vue";
  61. import HiddenDangerDetection from "./components/HiddenDangerDetection/index.vue";
  62. import MapCharts from "./components/MapCharts.vue";
  63. import RiskWarning from "./components/RiskWarning.vue";
  64. import WisdomFire from "./components/WisdomFire.vue";
  65. import FireIndex from "./components/FireIndex/index.vue";
  66. import BasicInfoModalContent from "./components/BasicInfoModalContent.vue";
  67. import SearchBox from '@/components/SearchBox.vue';
  68. import { totaldata,getJqdt,getZxgjtj ,getJrjzsbs} from "@/api/index.js";
  69. export default {
  70. name: "HomePage",
  71. components: {
  72. BasicInfo,
  73. WisdomFire,
  74. AlarmingSituationDynamics,
  75. MapCharts,
  76. RiskWarning,
  77. AutonomousManagement,
  78. HiddenDangerDetection,
  79. FireIndex,
  80. BasicInfoModalContent,
  81. SearchBox
  82. },
  83. data(){
  84. return{
  85. riskList:[],
  86. // 传参
  87. qy:'重庆市',
  88. params:{
  89. pageSize:100,
  90. pageNum:1,
  91. },
  92. PoliceList:[],
  93. frieList:{},
  94. iotList:{},
  95. }
  96. },
  97. watch:{
  98. qy(){
  99. this.getList()
  100. this.getFireList()
  101. this.getIotList()
  102. }
  103. },
  104. methods: {
  105. openBasicModal() {
  106. this.showModal("basicInfoModal");
  107. },
  108. // 风险预警
  109. getList(){
  110. totaldata({...this.params,qy:this.qy==="重庆市"?"":this.qy}).then(res=>{
  111. if(res.data.code==200){
  112. this.riskList=res.data.rows
  113. }
  114. }).catch(error=>{
  115. this.$message({
  116. message: res.data.msg,
  117. type: "error"
  118. });
  119. })
  120. },
  121. getStaic(){
  122. getJqdt(this.params).then(res=>{
  123. this.PoliceList=res.data.rows
  124. })
  125. },
  126. //智慧消防
  127. getFireList(){
  128. getZxgjtj({...this.params,name:this.qy==="重庆市"?"":this.qy}).then(res=>{
  129. this.frieList=res.data.rows[0]
  130. console.log('------',this.frieList);
  131. })
  132. },
  133. // 物联网栋数
  134. getIotList(){
  135. getJrjzsbs({...this.params,name:this.qy==="重庆市"?"":this.qy}).then(res=>{
  136. this.iotList=res.data.rows[0]
  137. })
  138. }
  139. },
  140. created(){
  141. this.getList()
  142. this.getStaic()
  143. this.getFireList()
  144. this.getIotList()
  145. }
  146. };
  147. </script>
  148. <style scoped>
  149. .map {
  150. flex: 1;
  151. }
  152. </style>