index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <div style="padding: 0px 35px; display: flex; justify-content: space-between">
  3. <div>
  4. <border-panel height="301px" style="margin-bottom: 2px" title="关键指标" header-cursor="pointer" @click-header="openBasicModal(1)">
  5. <FireIndex :type="fireIndexType" :qx="qx" @open="openBasicModal(1)" />
  6. <template #ext-header>
  7. <button-block :items="['月', '年']" @select-item="selectFireIndexItemHandler" />
  8. </template>
  9. </border-panel>
  10. <border-panel height="337px" style="margin-bottom: 2px" title="起火原因" @click-header="openBasicModal(2)">
  11. <FireReason :qx="qx" />
  12. </border-panel>
  13. <border-panel height="313px" title="起火场所" @click-header="openBasicModal(3)">
  14. <FireAddressType :qx="qx" />
  15. <template>
  16. </template>
  17. </border-panel>
  18. </div>
  19. <div>
  20. <div>
  21. <div style="width: 910px; display: flex; position: relative;">
  22. <MapCharts :legend="legendData" :mapHeatData="heatMap" :formatter="showLabel" :qx="qx" @selectArea="area => qx = area" />
  23. <div style="position: absolute;width: 500px; left: 10px;top: 10px;">
  24. <search-box :area.sync="qx" />
  25. </div>
  26. </div>
  27. </div>
  28. <div class="center-box">
  29. <border-panel class="fire-time" header-cursor="pointer" :header-type="3" height="313px" width="955px"
  30. style="margin: 7px;cursor: pointer;" title="火灾时段(24时)" @click-header="opemFries">
  31. <FireTime :qx="qx" :type="type" />
  32. <template #ext-header>
  33. <button-block :items="['本年', '近5年', '季节']" @select-item="selectItemHandler" />
  34. </template>
  35. </border-panel>
  36. </div>
  37. </div>
  38. <div>
  39. <border-panel height="486px" style="margin-bottom: 7px" title="火灾分布">
  40. <FireDistribution :qx="qx" />
  41. </border-panel>
  42. <border-panel height="460px" title="历史火灾">
  43. <FireHistory :qx="qx" />
  44. </border-panel>
  45. </div>
  46. <basic-modal top="120px" ref="basicInfoModal" name="火灾分析">
  47. <hzfxCont :qy="qx" :idx="valNum" @callback="callback" />
  48. </basic-modal>
  49. <basic-modal top="120px" ref="HistoryModal" name="历史火灾查询">
  50. <hzfbCont :qy="qx" />
  51. </basic-modal>
  52. </div>
  53. </template>
  54. <script>
  55. import FireReason from "./components/FireReason.vue";
  56. import FireAddressType from "./components/FireAddressType.vue";
  57. import FireIndex from './components/FireIndex/index.vue'
  58. import FireDistribution from './components/FireDistribution.vue'
  59. import FireHistory from './components/FireHistory.vue'
  60. import FireTime from './components/FireTime.vue'
  61. import SearchBox from '@/components/SearchBox.vue';
  62. import MapCharts from "../Home/components/NewMapChartsCategory.vue";
  63. import hzfxCont from "./components/hzfxCont.vue";
  64. import hzfbCont from "./components/hzfbCont.vue";
  65. import { loadMapData, createInfoWindow } from '@/shared'
  66. export default {
  67. name: "FireCondition",
  68. components: {
  69. FireReason,
  70. FireAddressType,
  71. FireIndex,
  72. FireDistribution,
  73. FireHistory,
  74. FireTime,
  75. SearchBox,
  76. MapCharts,
  77. hzfxCont,
  78. hzfbCont,
  79. fireIndexType: 0,
  80. },
  81. data() {
  82. return {
  83. valNum: 1,
  84. qx: '重庆市',
  85. type: 1,
  86. heatMap: [],
  87. legendData: [],
  88. fireIndexType: 0
  89. }
  90. },
  91. created() {
  92. this.loadData()
  93. },
  94. methods: {
  95. callback(val) {
  96. this.valNum = val
  97. },
  98. selectFireIndexItemHandler(idx) {
  99. this.fireIndexType = idx
  100. },
  101. showLabel(params) {
  102. return createInfoWindow('HZQSN', params);
  103. },
  104. change(e) {
  105. this.qx = e.target.value
  106. },
  107. selectItemHandler(idx) {
  108. this.type = (idx + 1)
  109. },
  110. openBasicModal(val) {
  111. this.valNum = val;
  112. this.showModal("basicInfoModal");
  113. },
  114. loadData() {
  115. loadMapData('HZQSN').then(res => {
  116. this.heatMap = res.heatMap
  117. this.legendData = res.legendData
  118. })
  119. },
  120. opemFries() {
  121. this.showModal('HistoryModal')
  122. }
  123. }
  124. };
  125. </script>
  126. <style scoped lang="less">
  127. .center-box {
  128. // margin-top: 602px;
  129. }
  130. </style>