organize.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493
  1. <template>
  2. <div class="OrganizeCon">
  3. <div class="tdTitle">试点目标</div>
  4. <div class="echars">
  5. <pie unit="亩" class="pie_echart" ref="echartRef0"></pie>
  6. </div>
  7. <div class="content">
  8. <div class="item" v-for="(sd, index) in orgnList" :key="index">
  9. <div class="text">
  10. <p>{{ sd.name }}</p>
  11. <span class="cvalue">{{ (sdata.area || 0).toFixed(2) }} </span>
  12. <span class="unit">{{ sd.unit }}</span>
  13. </div>
  14. </div>
  15. </div>
  16. <div class="echars">
  17. <div class="echartTitle">
  18. <div class="block-title">建设用地整理情况</div>
  19. </div>
  20. <div class="JSContent">
  21. <div class="jsitem">
  22. <p class="tvalue">+0.72</p>
  23. <p>建设用地变化</p>
  24. </div>
  25. <div class="itemCon" style="width: 55%">
  26. <span
  27. ><span class="font_color">整治前建设用地</span
  28. ><span style="padding: 0 3px">{{ 20.88 }}</span> 公顷</span
  29. >
  30. <span
  31. ><span class="font_color">整治后建设用地</span
  32. ><span style="padding: 0 3px">{{ 20.88 }}</span
  33. >公顷</span
  34. >
  35. </div>
  36. </div>
  37. </div>
  38. <div class="cjfkCon echars">
  39. <div class="echartTitle">
  40. <div class="block-title">拆旧复垦</div>
  41. </div>
  42. <div class="cjfkList itemCon">
  43. <span v-for="(item, i) in cjfkList" :key="i"
  44. ><span class="font_color">{{ item.name }}</span
  45. ><span style="padding: 0 3px;color: #ec808d;font-size: 14px;">{{ item.area }}</span>
  46. {{ item.unit }}</span
  47. >
  48. </div>
  49. </div>
  50. <div class="echars">
  51. <div class="echartTitle">
  52. <div class="block-title">建新用地</div>
  53. </div>
  54. <div class="xjydCon content">
  55. <div class="item">
  56. <div class="icon">
  57. <div class="iicon"></div>
  58. </div>
  59. <div class="text">
  60. <p>{{ "拟建新面积" }}</p>
  61. <span class="cvalue">{{ (4.38 || 0).toFixed(2) }} </span>
  62. <span class="unit">{{ "公顷" }}</span>
  63. </div>
  64. </div>
  65. <div class="echars2">
  66. <div ref="second_pie" id="second_pie"></div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="echars">
  71. <div class="echartTitle">
  72. <div class="block-title">存量盘活</div>
  73. </div>
  74. <div class="divrow">
  75. <div class="divCol">
  76. <div class="divImg">
  77. <img
  78. src="/static/images/overview/icon_yrkkg.png"
  79. style="height: 2.5rem; width: 2.5rem"
  80. />
  81. </div>
  82. <div class="divText">
  83. <span style="color: #fff">存量建设用地盘活</span>
  84. <span
  85. ><span
  86. style="color: #ec808d; font-size: 18px; margin-right: 3px"
  87. >{{ 0 }}</span
  88. >
  89. 公顷
  90. </span>
  91. </div>
  92. </div>
  93. <div class="divCol">
  94. <div class="divImg">
  95. <img
  96. src="/static/images/overview/icon_yrkkg.png"
  97. style="height: 2.5rem; width: 2.5rem"
  98. />
  99. </div>
  100. <div class="divText">
  101. <span style="color: #fff">新产业新业态发展</span>
  102. <span
  103. ><span
  104. style="color: #ec808d; font-size: 18px; margin-right: 3px"
  105. >{{ 0 }}</span
  106. >
  107. 公顷</span
  108. >
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </template>
  115. <script>
  116. import pie from "@/components/echartsTemplate/pie.vue";
  117. import { overview, district, reason } from "@/api/Idleland.js";
  118. export default {
  119. props: {},
  120. data() {
  121. return {
  122. tab: 0,
  123. imgs: {
  124. loc: require("../../../../static/images/overview/icon_yrkkg.png"),
  125. zd1: require("../../../../static/images/overview/icon_yrkkg.png"),
  126. },
  127. orgnList: [
  128. { name: "新增耕地", prop: "suspected", unit: "公顷" },
  129. { name: "新增永久基本农田", prop: "confirm", unit: "公顷" },
  130. { name: "提质改造", prop: "disposal", unit: "公顷" },
  131. { name: "生态修复", prop: "disposal", unit: "公顷" },
  132. { name: "新增生态用地", prop: "disposal", unit: "公顷" },
  133. ],
  134. sdata: {},
  135. cjfkList: [
  136. { name: "拟拆旧面积", area: "10.05", unit: "公顷" },
  137. { name: "复垦为耕地", area: "0", unit: "公顷" },
  138. { name: "拆迁房屋", area: "196", unit: "幢" },
  139. { name: "复垦为种植园地", area: "196", unit: "公顷" },
  140. { name: "动迁居民", area: "0.001", unit: "户" },
  141. { name: "复垦为林草地", area: "74", unit: "公顷" },
  142. { name: "动迁人口", area: "3.49", unit: "人" },
  143. { name: "复垦为其他农用地", area: "315", unit: "公顷" },
  144. ],
  145. myChart: null,
  146. };
  147. },
  148. components: {
  149. pie,
  150. },
  151. mounted() {
  152. this.getData();
  153. this.initEcharts()
  154. },
  155. methods: {
  156. changeData(name, updata) {
  157. this[name] = updata;
  158. },
  159. regionChange(region) {
  160. this.region = region;
  161. this.getData();
  162. },
  163. getData() {
  164. this.$emit("updateParent", "loading", true);
  165. this.params = { districtCode: this.region };
  166. this.GetOverview();
  167. this.GetSumList();
  168. },
  169. GetOverview() {
  170. overview(this.params).then((res) => {
  171. this.sdata = res.data || {};
  172. this.$emit("updateParent", "loading", false);
  173. });
  174. },
  175. GetSumList() {
  176. reason(this.params).then((res) => {
  177. res.data.map((a) => {
  178. a.name = a.reason;
  179. a.value = a.area.toFixed(2);
  180. });
  181. let redPercent = 60;
  182. let bluePercent = 40;
  183. const background = `linear-gradient(to right,#DFE15A ${redPercent}%,#62ADED ${bluePercent}%)`;
  184. this.setEchart({ data: res.data, type: '"horizontal"' }, 0);
  185. this.$emit("updateParent", "loading", false);
  186. });
  187. },
  188. changeCharts(e) {},
  189. setEchart(data, id) {
  190. this.$nextTick(() => {
  191. this.$refs[`echartRef${id}`].setOptions(data);
  192. });
  193. },
  194. initEcharts() {
  195. this.myChart = echarts.init(this.$refs.second_pie);
  196. const payload = {
  197. id: "left-center-1",
  198. title: "年龄占比",
  199. toolTip: true,
  200. data: {
  201. total: "4.38",
  202. data: ["0.59", "0", "3.02", "0.55", "0.22"],
  203. x: ["占用草地", "占用耕地", "占用林地", "占用园地", "占用其他农用地"],
  204. },
  205. };
  206. let data = [];
  207. const color = [
  208. "#6172D3",
  209. "#F5A539",
  210. "#FED969",
  211. "#469AE3",
  212. "#F97A3C",
  213. "#2FD9F2",
  214. "#A9DB32",
  215. "#6151F1",
  216. ];
  217. payload.data.x.forEach((item, index) => {
  218. data.push({
  219. value: payload.data.data[index],
  220. name: item,
  221. label: { color: color[index] },
  222. });
  223. });
  224. const tooltip = payload.toolTip !== undefined ? payload.toolTip : true;
  225. let countdata = payload.data.data.reduce((a, b) => Number(a) + Number(b));
  226. let option = {
  227. backgroundColor: 'transparent',
  228. grid: {
  229. left: 0,
  230. right: 0,
  231. bottom: 0,
  232. top: 0,
  233. containLabel: true,
  234. },
  235. tooltip: {
  236. show: tooltip,
  237. backgroundColor: "rgba(9, 30, 60, 0.6)",
  238. extraCssText: "box-shadow: 0 0 8px rgba(0, 128, 255, 0.27) inset;",
  239. borderWidth: 0,
  240. confine: false,
  241. appendToBody: true,
  242. textStyle: {
  243. color: "#fff",
  244. fontSize: 10,
  245. },
  246. // 轴触发提示才有效
  247. axisPointer: {
  248. type: "shadow",
  249. },
  250. shadowStyle: {
  251. color: "rgba(157, 168, 245, 0.1)",
  252. },
  253. formatter: function (parms) {
  254. var str =
  255. parms.seriesName +
  256. "</br>" +
  257. parms.marker +
  258. parms.name +
  259. " </br>" +
  260. "人数:" +
  261. parms.data.value +
  262. "</br>" +
  263. "占比:" +
  264. parms.percent +
  265. "%";
  266. return str;
  267. },
  268. },
  269. series: [
  270. {
  271. name: payload.title,
  272. type: 'pie',
  273. radius: ['55%', '75%'],
  274. minAngle: 8,
  275. itemStyle: {
  276. color(params) {
  277. return color[params.dataIndex];
  278. },
  279. },
  280. labelLine: {
  281. // length2: 55,
  282. length: 20,
  283. length2: 50,
  284. lineStyle: {
  285. width: 0,
  286. },
  287. },
  288. label: {
  289. position: 'outer',
  290. alignTo: 'none',
  291. bleedMargin: 1,
  292. formatter: ' {b}\n{a|{c}人}',
  293. padding: -65,
  294. rich: {
  295. a: {
  296. padding: [8, 0, 5, 0],
  297. color: '#fff',
  298. lineHeight: 20,
  299. fontSize: 12,
  300. },
  301. b: {
  302. padding: [8, 0, 5, 0],
  303. lineHeight: 20,
  304. },
  305. },
  306. },
  307. data,
  308. },
  309. ],
  310. };
  311. this.myChart.setOption(option);
  312. },
  313. },
  314. watch: {
  315. region(newValue) {
  316. console.log(newValue, "---");
  317. },
  318. },
  319. };
  320. </script>
  321. <style lang="scss" scoped>
  322. .echars {
  323. margin-bottom: 0px;
  324. }
  325. .OrganizeCon {
  326. height: 100%;
  327. padding: 1rem 10px 1rem 1rem;
  328. .content {
  329. width: 100%;
  330. height: 82px;
  331. .item {
  332. width: 32%;
  333. // height: 100px;
  334. display: inline-block;
  335. position: relative;
  336. .icon {
  337. width: 100%;
  338. height: 50px;
  339. display: flex;
  340. justify-content: space-between;
  341. }
  342. .iicon {
  343. background: no-repeat 50%;
  344. background-image: url("/static/images/overview/icon_yrkkg.png");
  345. width: 45px;
  346. height: 45px;
  347. flex: 1;
  348. }
  349. }
  350. .text {
  351. display: inline-block;
  352. // border: #00FFFF 1px solid;
  353. width: 100%;
  354. margin-bottom: 4px;
  355. text-align: center;
  356. margin-left: 0.3rem;
  357. .cvalue {
  358. font-family: "Arial Negreta", "Arial Normal", "Arial";
  359. font-weight: 700;
  360. font-style: normal;
  361. color: #68f4fb;
  362. }
  363. .unit {
  364. color: #fff;
  365. }
  366. }
  367. }
  368. .echartlist {
  369. width: 100%;
  370. height: calc(100% - 120px);
  371. overflow-y: auto;
  372. overflow-x: hidden;
  373. .block-title {
  374. width: calc(100% - 130px) !important;
  375. }
  376. }
  377. .echart {
  378. height: 130px !important;
  379. }
  380. .pie_echart {
  381. height: 130px;
  382. width: 400px;
  383. }
  384. #second_pie{
  385. height: 130px;
  386. width: 300px;
  387. }
  388. .tzdiv {
  389. height: 20px;
  390. margin: 5px 20px;
  391. }
  392. .JSContent {
  393. height: 62px;
  394. background: rgba(100, 218, 255, 0.1);
  395. display: flex;
  396. justify-content: space-between;
  397. .jsitem {
  398. width: 40%;
  399. text-align: center;
  400. font-weight: 400;
  401. font-size: 13px;
  402. line-height: 1;
  403. .tvalue {
  404. height: 36px;
  405. font-weight: 700;
  406. color: #ec808d;
  407. font-size: 18px;
  408. line-height: 36px;
  409. }
  410. }
  411. }
  412. .itemCon {
  413. display: flex;
  414. justify-content: space-between;
  415. flex-wrap: wrap;
  416. align-items: center;
  417. margin-top: 5px;
  418. span {
  419. padding: 0 0.4rem;
  420. display: inline-block;
  421. // background: rgba(100, 218, 255, 0.1);
  422. // border-radius: 2px 14px 2px 14px;
  423. color: #64daff;
  424. font-size: 13px;
  425. }
  426. .font_color {
  427. // width: 100px;
  428. color: white;
  429. }
  430. }
  431. .divrow {
  432. height: 50px;
  433. // background-color: #0f7bc875;
  434. display: flex;
  435. justify-content: space-between;
  436. margin-bottom: 8px;
  437. .divCol {
  438. // background-color: #cddeeb5a;
  439. width: 49%;
  440. display: flex;
  441. align-items: center;
  442. white-space: nowrap;
  443. .divImg {
  444. width: 25%;
  445. height: 40px;
  446. img {
  447. height: 2.5rem;
  448. width: 2.5rem;
  449. }
  450. }
  451. .divText {
  452. width: 75%;
  453. // padding-left: 0.5rem;
  454. display: flex;
  455. flex-direction: column;
  456. span {
  457. height: 20px;
  458. // background: rgba(255, 0, 0, 0.258);
  459. height: 20px;
  460. line-height: 20px;
  461. }
  462. }
  463. }
  464. }
  465. .xjydCon {
  466. height: 130px;
  467. // background-color: #ec808c7b;
  468. display: flex;
  469. justify-content: space-between;
  470. position: relative;
  471. top: 19px;
  472. }
  473. .CommonList {
  474. }
  475. }
  476. </style>