organize.vue 14 KB

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