index.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <div style="padding: 0px 35px; display: flex; justify-content: space-between; cursor: pointer;">
  3. <div>
  4. <border-panel height="310px" style="margin-bottom: 6px" title="高层建筑统计" @click="openBasicModal(1)">
  5. <BuildNum :list="gcjztjList" :qy="qy" v-if="gcjztjList && gcjztjList.length > 0" />
  6. </border-panel>
  7. <border-panel height="320px" style="margin-bottom: 6px" title="年代分布统计" @click="openBasicModal(2)">
  8. <ChronologicDistributionStatistics :list="NdfbtjList" v-if="NdfbtjList && NdfbtjList.length > 0" />
  9. </border-panel>
  10. <border-panel height="310px" title="高度分布统计" @click="openBasicModal(3)">
  11. <HeightDistribution :list="gdfbtjList" v-if="gdfbtjList && gdfbtjList.length > 0" />
  12. </border-panel>
  13. </div>
  14. <div>
  15. <div style="
  16. width: 900px;
  17. height: 1000px;
  18. position: relative;
  19. display: flex;
  20. padding-top: 150px;
  21. ">
  22. <MapCharts :qx="qy" @selectArea="area => qy = area" />
  23. <div style="position: absolute; width: 500px; top: 10px; left: -20px">
  24. <SearchBox :area.sync="qy" />
  25. </div>
  26. </div>
  27. </div>
  28. <div>
  29. <border-panel height="521px" style="margin-bottom: 6px" title="区域分布">
  30. <Regional :list="qyfbList" :qx="qy" v-if="qyfbList && qyfbList.length > 0" />
  31. </border-panel>
  32. <border-panel height="421px" style="margin-bottom: 6px" title="建筑统计">
  33. <BuildingStatistics :list="jztjList" v-if="jztjList && jztjList.length > 0" />
  34. </border-panel>
  35. </div>
  36. <basic-modal top="120px" ref="basicInfoModal" name="高层基础信息">
  37. <jcxxCont :qy="qy" :flagVal="flagVal" />
  38. </basic-modal>
  39. </div>
  40. </template>
  41. <script>
  42. import BuildNum from "./components/BuildNum.vue";
  43. import Regional from "./components/Regional.vue";
  44. import BuildingStatistics from "./components/BuildingStatistics.vue";
  45. import HeightDistribution from "./components/HeightDistribution.vue";
  46. import ChronologicDistributionStatistics from "./components/ChronologicDistributionStatistics.vue";
  47. import MapCharts from "../Home/components/MapCharts.vue";
  48. import SearchBox from "@/components/SearchBox.vue";
  49. import jcxxCont from "./components/jcxxCont.vue";
  50. import {
  51. toFirst
  52. } from '../../utils'
  53. import {
  54. getJztj,
  55. getQyfbList,
  56. getNdfbtj,
  57. getGcjztj,
  58. getGdfbtj,
  59. } from "@/api/basicInfor.js";
  60. export default {
  61. name: "BasicPage",
  62. components: {
  63. BuildNum,
  64. Regional,
  65. BuildingStatistics,
  66. HeightDistribution,
  67. ChronologicDistributionStatistics,
  68. MapCharts,
  69. SearchBox,
  70. jcxxCont,
  71. },
  72. data() {
  73. return {
  74. qy: "重庆市",
  75. params: {
  76. pageSize: 100,
  77. pageNum: 1,
  78. },
  79. jztjList: [],
  80. qyfbList: [],
  81. NdfbtjList: [],
  82. gcjztjList: [],
  83. gdfbtjList: [],
  84. flagVal:1
  85. };
  86. },
  87. watch: {
  88. qy() {
  89. this.getList();
  90. },
  91. },
  92. methods: {
  93. openBasicModal(val) {
  94. this.flagVal=val
  95. this.showModal("basicInfoModal");
  96. },
  97. getList() {
  98. getJztj({
  99. ...this.params,
  100. qx: this.qy === "重庆市" ? "" : this.qy
  101. }).then(
  102. (res) => {
  103. this.jztjList = res.data.rows;
  104. }
  105. );
  106. getQyfbList({
  107. ...this.params,
  108. }).then((res) => {
  109. const data = res.data.rows.map(item => ({
  110. ...item,
  111. isActive: item.qx === this.qy
  112. }));
  113. this.qyfbList = toFirst(data, this.qy, 'qx')
  114. });
  115. getNdfbtj({
  116. ...this.params,
  117. qx: this.qy === "重庆市" ? "" : this.qy,
  118. }).then((res) => {
  119. this.NdfbtjList = res.data.rows;
  120. });
  121. getGcjztj({
  122. ...this.params,
  123. qx: this.qy === "重庆市" ? "" : this.qy,
  124. }).then((res) => {
  125. let lists=res.data.rows
  126. if(lists.length>0){
  127. const temp = {
  128. jzdx:'高层建筑总数',
  129. qx: this.qy,
  130. sl: lists.reduce((a,b) => a + b.sl, 0)
  131. }
  132. lists.unshift(temp)
  133. }
  134. this.gcjztjList = lists
  135. });
  136. getGdfbtj({
  137. ...this.params,
  138. pageSize: 1000,
  139. qx: this.qy === "重庆市" ? "" : this.qy,
  140. }).then((res) => {
  141. this.gdfbtjList = res.data.rows;
  142. });
  143. },
  144. },
  145. created() {
  146. this.getList();
  147. },
  148. };
  149. </script>
  150. <style scoped lang="less"></style>