jzdjfxsmjg.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. <template>
  2. <div
  3. class="ZTGlobal"
  4. style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white"
  5. >
  6. <el-container style="height: 100%">
  7. <el-header height="12rem">
  8. <el-row :gutter="10" style="display: flex; align-items: center">
  9. <el-col :span="18">
  10. {{ info.BenchmarkLandPrice.ProjectName }}
  11. </el-col>
  12. <el-col :span="6">
  13. <el-button size="mini" type="default" @click="handleGetBG"
  14. >导出报告</el-button
  15. >
  16. </el-col>
  17. </el-row>
  18. <el-row :gutter="10">
  19. <el-col :span="12">
  20. <el-row :gutter="10" class="container_center">
  21. <el-col
  22. :span="8"
  23. class="container_center"
  24. style="
  25. height: 3rem;
  26. background-color: rgba(2, 167, 240, 1);
  27. border-radius: 6px;
  28. "
  29. >
  30. <i style="font-size: 2rem" class="el-icon-office-building"></i>
  31. </el-col>
  32. <el-col
  33. :span="16"
  34. class="container_center"
  35. style="justify-content: flex-start"
  36. >
  37. <div class="con-col" style="align-items: flex-start">
  38. <a style="color: white">分析总范围(亩)</a>
  39. <a style="font-weight: bold; color: rgba(2, 167, 240, 1)">{{
  40. Number(
  41. info.BenchmarkLandPrice.AnalysisResults.analysisArea
  42. ).toFixed(2)
  43. }}</a>
  44. </div>
  45. </el-col>
  46. </el-row>
  47. </el-col>
  48. <el-col :span="12">
  49. <el-row :gutter="10" class="container_center">
  50. <el-col
  51. :span="8"
  52. class="container_center"
  53. style="
  54. height: 3rem;
  55. background-color: rgba(2, 167, 240, 1);
  56. border-radius: 6px;
  57. "
  58. >
  59. <i style="font-size: 2rem" class="el-icon-bank-card"></i>
  60. </el-col>
  61. <el-col
  62. :span="16"
  63. class="container_center"
  64. style="justify-content: flex-start"
  65. >
  66. <div class="con-col" style="align-items: flex-start">
  67. <a style="color: white">总地价(万元)</a>
  68. <a style="font-weight: bold; color: rgba(2, 167, 240, 1)">{{
  69. Number(
  70. info.BenchmarkLandPrice.AnalysisResults.totalLandPrice
  71. ).toFixed(2)
  72. }}</a>
  73. </div>
  74. </el-col>
  75. </el-row>
  76. </el-col>
  77. </el-row>
  78. <el-row :gutter="10">
  79. <el-col :span="12">
  80. <el-row :gutter="10" class="container_center">
  81. <el-col
  82. :span="8"
  83. class="container_center"
  84. style="
  85. height: 3rem;
  86. background-color: rgba(2, 167, 240, 1);
  87. border-radius: 6px;
  88. "
  89. >
  90. <i style="font-size: 2rem" class="el-icon-discount"></i>
  91. </el-col>
  92. <el-col
  93. :span="16"
  94. class="container_center"
  95. style="justify-content: flex-start"
  96. >
  97. <div class="con-col" style="align-items: flex-start">
  98. <a style="color: white">计算地价面积</a>
  99. <a style="color: white">(亩)</a>
  100. <a style="font-weight: bold; color: rgba(2, 167, 240, 1)">{{
  101. Number(
  102. info.BenchmarkLandPrice.AnalysisResults.ParticipationArea
  103. ).toFixed(2)
  104. }}</a>
  105. </div>
  106. </el-col>
  107. </el-row>
  108. </el-col>
  109. </el-row>
  110. </el-header>
  111. <el-main>
  112. <el-tabs v-model="activeName" class="full-height">
  113. <el-tab-pane label="总体情况" name="first" style="height: 100%">
  114. <div id="echartFGY" ref="echartFGY" class="EchartsWH">
  115. <div
  116. id="GYEcharts"
  117. ref="GYEcharts"
  118. style="width: 100%; height: 100%"
  119. ></div>
  120. </div>
  121. </el-tab-pane>
  122. <el-tab-pane label="地块详情" name="second" style="height: 100%">
  123. <el-table
  124. :data="tableData"
  125. :span-method="objectSpanMethod"
  126. border
  127. height="100%"
  128. style="width: 100%"
  129. @row-click="rowClick"
  130. >
  131. <el-table-column prop="dkbm" label="地块编码" width="60">
  132. </el-table-column>
  133. <el-table-column prop="ghyt" label="地类名称"> </el-table-column>
  134. <el-table-column prop="area" align="center">
  135. <template slot="header">
  136. <div>占用面积</div>
  137. <div>(亩)</div>
  138. </template>
  139. <template slot-scope="scope">
  140. <span>{{ scope.row.area }}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column prop="tdjb" align="center" width="40">
  144. <template slot="header">
  145. <div>级别</div>
  146. </template>
  147. <template slot-scope="scope">
  148. <span>{{ scope.row.tdjb }}</span>
  149. </template>
  150. </el-table-column>
  151. <el-table-column prop="dj" align="center">
  152. <template slot="header">
  153. <div>单价</div>
  154. <div>(万元)</div>
  155. </template>
  156. <template slot-scope="scope">
  157. <span>{{ scope.row.dj }}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column prop="zdj" align="center">
  161. <template slot="header">
  162. <div>总地价</div>
  163. <div>(万元)</div>
  164. </template>
  165. <template slot-scope="scope">
  166. <span>{{ scope.row.zdj }}</span>
  167. </template>
  168. </el-table-column>
  169. </el-table>
  170. </el-tab-pane>
  171. </el-tabs>
  172. </el-main>
  173. </el-container>
  174. </div>
  175. </template>
  176. <script>
  177. import elementResizeDetectorMaker from "element-resize-detector";
  178. import PlanningPlotInfo from "@/views/ConstructionApplication3D/PlanningPlot/PlanningPlotInfo.vue";
  179. import { getJZDJWord, getWord } from "@/api/zt/ztApi.js";
  180. export default {
  181. data() {
  182. return {
  183. tableData: [],
  184. spanArray: [],
  185. //点查entities事件
  186. getEntitiesHandler: {},
  187. /**
  188. * tabs 标签
  189. */
  190. activeName: "first",
  191. GYmyChart: null,
  192. JTmyChart: null,
  193. Interval: null,
  194. entitieid: "",
  195. Interval: null,
  196. };
  197. },
  198. props: {
  199. info: {
  200. type: Object,
  201. default: () => {
  202. return {};
  203. },
  204. },
  205. layerid: {
  206. type: String,
  207. default: "",
  208. },
  209. lydata: {
  210. type: Object,
  211. default: () => {
  212. return {};
  213. },
  214. },
  215. lyoption: {
  216. type: Object,
  217. default: () => {
  218. return {};
  219. },
  220. },
  221. },
  222. created() {},
  223. mounted() {
  224. const erd = elementResizeDetectorMaker();
  225. let that = this;
  226. erd.listenTo([this.$refs.echartFGY], () => {
  227. //, this.$refs.echartFJT
  228. that.$nextTick(() => {
  229. //监听到事件后执行的业务逻辑
  230. window.echarts.init(this.$refs.GYEcharts).resize();
  231. // window.echarts.init(this.$refs.JTEcharts).resize();
  232. });
  233. });
  234. this.init();
  235. },
  236. methods: {
  237. async init() {
  238. // 设置用地类型图层颜色
  239. let ghyts = [];
  240. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList.forEach(
  241. (ghdkDetailedDj) => {
  242. if (!ghyts[ghdkDetailedDj.ghyt]) {
  243. ghyts[ghdkDetailedDj.ghyt] = this.getLandColor(ghdkDetailedDj.ghyt);
  244. }
  245. }
  246. );
  247. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList.forEach(
  248. (ghdkDetailedDj) => {
  249. ghdkDetailedDj.ColorString = ghyts[ghdkDetailedDj.ghyt];
  250. }
  251. );
  252. this.initEntitiesHandler();
  253. this.DrawScope();
  254. this.initTable();
  255. let entitys = [];
  256. if (viewer.entities.getById("HZFW")) {
  257. entitys.push(viewer.entities.getById("HZFW"));
  258. }
  259. viewer.flyTo(entitys);
  260. await this.YDFLZDJChart();
  261. },
  262. /**
  263. * 渲染绘制范围
  264. */
  265. DrawScope() {
  266. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList.forEach(
  267. (ghdkDetailedDj) => {
  268. let point3ds = [];
  269. let pointholes = [];
  270. let startindex = 0;
  271. for (
  272. let index = 0;
  273. index < ghdkDetailedDj.geometry.parts.length;
  274. index++
  275. ) {
  276. let thisps = [];
  277. const endindex = startindex + ghdkDetailedDj.geometry.parts[index];
  278. let geometryPoints = ghdkDetailedDj.geometry.points.slice(
  279. startindex,
  280. endindex
  281. );
  282. for (
  283. let pointindex = 0;
  284. pointindex < geometryPoints.length;
  285. pointindex++
  286. ) {
  287. const point = geometryPoints[pointindex];
  288. thisps.push(point.x);
  289. thisps.push(point.y);
  290. }
  291. if (ghdkDetailedDj.geometry.partTopo[index] === 1) {
  292. point3ds.push(Cesium.Cartesian3.fromDegreesArray(thisps));
  293. } else {
  294. pointholes.push(Cesium.Cartesian3.fromDegreesArray(thisps));
  295. }
  296. startindex = endindex;
  297. }
  298. let col = Cesium.Color.fromCssColorString(ghdkDetailedDj.ColorString);
  299. if (point3ds.length > 0 && pointholes.length > 0) {
  300. let holes = [];
  301. pointholes.forEach((hole) => {
  302. holes.push({ positions: hole });
  303. });
  304. var orangePolygon1 = viewer.entities.add({
  305. id: ghdkDetailedDj.id,
  306. polygon: {
  307. hierarchy: {
  308. // Cesium.PolygonHierarchy
  309. positions: point3ds[0],
  310. holes: holes, // Cesium.PolygonHierarchy 数组
  311. },
  312. material: col.withAlpha(0.4),
  313. outline: true,
  314. outlineColor: Cesium.Color.BLACK,
  315. outlineWidth: 2.0,
  316. },
  317. });
  318. } else if (point3ds.length > 0) {
  319. var orangePolygon1 = viewer.entities.add({
  320. id: ghdkDetailedDj.id,
  321. polygon: {
  322. hierarchy: point3ds[0],
  323. material: col.withAlpha(0.4),
  324. outline: true,
  325. outlineColor: Cesium.Color.BLACK,
  326. outlineWidth: 2.0,
  327. },
  328. });
  329. }
  330. }
  331. );
  332. let ProjectScope = this.info.BenchmarkLandPrice.ProjectScope;
  333. if (ProjectScope.length > 0) {
  334. if (ProjectScope[0] != ProjectScope[ProjectScope.length - 1]) {
  335. ProjectScope.push(ProjectScope[0]);
  336. }
  337. let points = ProjectScope.map((obj) => [obj.x, obj.y]).flat();
  338. var orangePolygon1 = viewer.entities.add({
  339. id: "HZFW",
  340. polygon: {
  341. hierarchy: Cesium.Cartesian3.fromDegreesArray(points),
  342. material: Cesium.Color.CHARTREUSE.withAlpha(0.1), //Cesium.Color.RED.withAlpha(0.4),
  343. outline: true,
  344. outlineColor: Cesium.Color.RED,
  345. outlineWidth: 2.0,
  346. },
  347. });
  348. } else {
  349. // this.$message.error("请在传入分析范围");
  350. console.log("未传入分析范围");
  351. }
  352. },
  353. initTable() {
  354. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList.forEach(
  355. (ghdkDetailedDj, i) => {
  356. if (ghdkDetailedDj.zytdList.length > 0) {
  357. this.spanArray.push(ghdkDetailedDj.zytdList.length);
  358. for (
  359. let index = 1;
  360. index < ghdkDetailedDj.zytdList.length;
  361. index++
  362. ) {
  363. this.spanArray.push(0);
  364. }
  365. } else {
  366. this.spanArray.push(1);
  367. }
  368. if (ghdkDetailedDj.zytdList.length > 0) {
  369. ghdkDetailedDj.zytdList.forEach((zytd) => {
  370. let row = {
  371. ColorString: ghdkDetailedDj.ColorString,
  372. dkbm: ghdkDetailedDj.dkbm,
  373. ghyt: ghdkDetailedDj.ghyt,
  374. area: zytd.area.toFixed(2),
  375. dj: zytd.dj.toFixed(2),
  376. tdjb: zytd.tdjb,
  377. zdj: zytd.zdj.toFixed(2),
  378. ghdkDetailedDjid: ghdkDetailedDj.id,
  379. };
  380. this.tableData.push(row);
  381. });
  382. } else {
  383. let row = {
  384. ColorString: ghdkDetailedDj.ColorString,
  385. dkbm: ghdkDetailedDj.dkbm,
  386. ghyt: ghdkDetailedDj.ghyt,
  387. ghdkDetailedDjid: ghdkDetailedDj.id,
  388. };
  389. this.tableData.push(row);
  390. }
  391. }
  392. );
  393. },
  394. objectSpanMethod({ rowIndex, columnIndex }) {
  395. debugger;
  396. if (columnIndex === 0 || columnIndex === 1) {
  397. let _row = this.spanArray[rowIndex];
  398. let _col = _row > 0 ? 1 : 0;
  399. // console.log(`{rowspan: ${_row}, colspan: ${_col}}`);
  400. // 打印结果
  401. // {rowspan: 3, colspan: 1}
  402. // {rowspan: 0, colspan: 0}
  403. // {rowspan: 0, colspan: 0}
  404. // {rowspan: 2, colspan: 1}
  405. // {rowspan: 0, colspan: 0}
  406. // {rowspan: 4, colspan: 1}
  407. // {rowspan: 0, colspan: 0}
  408. // {rowspan: 0, colspan: 0}
  409. // {rowspan: 0, colspan: 0}
  410. // {rowspan: 0, colspan: 0} 表示此行不显示
  411. // {rowspan: 2, colspan: 1} 表示跨两行
  412. return {
  413. rowspan: _row,
  414. colspan: _col,
  415. };
  416. }
  417. },
  418. rowClick(row) {
  419. let that = this;
  420. debugger;
  421. if (that.Interval) {
  422. clearInterval(that.Interval);
  423. that.Interval = null;
  424. }
  425. if (that.entitieid != "") {
  426. var entitie = viewer.entities.getById(that.entitieid);
  427. let ghdkDetailedDj =
  428. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList.find(
  429. (c) => c.id == that.entitieid
  430. );
  431. let col = Cesium.Color.fromCssColorString(
  432. ghdkDetailedDj.ColorString
  433. ).withAlpha(0.4);
  434. entitie.polygon.material = col;
  435. that.entitieid = "";
  436. }
  437. if (row) {
  438. that.entitieid = row.ghdkDetailedDjid;
  439. that.Interval = setInterval(function () {
  440. var entitie = viewer.entities.getById(that.entitieid);
  441. if (entitie.polygon.material.color.getValue().alpha == 0.4) {
  442. entitie.polygon.material = new Cesium.Color(
  443. 3 / 255,
  444. 240 / 255,
  445. 248 / 255,
  446. 1
  447. );
  448. } else {
  449. entitie.polygon.material = new Cesium.Color(
  450. 3 / 255,
  451. 240 / 255,
  452. 248 / 255,
  453. 0.4
  454. );
  455. }
  456. }, 1000);
  457. var entitie = viewer.entities.getById(that.entitieid);
  458. if (entitie) {
  459. viewer.flyTo(entitie, { maximumHeight: 30 });
  460. }
  461. }
  462. },
  463. /**
  464. * 点击弹窗显示图斑信息
  465. */
  466. initEntitiesHandler() {
  467. let that = this;
  468. this.getEntitiesHandler = new Cesium.ScreenSpaceEventHandler(
  469. scene.canvas
  470. );
  471. this.getEntitiesHandler.setInputAction(function (click) {
  472. let pick = viewer.scene.pick(click.position);
  473. let id, info;
  474. //规划地块信息弹窗
  475. if (pick && pick.id.id) {
  476. id = pick.id.id;
  477. info =
  478. that.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList.find(
  479. (c) => c.id == id
  480. );
  481. if (info) {
  482. that.openOBJInfo("规划地块详情", info.data);
  483. }
  484. }
  485. }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
  486. },
  487. //打开用地红线信息弹窗
  488. openOBJInfo(title, info) {
  489. let w = document.body.offsetWidth;
  490. let h = document.body.offsetHeight;
  491. //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
  492. //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
  493. let left = 430 / 2 + 556;
  494. let top = 430 / 2 + 60;
  495. this.$layer.iframe({
  496. id: "OBJInfolayer",
  497. content: {
  498. content: PlanningPlotInfo, //传递的组件对象
  499. parent: this, //当前的vue对象
  500. data: { info }, //props
  501. },
  502. offset: [left, top], //left top
  503. area: ["430px", "430px"], //宽 高
  504. title: title,
  505. maxmin: false,
  506. shade: false, //是否显示遮罩
  507. shadeClose: false, //点击遮罩是否关闭
  508. cancel: () => {
  509. //关闭事件
  510. // alert("关闭iframe");
  511. },
  512. });
  513. },
  514. /**
  515. * 打印分析报告
  516. */
  517. async handleGetBG() {
  518. if (
  519. this.info.BenchmarkLandPrice &&
  520. this.info.BenchmarkLandPrice.AnalysisResults
  521. ) {
  522. debugger;
  523. await getJZDJWord(this.info.BenchmarkLandPrice.AnalysisResults);
  524. }
  525. },
  526. clear() {
  527. //删除规划地块图层
  528. for (
  529. let index = 0;
  530. index <
  531. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList.length;
  532. index++
  533. ) {
  534. const element =
  535. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList[
  536. index
  537. ];
  538. viewer.entities.removeById(element.id);
  539. }
  540. this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList = [];
  541. //删除绘制范围
  542. viewer.entities.removeById("HZFW");
  543. },
  544. /**
  545. * 获取用地用海分类统一颜色
  546. */
  547. getLandColor(name) {
  548. var color = "rgb(172,255,207)";
  549. window.colorList.forEach((element) => {
  550. if (element.name.indexOf(name) > -1) color = element.color;
  551. });
  552. if (color == "rgb(172,255,207)") {
  553. const r = Math.floor(Math.random() * 256);
  554. const g = Math.floor(Math.random() * 256);
  555. const b = Math.floor(Math.random() * 256);
  556. color = `rgb(${r}, ${g}, ${b})`;
  557. }
  558. return color;
  559. },
  560. /**
  561. *用地分类总地价chart
  562. */
  563. YDFLZDJChart() {
  564. var that = this;
  565. this.myChart = window.echarts.init(this.$refs.GYEcharts);
  566. var datas = [];
  567. var nameLength = 0;
  568. var colors = [];
  569. var color = "";
  570. let djGroup = this.GroupByzdj(this.tableData);
  571. djGroup.forEach((element) => {
  572. if (element.ghyt.length > nameLength) {
  573. nameLength = element.ghyt.length;
  574. }
  575. datas.push({
  576. area: Number(element.area.toFixed(2)),
  577. value: Number(element.zdj.toFixed(2)),
  578. name: element.ghyt,
  579. });
  580. color = element.ColorString;
  581. colors.push(color);
  582. });
  583. var option = {
  584. tooltip: {
  585. trigger: "item",
  586. formatter: "{a} <br/>{b} : {c}万元 ({d}%)",
  587. },
  588. legend: {
  589. type: "scroll",
  590. orient: "vertical",
  591. right: 0,
  592. top: "center",
  593. // bottom: 20,
  594. radius: "55%",
  595. textStyle: {
  596. // fontSize: '12px',
  597. color: "#FFFF",
  598. },
  599. pageTextStyle: {
  600. color: "#FFFF",
  601. },
  602. data: datas.map((t) => t.name),
  603. formatter: function (name) {
  604. var thisdata = datas.find((t) => t.name == name);
  605. let lab = "";
  606. // 遍历输入字符串的每个字符
  607. for (let i = 0; i < name.length; i++) {
  608. if ((i + 1) % 4 === 0 && i !== name.length - 1) {
  609. lab += name[i] + "\n";
  610. } else {
  611. lab += name[i];
  612. }
  613. }
  614. var lastSpace = " ";
  615. if (name.length % 4 != 0) {
  616. lastSpace += " ".repeat(4 - (name.length % 4));
  617. }
  618. return (
  619. lab +
  620. lastSpace +
  621. "\n" +
  622. thisdata.area +
  623. "亩" +
  624. thisdata.value +
  625. "万元"
  626. );
  627. },
  628. },
  629. color: colors, // ['#0a915d', '#bb88dd', '#6699ff', '#d5b158', '#ff6347', 'indigo', 'purple'],
  630. series: [
  631. {
  632. name: "规划地类总地价",
  633. type: "pie",
  634. center: ["25%", "50%"],
  635. radius: ["30%", "50%"],
  636. avoidLabelOverlap: false,
  637. itemStyle: {
  638. borderRadius: 10,
  639. borderColor: "#fff",
  640. borderWidth: 2,
  641. },
  642. label: {
  643. show: false,
  644. position: "center",
  645. },
  646. emphasis: {
  647. label: {
  648. show: true,
  649. fontSize: 12,
  650. fontWeight: "bold",
  651. },
  652. },
  653. labelLine: {
  654. show: false,
  655. },
  656. data: datas,
  657. },
  658. ],
  659. };
  660. this.myChart.setOption(option);
  661. },
  662. /**
  663. * 对数组字段分组并求和计算每个土地用途的总地价
  664. * @param data
  665. */
  666. GroupByzdj(data) {
  667. const groupedData = data.reduce((accumulator, currentValue) => {
  668. // 如果累加器(accumulator)中没有这个分组,就添加它
  669. if (!accumulator[currentValue.ghyt]) {
  670. accumulator[currentValue.ghyt] = {
  671. ghyt: currentValue.ghyt,
  672. zdj: 0,
  673. area: 0,
  674. ColorString: currentValue.ColorString,
  675. };
  676. }
  677. // 将当前对象的b值累加到对应分组上
  678. accumulator[currentValue.ghyt].zdj += Number(
  679. currentValue.zdj ? currentValue.zdj : 0
  680. );
  681. accumulator[currentValue.ghyt].area += Number(
  682. currentValue.area ? currentValue.area : 0
  683. );
  684. // 返回累加器,以便下一次迭代使用
  685. return accumulator;
  686. }, {});
  687. // 将结果转换为数组(如果需要的话)
  688. const resultArray = Object.keys(groupedData).map(
  689. (key) => groupedData[key]
  690. );
  691. return resultArray;
  692. },
  693. },
  694. beforeDestroy() {
  695. if (this.Interval) {
  696. clearInterval(this.Interval);
  697. this.Interval = null;
  698. }
  699. if (this.getEntitiesHandler) {
  700. this.getEntitiesHandler.removeInputAction(
  701. Cesium.ScreenSpaceEventType.LEFT_CLICK
  702. );
  703. }
  704. this.clear();
  705. },
  706. };
  707. </script>
  708. <style lang="scss">
  709. @import "@/../../zt.scss";
  710. </style>
  711. <style scoped>
  712. .el-date-editor--daterange.el-input__inner {
  713. width: auto;
  714. background-color: rgba(4, 28, 50, 0.5);
  715. border: 1px solid rgba(15, 122, 200, 0.4);
  716. }
  717. .card_body_style {
  718. border: 1px dashed #02a7f0;
  719. }
  720. .hover_style:hover {
  721. border: 1px solid #02a7f0;
  722. }
  723. .con-col {
  724. display: flex;
  725. flex-flow: column nowrap;
  726. justify-content: center;
  727. align-items: center;
  728. border-radius: 4px;
  729. }
  730. .container_center {
  731. display: flex;
  732. align-items: center; /* 垂直居中 */
  733. justify-content: center; /* 水平居中,如果也需要水平居中的话 */
  734. }
  735. .EchartsWH {
  736. width: 100%;
  737. height: 100%;
  738. }
  739. .full-height {
  740. height: 100%; /* 适应父容器的高度 */
  741. }
  742. .full-height >>> .el-tabs__content {
  743. height: calc(100% - 55px); /* 计算内容区域的高度 */
  744. overflow-y: auto; /* 滚动条 */
  745. }
  746. .el-main {
  747. padding: 0px;
  748. }
  749. </style>