tjzl.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <template>
  2. <div class="thzl">
  3. <div class="content">
  4. <div class="item" v-for="(sd, index) in sdlist" :key="index">
  5. <div class="icon">
  6. <div class="iicon" :class="sd.value">{{ sd.name }}</div>
  7. </div>
  8. <div class="text">
  9. <p>土地面积(亩)</p>
  10. <span>{{ (sdata[sd.prop].area || 0).toFixed(2) }} </span>
  11. <p>宗地数(宗)</p>
  12. <span>{{ sdata[sd.prop].count || 0 }} </span>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="echartlist">
  17. <div class="echars">
  18. <ratio class="ratio_echart" ref="echartRef3"></ratio>
  19. <ratio class="ratio_echart" ref="echartRef4"></ratio>
  20. </div>
  21. <div class="echars" v-show="region == '4602'">
  22. <div class="block-title">各区县闲置情况</div>
  23. <barAndLine class="echart" ref="echartRef1"></barAndLine>
  24. </div>
  25. <div class="echars">
  26. <div class="block-title">闲置原因</div>
  27. <pie unit="亩" class="pie_echart" ref="echartRef2"></pie>
  28. </div>
  29. </div>
  30. <div class="tip">
  31. 提示:本页面土地闲置率和闲置处置率只统计2022年-2024年数据
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. import pie from "@/components/echartsTemplate/pie.vue";
  37. import ratio from "@/components/echartsTemplate/ratio.vue";
  38. import barAndLine from "@/views/cockpit/common/ThreeStackedBarAndLine.vue";
  39. import { overview, district, reason } from "@/api/Idleland.js";
  40. export default {
  41. props: {},
  42. data() {
  43. return {
  44. sdata: { suspected: {}, confirm: {}, disposal: {} },
  45. sdlist: [
  46. { name: "疑", prop: "suspected" },
  47. { name: "闲", prop: "confirm" },
  48. { name: "处", prop: "disposal" },
  49. ],
  50. jdData: {
  51. legend_data: ["认定闲置土地", "已处置闲置土地", "闲置率", "处置率"],
  52. x_data: [],
  53. legendmap: [
  54. { type: "bar" },
  55. { type: "bar" },
  56. { type: "line", color: "#D9001B" },
  57. { type: "line" },
  58. ],
  59. yAxis: [{ name: "土地面积(亩)" }, { name: "比率(%)" }],
  60. params: {},
  61. region: "",
  62. },
  63. };
  64. },
  65. components: {
  66. pie,
  67. ratio,
  68. barAndLine,
  69. },
  70. mounted() {
  71. this.getData();
  72. },
  73. methods: {
  74. changeData(name, updata) {
  75. this[name] = updata;
  76. },
  77. regionChange(region) {
  78. this.region = region;
  79. this.getData();
  80. },
  81. getData() {
  82. this.$emit("updateParent", "loading", true);
  83. this.params = {
  84. districtCode: this.region,
  85. startTime: store.state.cockpit_date[0],
  86. endTime: store.state.cockpit_date[1],
  87. };
  88. this.GetOverview();
  89. if (this.region == "4602") this.GetDistrict();
  90. this.GetSumList();
  91. },
  92. GetOverview() {
  93. overview(this.params).then((res) => {
  94. this.sdata = res.data || {};
  95. let xz = (res.data.idleRate * 100).toFixed(2);
  96. let cz = (res.data.disposalRate * 100).toFixed(2);
  97. this.setEchart({ name: "土地闲置率", ratio: xz }, 3);
  98. this.setEchart({ name: "闲置处置率", ratio: cz }, 4);
  99. this.$emit("updateParent", "loading", false);
  100. });
  101. },
  102. GetDistrict() {
  103. this.jdData.x_data = [];
  104. this.jdData.result = [[], [], [], []];
  105. district(this.params).then((res) => {
  106. res.data.forEach((jdData) => {
  107. this.jdData.x_data.push(jdData.districtName);
  108. this.jdData.result[0].push(jdData.confirmAre);
  109. this.jdData.result[1].push(jdData.disposalArea);
  110. this.jdData.result[2].push((jdData.idleRate * 100).toFixed(2));
  111. this.jdData.result[3].push((jdData.disposalRate * 100).toFixed(2));
  112. });
  113. this.setEchart(this.jdData, 1);
  114. this.$emit("updateParent", "loading", false);
  115. });
  116. },
  117. GetSumList() {
  118. reason(this.params).then((res) => {
  119. res.data.map((a) => {
  120. a.name = a.reason;
  121. a.value = a.area.toFixed(2);
  122. });
  123. this.setEchart({ data: res.data, type: '"horizontal"' }, 2);
  124. this.$emit("updateParent", "loading", false);
  125. });
  126. },
  127. setEchart(data, id) {
  128. this.$nextTick(() => {
  129. this.$refs[`echartRef${id}`].setOptions(data);
  130. });
  131. },
  132. },
  133. watch: {
  134. region(newValue) {
  135. console.log(newValue, "---");
  136. },
  137. },
  138. };
  139. </script>
  140. <style lang="scss" scoped>
  141. .thzl {
  142. height: 100%;
  143. .content {
  144. width: 100%;
  145. height: 140px;
  146. .item {
  147. width: 32%;
  148. height: 100px;
  149. display: inline-block;
  150. position: relative;
  151. .icon {
  152. width: 100%;
  153. height: 50px;
  154. // display: flex;
  155. // justify-content: space-between;
  156. }
  157. .iicon {
  158. background: no-repeat 50%;
  159. // background-image: url("/static/images/overview/icon_yrkkg.png");
  160. width: 45px;
  161. height: 45px;
  162. margin: 0px 40px;
  163. // flex: 1;
  164. text-align: center;
  165. line-height: 45px;
  166. font-size: 20px;
  167. color: #68f4fb;
  168. border: 1px solid #4682b4;
  169. // rgba(0, 93, 207, 0.8)
  170. background: linear-gradient(
  171. to bottom,
  172. transparent,
  173. rgba(70, 130, 180, 0.8)
  174. );
  175. border-radius: 50%;
  176. }
  177. .confirm {
  178. // background-image: url("/static/images/overview/icon_yrkkg.png");
  179. color: #62aded;
  180. }
  181. .disposal {
  182. background-image: url("/static/images/overview/icon_yrkkg.png");
  183. color: #dfe15a;
  184. }
  185. .text {
  186. display: inline-block;
  187. // border: #00FFFF 1px solid;
  188. width: 100%;
  189. margin-bottom: 4px;
  190. text-align: center;
  191. margin-left: 0.3rem;
  192. span {
  193. font-family: "Arial Negreta", "Arial Normal", "Arial";
  194. font-weight: 700;
  195. font-style: normal;
  196. color: #68f4fb;
  197. }
  198. }
  199. }
  200. }
  201. .echartlist {
  202. width: 100%;
  203. height: calc(100% - 165px);
  204. overflow-y: auto;
  205. overflow-x: hidden;
  206. .ratio_echart {
  207. width: 180px;
  208. height: 90px;
  209. display: inline-block;
  210. }
  211. .echart {
  212. height: 200px !important;
  213. }
  214. .pie_echart {
  215. height: 180px;
  216. }
  217. }
  218. .tip {
  219. color: #9b9b9b;
  220. }
  221. }
  222. </style>