|
@@ -0,0 +1,1274 @@
|
|
|
|
+<template>
|
|
|
|
+ <div
|
|
|
|
+ class="ZTGlobal"
|
|
|
|
+ style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white"
|
|
|
|
+ >
|
|
|
|
+ <el-row :gutter="10" style="display: flex; align-items: center">
|
|
|
|
+ <el-col :span="18">
|
|
|
|
+ {{ thisBenchmarkLandPrice.ProjectName }}
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="6">
|
|
|
|
+ <el-button
|
|
|
|
+ :disabled="thisBenchmarkLandPrice.AnalysisStatus != '完成'"
|
|
|
|
+ size="mini"
|
|
|
|
+ type="default"
|
|
|
|
+ @click="handleGetBG"
|
|
|
|
+ >导出报告</el-button
|
|
|
|
+ >
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="10" style="display: flex; align-items: center">
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ 土地用途:
|
|
|
|
+ <el-select
|
|
|
|
+ size="mini"
|
|
|
|
+ v-model="jzdj_LandUse"
|
|
|
|
+ placeholder="请选择土地用途"
|
|
|
|
+ clearable
|
|
|
|
+ @change="handleChange"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in zt_jzdj_LandUse"
|
|
|
|
+ :key="dict.value"
|
|
|
|
+ :label="dict.label"
|
|
|
|
+ :value="dict.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-row :gutter="10" class="container_center">
|
|
|
|
+ <el-col
|
|
|
|
+ :span="8"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="
|
|
|
|
+ height: 3rem;
|
|
|
|
+ background-color: rgba(2, 167, 240, 1);
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <i style="font-size: 2rem" class="el-icon-office-building"></i>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col
|
|
|
|
+ :span="16"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="justify-content: flex-start"
|
|
|
|
+ >
|
|
|
|
+ <div class="con-col" style="align-items: flex-start">
|
|
|
|
+ <a style="color: white">分析面积(亩)</a>
|
|
|
|
+ <a style="font-weight: bold; color: rgba(2, 167, 240, 1)">{{
|
|
|
|
+ (Number(formData.fxzmj) / 666.67).toFixed(2)
|
|
|
|
+ }}</a>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-row :gutter="10" class="container_center">
|
|
|
|
+ <el-col
|
|
|
|
+ :span="8"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="
|
|
|
|
+ height: 3rem;
|
|
|
|
+ background-color: rgba(2, 167, 240, 1);
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <i style="font-size: 2rem" class="el-icon-bank-card"></i>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col
|
|
|
|
+ :span="16"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="justify-content: flex-start"
|
|
|
|
+ >
|
|
|
|
+ <div class="con-col" style="align-items: flex-start">
|
|
|
|
+ <a style="color: white">总地价(万元)</a>
|
|
|
|
+ <a style="font-weight: bold; color: rgba(2, 167, 240, 1)">{{
|
|
|
|
+ (formData.zdj / 10000).toFixed(2)
|
|
|
|
+ }}</a>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-row :gutter="10" class="container_center">
|
|
|
|
+ <el-col
|
|
|
|
+ :span="8"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="
|
|
|
|
+ height: 3rem;
|
|
|
|
+ background-color: rgba(2, 167, 240, 1);
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <i style="font-size: 2rem" class="el-icon-discount"></i>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col
|
|
|
|
+ :span="16"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="justify-content: flex-start"
|
|
|
|
+ >
|
|
|
|
+ <div class="con-col" style="align-items: flex-start">
|
|
|
|
+ <a style="color: white">国有建设</a>
|
|
|
|
+ <a style="color: white">用地地价(万元)</a>
|
|
|
|
+ <a style="font-weight: bold; color: rgba(2, 167, 240, 1)">{{
|
|
|
|
+ (formData.gyzdj / 10000).toFixed(2)
|
|
|
|
+ }}</a>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-row :gutter="10" class="container_center">
|
|
|
|
+ <el-col
|
|
|
|
+ :span="8"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="
|
|
|
|
+ height: 3rem;
|
|
|
|
+ background-color: rgba(2, 167, 240, 1);
|
|
|
|
+ border-radius: 6px;
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ <i style="font-size: 2rem" class="el-icon-price-tag"></i>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col
|
|
|
|
+ :span="16"
|
|
|
|
+ class="container_center"
|
|
|
|
+ style="justify-content: flex-start"
|
|
|
|
+ >
|
|
|
|
+ <div class="con-col" style="align-items: flex-start">
|
|
|
|
+ <a style="color: white">集体建设</a>
|
|
|
|
+ <a style="color: white">用地地价(万元)</a>
|
|
|
|
+ <a style="font-weight: bold; color: rgba(2, 167, 240, 1)">{{
|
|
|
|
+ (formData.jtzdj / 10000).toFixed(2)
|
|
|
|
+ }}</a>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <!-- <el-row :gutter="10" style="display: flex; align-items: center">
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ 土地用途:
|
|
|
|
+ <el-select
|
|
|
|
+ size="mini"
|
|
|
|
+ v-model="jzdj_LandUse"
|
|
|
|
+ placeholder="请选择土地用途"
|
|
|
|
+ clearable
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="dict in zt_jzdj_LandUse"
|
|
|
|
+ :key="dict.value"
|
|
|
|
+ :label="dict.label"
|
|
|
|
+ :value="dict.value"
|
|
|
|
+ />
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row> -->
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <div id="echartFGY" ref="echartFGY" class="EchartsWH">
|
|
|
|
+ <div
|
|
|
|
+ id="GYEcharts"
|
|
|
|
+ ref="GYEcharts"
|
|
|
|
+ :style="{ width: '100%', height: '100%' }"
|
|
|
|
+ ></div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <div id="echartFJT" ref="echartFJT" class="EchartsWH">
|
|
|
|
+ <div
|
|
|
|
+ id="JTEcharts"
|
|
|
|
+ ref="JTEcharts"
|
|
|
|
+ :style="{ width: '100%', height: '100%' }"
|
|
|
|
+ ></div>
|
|
|
|
+ </div>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import { v4 as uuidv4 } from "uuid";
|
|
|
|
+import moment from "moment";
|
|
|
|
+import elementResizeDetectorMaker from "element-resize-detector";
|
|
|
|
+import PlanningPlotInfo from "@/views/ConstructionApplication3D/PlanningPlot/PlanningPlotInfo.vue";
|
|
|
|
+import {
|
|
|
|
+ cartesian3ToWGS84,
|
|
|
|
+ mapQuery,
|
|
|
|
+ flatten,
|
|
|
|
+ mercator2lonLat,
|
|
|
|
+ undergroundMode,
|
|
|
|
+} from "@/utils/MapHelper/MapHelper.js";
|
|
|
|
+import {
|
|
|
|
+ area,
|
|
|
|
+ intersect,
|
|
|
|
+ polygon,
|
|
|
|
+ point,
|
|
|
|
+ midpoint,
|
|
|
|
+ difference,
|
|
|
|
+} from "@turf/turf";
|
|
|
|
+// import html2canvas from "html2canvas";
|
|
|
|
+import { getJZDJWord, getWord } from "@/api/zt/ztApi.js";
|
|
|
|
+export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ thisBenchmarkLandPrice: null,
|
|
|
|
+ //点查entities事件
|
|
|
|
+ getEntitiesHandler: {},
|
|
|
|
+ tooltip: createTooltip(document.body),
|
|
|
|
+ zt_jzdj_LandUse: window.dict.zt_jzdj_LandUse,
|
|
|
|
+ jzdj_LandUse: "商服用地",
|
|
|
|
+ GYmyChart: null,
|
|
|
|
+ JTmyChart: null,
|
|
|
|
+ formData: {
|
|
|
|
+ fxzmj: 0, //分析面积
|
|
|
|
+ zdj: 0,
|
|
|
|
+ gyzdj: 0, //国有总地价
|
|
|
|
+ jtzdj: 0, //集体总地价
|
|
|
|
+ },
|
|
|
|
+ LayerData: {
|
|
|
|
+ GYData: [],
|
|
|
|
+ JTData: [],
|
|
|
|
+ GHDKData: [],
|
|
|
|
+ JZDJData: [],
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ props: {
|
|
|
|
+ info: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: () => {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ layerid: {
|
|
|
|
+ type: String,
|
|
|
|
+ default: "",
|
|
|
|
+ },
|
|
|
|
+ lydata: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: () => {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ lyoption: {
|
|
|
|
+ type: Object,
|
|
|
|
+ default: () => {
|
|
|
|
+ return {};
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ debugger;
|
|
|
|
+ this.thisBenchmarkLandPrice = this.info.BenchmarkLandPrice;
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ const erd = elementResizeDetectorMaker();
|
|
|
|
+ let that = this;
|
|
|
|
+ erd.listenTo([this.$refs.echartFGY, this.$refs.echartFJT], () => {
|
|
|
|
+ that.$nextTick(() => {
|
|
|
|
+ //监听到事件后执行的业务逻辑
|
|
|
|
+ window.echarts.init(this.$refs.GYEcharts).resize();
|
|
|
|
+ window.echarts.init(this.$refs.JTEcharts).resize();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.init();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ async init() {
|
|
|
|
+ this.initEntitiesHandler();
|
|
|
|
+ debugger;
|
|
|
|
+ this.DrawScope();
|
|
|
|
+ await this.CalculateAnalysisArea();
|
|
|
|
+ await this.getGYLandOwnership();
|
|
|
|
+ await this.getJTLandOwnership();
|
|
|
|
+ let entitys = [];
|
|
|
|
+ if (viewer.entities.getById("HZFW")) {
|
|
|
|
+ entitys.push(viewer.entities.getById("HZFW"));
|
|
|
|
+ }
|
|
|
|
+ this.LayerData.GYData.forEach((GYData) => {
|
|
|
|
+ if (viewer.entities.getById(GYData.id)) {
|
|
|
|
+ entitys.push(viewer.entities.getById(GYData.id));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.LayerData.JTData.forEach((JTData) => {
|
|
|
|
+ if (viewer.entities.getById(JTData.id)) {
|
|
|
|
+ entitys.push(viewer.entities.getById(JTData.id));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ viewer.flyTo(entitys);
|
|
|
|
+ await this.CalculateJZDJ();
|
|
|
|
+ // await this.getGHDK();
|
|
|
|
+ // await this.getJZDJ();
|
|
|
|
+ await this.initGY();
|
|
|
|
+ await this.initJT();
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 渲染绘制范围
|
|
|
|
+ */
|
|
|
|
+ DrawScope() {
|
|
|
|
+ let ProjectScope = this.info.BenchmarkLandPrice.ProjectScope;
|
|
|
|
+ if (ProjectScope.length > 0) {
|
|
|
|
+ if (ProjectScope[0] != ProjectScope[ProjectScope.length - 1]) {
|
|
|
|
+ ProjectScope.push(ProjectScope[0]);
|
|
|
|
+ }
|
|
|
|
+ let points = ProjectScope.map((obj) => [obj.x, obj.y]).flat();
|
|
|
|
+ var orangePolygon1 = viewer.entities.add({
|
|
|
|
+ id: "HZFW",
|
|
|
|
+ polygon: {
|
|
|
|
+ hierarchy: Cesium.Cartesian3.fromDegreesArray(points),
|
|
|
|
+ material: Cesium.Color.RED.withAlpha(0.4),
|
|
|
|
+ outline: true,
|
|
|
|
+ outlineColor: Cesium.Color.BLACK,
|
|
|
|
+ outlineWidth: 2.0,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("请在传入分析范围");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 计算分析面积
|
|
|
|
+ */
|
|
|
|
+ CalculateAnalysisArea() {
|
|
|
|
+ this.formData.fxzmj = 0;
|
|
|
|
+ let points = this.info.BenchmarkLandPrice.ProjectScope;
|
|
|
|
+ let DataPs = points.map((item) => [item.x, item.y]);
|
|
|
|
+ if (DataPs.length > 0) {
|
|
|
|
+ if (
|
|
|
|
+ JSON.stringify(DataPs[0]) != JSON.stringify(DataPs[DataPs.length - 1])
|
|
|
|
+ ) {
|
|
|
|
+ DataPs.push(DataPs[0]);
|
|
|
|
+ }
|
|
|
|
+ let polygonPs = polygon([DataPs]);
|
|
|
|
+ let areaPs = area(polygonPs);
|
|
|
|
+ this.formData.fxzmj += +Number(areaPs).toFixed(2);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 计算基准地价
|
|
|
|
+ */
|
|
|
|
+ async CalculateJZDJ() {
|
|
|
|
+ let that = this;
|
|
|
|
+ debugger;
|
|
|
|
+ if (that.jzdj_LandUse) {
|
|
|
|
+ let landUseNatureRelation = flatten(window.landUseNatureRelation).find(
|
|
|
|
+ (c) => c.tdyt == that.jzdj_LandUse
|
|
|
|
+ );
|
|
|
|
+ if (landUseNatureRelation) {
|
|
|
|
+ let layerinfos = landUseNatureRelation.layerinfo;
|
|
|
|
+ for (let index = 0; index < layerinfos.length; index++) {
|
|
|
|
+ const layerinfo = layerinfos[index];
|
|
|
|
+ let layer = flatten(window.layerTree).find(
|
|
|
|
+ (item) => item.core == layerinfo.layerCore
|
|
|
|
+ );
|
|
|
|
+ if (layer && layer.date_server && layer.date_server.url) {
|
|
|
|
+ let points = this.info.BenchmarkLandPrice.ProjectScope;
|
|
|
|
+ let geo = {
|
|
|
|
+ id: 0,
|
|
|
|
+ style: null,
|
|
|
|
+ parts: [points.length],
|
|
|
|
+ points: points,
|
|
|
|
+ type: "REGION",
|
|
|
|
+ prjCoordSys: {
|
|
|
|
+ epsgCode: null,
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ let queryByGeometryParameters = {
|
|
|
|
+ getFeatureMode: "SPATIAL",
|
|
|
|
+ datasetNames: [
|
|
|
|
+ layer.date_server.dataSourceName +
|
|
|
|
+ ":" +
|
|
|
|
+ layer.date_server.datasetName,
|
|
|
|
+ ],
|
|
|
|
+ geometry: geo,
|
|
|
|
+ spatialQueryMode: "INTERSECT",
|
|
|
|
+ hasGeometry: "true",
|
|
|
|
+ };
|
|
|
|
+ let e = await mapQuery(
|
|
|
|
+ layer.date_server.url +
|
|
|
|
+ "/featureResults.json?returnContent=true",
|
|
|
|
+ queryByGeometryParameters
|
|
|
|
+ );
|
|
|
|
+ if (e && e.totalCount > 0) {
|
|
|
|
+ e.features.forEach((feature) => {
|
|
|
|
+ let layerData = {
|
|
|
|
+ id: uuidv4(),
|
|
|
|
+ layerInfo: layerinfo,
|
|
|
|
+ data: [],
|
|
|
|
+ geometry: feature.geometry,
|
|
|
|
+ };
|
|
|
|
+ feature.fieldNames.forEach((fieldName, i) => {
|
|
|
|
+ let Field = e.datasetInfos
|
|
|
|
+ ? e.datasetInfos[0].fieldInfos.find(
|
|
|
|
+ (c) =>
|
|
|
|
+ c.name &&
|
|
|
|
+ c.name.toUpperCase() == fieldName.toUpperCase() &&
|
|
|
|
+ c.name.toUpperCase().indexOf("SM") == -1
|
|
|
|
+ )
|
|
|
|
+ : null;
|
|
|
|
+ if (Field) {
|
|
|
|
+ layerData.data.push({
|
|
|
|
+ label: fieldName,
|
|
|
|
+ labelCN: Field ? Field.caption : fieldName,
|
|
|
|
+ value: feature.fieldValues[i],
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ let ps = [];
|
|
|
|
+ for (
|
|
|
|
+ let index = 0;
|
|
|
|
+ index < feature.geometry.points.length;
|
|
|
|
+ index++
|
|
|
|
+ ) {
|
|
|
|
+ const element = feature.geometry.points[index];
|
|
|
|
+ ps.push(element.x);
|
|
|
|
+ ps.push(element.y);
|
|
|
|
+ }
|
|
|
|
+ // var orangePolygon1 = viewer.entities.add({
|
|
|
|
+ // id: uuidv4(),
|
|
|
|
+ // polygon: {
|
|
|
|
+ // hierarchy: Cesium.Cartesian3.fromDegreesArray(ps),
|
|
|
|
+ // material: Cesium.Color.FUCHSIA.withAlpha(0.4),
|
|
|
|
+ // outline: true,
|
|
|
|
+ // outlineColor: Cesium.Color.BLACK,
|
|
|
|
+ // outlineWidth: 2.0,
|
|
|
|
+ // },
|
|
|
|
+ // });
|
|
|
|
+ that.LayerData.JZDJData.push(layerData);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(
|
|
|
|
+ "服务编码【" +
|
|
|
|
+ layerinfo.layerCore +
|
|
|
|
+ "】配置不正确,请检查后重试"
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //转换成超图格式面
|
|
|
|
+ let HZgeometry = {
|
|
|
|
+ partTopo: [1],
|
|
|
|
+ parts: [this.info.BenchmarkLandPrice.ProjectScope.length],
|
|
|
|
+ points: this.info.BenchmarkLandPrice.ProjectScope,
|
|
|
|
+ };
|
|
|
|
+ // 循环国有土地
|
|
|
|
+ that.LayerData.GYData.forEach((Data) => {
|
|
|
|
+ that.LayerData.JZDJData.forEach((JZDJ) => {
|
|
|
|
+ let area = that.calculateIntersectArea(
|
|
|
|
+ Data.geometry,
|
|
|
|
+ JZDJ.geometry,
|
|
|
|
+ HZgeometry
|
|
|
|
+ );
|
|
|
|
+ if (Number(area) > 0) {
|
|
|
|
+ let fromData = { area: area };
|
|
|
|
+ //土地级别
|
|
|
|
+ let tdjb = JZDJ.data.find(
|
|
|
|
+ (c) => c.label == JZDJ.layerInfo.tdjbField
|
|
|
|
+ ).value;
|
|
|
|
+ fromData.tdjb = tdjb;
|
|
|
|
+ //单价
|
|
|
|
+ let dj = JZDJ.data.find(
|
|
|
|
+ (c) => c.label == JZDJ.layerInfo.ydlxPriceField
|
|
|
|
+ ).value;
|
|
|
|
+ fromData.dj = Number(dj);
|
|
|
|
+ //占用面积地价
|
|
|
|
+ fromData.zdj = Number(area * dj);
|
|
|
|
+ Data.fromData.push(fromData);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ // 循环国有土地
|
|
|
|
+ that.LayerData.JTData.forEach((Data) => {
|
|
|
|
+ that.LayerData.JZDJData.forEach((JZDJ) => {
|
|
|
|
+ let area = that.calculateIntersectArea(
|
|
|
|
+ Data.geometry,
|
|
|
|
+ JZDJ.geometry,
|
|
|
|
+ HZgeometry
|
|
|
|
+ );
|
|
|
|
+ if (Number(area) > 0) {
|
|
|
|
+ let fromData = { area: area };
|
|
|
|
+ //土地级别
|
|
|
|
+ let tdjb = JZDJ.data.find(
|
|
|
|
+ (c) => c.label == JZDJ.layerInfo.tdjbField
|
|
|
|
+ ).value;
|
|
|
|
+ fromData.tdjb = tdjb;
|
|
|
|
+ //单价
|
|
|
|
+ let dj = JZDJ.data.find(
|
|
|
|
+ (c) => c.label == JZDJ.layerInfo.ydlxPriceField
|
|
|
|
+ ).value;
|
|
|
|
+ fromData.dj = Number(dj);
|
|
|
|
+ //占用面积地价
|
|
|
|
+ fromData.zdj = Number(area * dj);
|
|
|
|
+
|
|
|
|
+ Data.fromData.push(fromData);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ that.gyjtzdj();
|
|
|
|
+
|
|
|
|
+ setTimeout(function () {
|
|
|
|
+ that.setFXBG();
|
|
|
|
+ }, 4000); // 这里的3000毫秒等于3秒
|
|
|
|
+
|
|
|
|
+ debugger;
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("未配置当前土地用途,请联系管理员添加");
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error("请在土地用途");
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //计算国有和集体分别总地价
|
|
|
|
+ gyjtzdj() {
|
|
|
|
+ this.formData.zdj = 0;
|
|
|
|
+ this.formData.gyzdj = 0;
|
|
|
|
+ this.formData.jtzdj = 0;
|
|
|
|
+ this.LayerData.GYData.forEach((gyelement) => {
|
|
|
|
+ gyelement.fromData.forEach((element) => {
|
|
|
|
+ this.formData.gyzdj += element.zdj;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ this.LayerData.JTData.forEach((jtelement) => {
|
|
|
|
+ jtelement.fromData.forEach((element) => {
|
|
|
|
+ this.formData.jtzdj += element.zdj;
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ // 循环得出总地价
|
|
|
|
+ //转换成超图格式面
|
|
|
|
+ let HZgeometry = {
|
|
|
|
+ partTopo: [1],
|
|
|
|
+ parts: [this.info.BenchmarkLandPrice.ProjectScope.length],
|
|
|
|
+ points: this.info.BenchmarkLandPrice.ProjectScope,
|
|
|
|
+ };
|
|
|
|
+ this.LayerData.JZDJData.forEach((JZDJ) => {
|
|
|
|
+ let area = this.calculateIntersectArea(JZDJ.geometry, HZgeometry);
|
|
|
|
+ if (Number(area) > 0) {
|
|
|
|
+ //单价
|
|
|
|
+ let djval = JZDJ.data.find(
|
|
|
|
+ (c) => c.label == JZDJ.layerInfo.ydlxPriceField
|
|
|
|
+ );
|
|
|
|
+ if (djval) {
|
|
|
|
+ this.formData.zdj += Number(area * Number(djval.value));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查询区域内国有土地权属
|
|
|
|
+ */
|
|
|
|
+ async getGYLandOwnership() {
|
|
|
|
+ let that = this;
|
|
|
|
+ //查询国有使用权
|
|
|
|
+ let layer = flatten(window.layerTree).find(
|
|
|
|
+ (item) => item.core == "007001"
|
|
|
|
+ );
|
|
|
|
+ let points = this.info.BenchmarkLandPrice.ProjectScope;
|
|
|
|
+ let geo = {
|
|
|
|
+ id: 0,
|
|
|
|
+ style: null,
|
|
|
|
+ parts: [points.length],
|
|
|
|
+ points: points,
|
|
|
|
+ type: "REGION",
|
|
|
|
+ prjCoordSys: {
|
|
|
|
+ epsgCode: null,
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ let queryByGeometryParameters = {
|
|
|
|
+ getFeatureMode: "SPATIAL",
|
|
|
|
+ datasetNames: [
|
|
|
|
+ layer.date_server.dataSourceName +
|
|
|
|
+ ":" +
|
|
|
|
+ layer.date_server.datasetName,
|
|
|
|
+ ],
|
|
|
|
+ geometry: geo,
|
|
|
|
+ spatialQueryMode: "INTERSECT",
|
|
|
|
+ hasGeometry: "true",
|
|
|
|
+ };
|
|
|
|
+ let e = await mapQuery(
|
|
|
|
+ layer.date_server.url + "/featureResults.json?returnContent=true",
|
|
|
|
+ queryByGeometryParameters
|
|
|
|
+ );
|
|
|
|
+ if (e && e.totalCount > 0) {
|
|
|
|
+ e.features.forEach((feature) => {
|
|
|
|
+ let featureData = {
|
|
|
|
+ id: uuidv4(),
|
|
|
|
+ layerInfo: layer,
|
|
|
|
+ data: [],
|
|
|
|
+ fromData: [],
|
|
|
|
+ geometry: feature.geometry,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ feature.fieldNames.forEach((fieldName, i) => {
|
|
|
|
+ let Field = e.datasetInfos
|
|
|
|
+ ? e.datasetInfos[0].fieldInfos.find(
|
|
|
|
+ (c) =>
|
|
|
|
+ c.name &&
|
|
|
|
+ c.name.toUpperCase() == fieldName.toUpperCase() &&
|
|
|
|
+ c.name.toUpperCase().indexOf("SM") == -1
|
|
|
|
+ )
|
|
|
|
+ : null;
|
|
|
|
+ if (Field) {
|
|
|
|
+ featureData.data.push({
|
|
|
|
+ label: fieldName,
|
|
|
|
+ labelCN: Field ? Field.caption : fieldName,
|
|
|
|
+ value: e.features[0].fieldValues[i],
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ let ps = [];
|
|
|
|
+ for (
|
|
|
|
+ let index = 0;
|
|
|
|
+ index < featureData.geometry.points.length;
|
|
|
|
+ index++
|
|
|
|
+ ) {
|
|
|
|
+ const element = featureData.geometry.points[index];
|
|
|
|
+ ps.push(element.x);
|
|
|
|
+ ps.push(element.y);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var orangePolygon1 = viewer.entities.add({
|
|
|
|
+ id: "GYTD-" + featureData.id,
|
|
|
|
+ polygon: {
|
|
|
|
+ hierarchy: Cesium.Cartesian3.fromDegreesArray(ps),
|
|
|
|
+ material: Cesium.Color.AQUAMARINE.withAlpha(0.4),
|
|
|
|
+ outline: true,
|
|
|
|
+ outlineColor: Cesium.Color.BLACK,
|
|
|
|
+ outlineWidth: 2.0,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ that.LayerData.GYData.push(featureData);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 查询区域内集体土地权属
|
|
|
|
+ */
|
|
|
|
+ async getJTLandOwnership() {
|
|
|
|
+ let that = this;
|
|
|
|
+ //查询集体使用权
|
|
|
|
+ let layer = flatten(window.layerTree).find(
|
|
|
|
+ (item) => item.core == "007002"
|
|
|
|
+ );
|
|
|
|
+ let points = this.info.BenchmarkLandPrice.ProjectScope;
|
|
|
|
+ let geo = {
|
|
|
|
+ id: 0,
|
|
|
|
+ style: null,
|
|
|
|
+ parts: [points.length],
|
|
|
|
+ points: points,
|
|
|
|
+ type: "REGION",
|
|
|
|
+ prjCoordSys: {
|
|
|
|
+ epsgCode: null,
|
|
|
|
+ },
|
|
|
|
+ };
|
|
|
|
+ let queryByGeometryParameters = {
|
|
|
|
+ getFeatureMode: "SPATIAL",
|
|
|
|
+ datasetNames: [
|
|
|
|
+ layer.date_server.dataSourceName +
|
|
|
|
+ ":" +
|
|
|
|
+ layer.date_server.datasetName,
|
|
|
|
+ ],
|
|
|
|
+ geometry: geo,
|
|
|
|
+ spatialQueryMode: "INTERSECT",
|
|
|
|
+ hasGeometry: "true",
|
|
|
|
+ };
|
|
|
|
+ let e = await mapQuery(
|
|
|
|
+ layer.date_server.url + "/featureResults.json?returnContent=true",
|
|
|
|
+ queryByGeometryParameters
|
|
|
|
+ );
|
|
|
|
+ if (e && e.totalCount > 0) {
|
|
|
|
+ e.features.forEach((feature) => {
|
|
|
|
+ let featureData = {
|
|
|
|
+ id: uuidv4(),
|
|
|
|
+ layerInfo: layer,
|
|
|
|
+ data: [],
|
|
|
|
+ fromData: [],
|
|
|
|
+ geometry: feature.geometry,
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ feature.fieldNames.forEach((fieldName, i) => {
|
|
|
|
+ let Field = e.datasetInfos
|
|
|
|
+ ? e.datasetInfos[0].fieldInfos.find(
|
|
|
|
+ (c) =>
|
|
|
|
+ c.name &&
|
|
|
|
+ c.name.toUpperCase() == fieldName.toUpperCase() &&
|
|
|
|
+ c.name.toUpperCase().indexOf("SM") == -1
|
|
|
|
+ )
|
|
|
|
+ : null;
|
|
|
|
+ if (Field) {
|
|
|
|
+ featureData.data.push({
|
|
|
|
+ label: fieldName,
|
|
|
|
+ labelCN: Field ? Field.caption : fieldName,
|
|
|
|
+ value: e.features[0].fieldValues[i],
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ let ps = [];
|
|
|
|
+ for (
|
|
|
|
+ let index = 0;
|
|
|
|
+ index < featureData.geometry.points.length;
|
|
|
|
+ index++
|
|
|
|
+ ) {
|
|
|
|
+ const element = featureData.geometry.points[index];
|
|
|
|
+ ps.push(element.x);
|
|
|
|
+ ps.push(element.y);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ var orangePolygon1 = viewer.entities.add({
|
|
|
|
+ id: "JTTD-" + featureData.id,
|
|
|
|
+ polygon: {
|
|
|
|
+ hierarchy: Cesium.Cartesian3.fromDegreesArray(ps),
|
|
|
|
+ material: Cesium.Color.ORANGE.withAlpha(0.4),
|
|
|
|
+ outline: true,
|
|
|
|
+ outlineColor: Cesium.Color.BLACK,
|
|
|
|
+ outlineWidth: 2.0,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ that.LayerData.JTData.push(featureData);
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ initEntitiesHandler() {
|
|
|
|
+ debugger;
|
|
|
|
+ let that = this;
|
|
|
|
+ this.getEntitiesHandler = new Cesium.ScreenSpaceEventHandler(
|
|
|
|
+ scene.canvas
|
|
|
|
+ );
|
|
|
|
+ this.getEntitiesHandler.setInputAction(function (click) {
|
|
|
|
+ debugger;
|
|
|
|
+ let pick = viewer.scene.pick(click.position);
|
|
|
|
+ let id, info;
|
|
|
|
+ //集体所有权信息弹窗
|
|
|
|
+ if (pick && pick.id.id && pick.id.id.indexOf("JTTD") !== -1) {
|
|
|
|
+ id = pick.id.id.split("JTTD-")[1];
|
|
|
|
+ info = that.LayerData.JTData.find((c) => c.id == id);
|
|
|
|
+ that.openOBJInfo("集体所有权详情", info.data);
|
|
|
|
+ }
|
|
|
|
+ //国有所有权信息弹窗
|
|
|
|
+ if (pick && pick.id.id && pick.id.id.indexOf("GYTD-") !== -1) {
|
|
|
|
+ id = pick.id.id.split("GYTD-")[1];
|
|
|
|
+ info = that.LayerData.GYData.find((c) => c.id == id);
|
|
|
|
+ that.openOBJInfo("国有所有权详情", info.data);
|
|
|
|
+ }
|
|
|
|
+ }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
|
|
+ },
|
|
|
|
+ //打开用地红线信息弹窗
|
|
|
|
+ openOBJInfo(title, info) {
|
|
|
|
+ let w = document.body.offsetWidth;
|
|
|
|
+ let h = document.body.offsetHeight;
|
|
|
|
+ //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
|
|
|
|
+ //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
|
|
|
|
+ let left = 430 / 2 + 556;
|
|
|
|
+ let top = 430 / 2 + 60;
|
|
|
|
+ this.$layer.iframe({
|
|
|
|
+ id: "OBJInfolayer",
|
|
|
|
+ content: {
|
|
|
|
+ content: PlanningPlotInfo, //传递的组件对象
|
|
|
|
+ parent: this, //当前的vue对象
|
|
|
|
+ data: { info }, //props
|
|
|
|
+ },
|
|
|
|
+ offset: [left, top], //left top
|
|
|
|
+ area: ["430px", "430px"], //宽 高
|
|
|
|
+ title: title,
|
|
|
|
+ maxmin: false,
|
|
|
|
+ shade: false, //是否显示遮罩
|
|
|
|
+ shadeClose: false, //点击遮罩是否关闭
|
|
|
|
+ cancel: () => {
|
|
|
|
+ //关闭事件
|
|
|
|
+ // alert("关闭iframe");
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 打印分析报告
|
|
|
|
+ */
|
|
|
|
+ async handleGetBG() {
|
|
|
|
+ debugger;
|
|
|
|
+ if (this.info.BenchmarkLandPrice.ReportPath != "") {
|
|
|
|
+ debugger;
|
|
|
|
+ await getWord({ fileName: this.info.BenchmarkLandPrice.ReportPath });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 生成报告
|
|
|
|
+ */
|
|
|
|
+ async setFXBG() {
|
|
|
|
+ let that = this;
|
|
|
|
+ var promise = scene.outputSceneToFile();
|
|
|
|
+ // html2canvas(document.getElementById("cesiumContainer")).then(
|
|
|
|
+ Cesium.when(promise, async function (canvas) {
|
|
|
|
+ // 将canvas转换为base64图片
|
|
|
|
+ // let imageBase64 = canvas.toDataURL("image/jpeg");
|
|
|
|
+ let imageBase64 = canvas;
|
|
|
|
+ debugger;
|
|
|
|
+ let data = {
|
|
|
|
+ projectName: that.info.BenchmarkLandPrice.ProjectName, //项目名称
|
|
|
|
+ analysisDate: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"), //分析时间
|
|
|
|
+ projectType: that.info.BenchmarkLandPrice.ProjectType, //项目类型
|
|
|
|
+ buildUnit: that.info.BenchmarkLandPrice.ConstructionUnit, //建设单位
|
|
|
|
+ analysisArea: that.formData.fxzmj, //分析面积(平方米)
|
|
|
|
+ totalLandPrice: that.formData.zdj, //总地价(万元) 国有+集体 总地价预估合计
|
|
|
|
+ areaSCL: 0, //国有建设用地面积(平方米) 国有 土地面积合计
|
|
|
|
+ baseLandPriceSCL: 0, //国有建设用地基准地价(万元)
|
|
|
|
+ areaCCL: 0, //集体建设用地面积(平方米) 集体 土地面积合计
|
|
|
|
+ baseLandPriceCCL: 0, //集体建设用地基准地价(万元)
|
|
|
|
+ picBase64List: [imageBase64], //图片集 分析范围
|
|
|
|
+ definitionBLP: that.jzdj_LandUse, //报告类型名称
|
|
|
|
+ totalArea: 0, //国有+集体土地面积合计 平方米 tableList01 土地面积 + tableList01土地面积
|
|
|
|
+ landPriceESCL: 0, //国有土地地价预估 万元 国有 总地价预估合计 tableList01 总地价预估 累加
|
|
|
|
+ landPriceECCL: 0, // 集体土地地价预估 万元 集体 总地价预估合计 tableList02 总地价预估 累加
|
|
|
|
+ tableList01: [], //国有建设用地
|
|
|
|
+ tableList02: [], //集体建设用地
|
|
|
|
+ };
|
|
|
|
+ debugger;
|
|
|
|
+ that.LayerData.GYData.forEach((gyelement) => {
|
|
|
|
+ gyelement.fromData.forEach((element) => {
|
|
|
|
+ data.totalArea += element.area;
|
|
|
|
+ data.baseLandPriceSCL += element.zdj;
|
|
|
|
+ data.areaSCL += element.area;
|
|
|
|
+ data.landPriceESCL += element.zdj;
|
|
|
|
+ data.tableList01.push({
|
|
|
|
+ lv: element.tdjb,
|
|
|
|
+ landPrice: Number((element.dj * 666.67).toFixed(2)),
|
|
|
|
+ area: Number((element.area / 666.67).toFixed(2)),
|
|
|
|
+ landPriceES: Number((element.zdj / 10000).toFixed(2)),
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ that.LayerData.JTData.forEach((jtelement) => {
|
|
|
|
+ jtelement.fromData.forEach((element) => {
|
|
|
|
+ data.totalArea += element.area;
|
|
|
|
+ data.baseLandPriceCCL += element.zdj;
|
|
|
|
+ data.areaCCL += element.area;
|
|
|
|
+ data.landPriceECCL += element.zdj;
|
|
|
|
+ data.tableList02.push({
|
|
|
|
+ lv: element.tdjb,
|
|
|
|
+ landPrice: Number((element.dj * 666.67).toFixed(2)),
|
|
|
|
+ area: Number((element.area / 666.67).toFixed(2)),
|
|
|
|
+ landPriceES: Number((element.zdj / 10000).toFixed(2)),
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ data.analysisArea = Number((data.analysisArea / 666.67).toFixed(2));
|
|
|
|
+ data.totalLandPrice = Number((data.totalLandPrice / 10000).toFixed(2));
|
|
|
|
+ data.areaSCL = Number((data.areaSCL / 666.67).toFixed(2));
|
|
|
|
+ data.areaCCL = Number((data.areaCCL / 666.67).toFixed(2));
|
|
|
|
+ data.totalArea = Number((data.totalArea / 666.67).toFixed(2));
|
|
|
|
+ data.landPriceESCL = Number((data.landPriceESCL / 10000).toFixed(2));
|
|
|
|
+ data.landPriceECCL = Number((data.landPriceECCL / 10000).toFixed(2));
|
|
|
|
+ data.baseLandPriceCCL = Number(
|
|
|
|
+ (data.baseLandPriceCCL / 10000).toFixed(2)
|
|
|
|
+ );
|
|
|
|
+ data.baseLandPriceSCL = Number(
|
|
|
|
+ (data.baseLandPriceSCL / 10000).toFixed(2)
|
|
|
|
+ );
|
|
|
|
+ debugger;
|
|
|
|
+ let JZDJWordPath = await getJZDJWord(data);
|
|
|
|
+ debugger;
|
|
|
|
+ if (JZDJWordPath.code == 200) {
|
|
|
|
+ that.info.BenchmarkLandPrice.AnalysisStatus = "完成";
|
|
|
|
+ that.info.BenchmarkLandPrice.ReportPath = JZDJWordPath.msg;
|
|
|
|
+ let BenchmarkLandPrice = window.BenchmarkLandPriceList.find(
|
|
|
|
+ (c) => (c.id = that.info.BenchmarkLandPrice.id)
|
|
|
|
+ );
|
|
|
|
+ BenchmarkLandPrice.AnalysisStatus = "完成";
|
|
|
|
+ BenchmarkLandPrice.ReportPath = JZDJWordPath.msg;
|
|
|
|
+
|
|
|
|
+ // that.$notify({
|
|
|
|
+ // title: "成功",
|
|
|
|
+ // message:
|
|
|
|
+ // that.info.BenchmarkLandPrice.ProjectName + "报告已生成,可下载",
|
|
|
|
+ // type: "success",
|
|
|
|
+ // });
|
|
|
|
+ } else {
|
|
|
|
+ that.info.BenchmarkLandPrice.AnalysisStatus = "异常";
|
|
|
|
+ let BenchmarkLandPrice = window.BenchmarkLandPriceList.find(
|
|
|
|
+ (c) => (c.id = that.info.BenchmarkLandPrice.id)
|
|
|
|
+ );
|
|
|
|
+ BenchmarkLandPrice.AnalysisStatus = "异常";
|
|
|
|
+ that.$notify.error({
|
|
|
|
+ title: "异常",
|
|
|
|
+ message:
|
|
|
|
+ that.info.BenchmarkLandPrice.ProjectName +
|
|
|
|
+ "报告生成异常,请重新选取区域分析",
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 计算两个面的交集面积
|
|
|
|
+ * @param Points1
|
|
|
|
+ * @param Points2
|
|
|
|
+ * @param Points3
|
|
|
|
+ */
|
|
|
|
+ calculateIntersectArea(Points1, Points2, Points3) {
|
|
|
|
+ var geometry1;
|
|
|
|
+ var geometry2;
|
|
|
|
+ var geometry3;
|
|
|
|
+ if (Points1) {
|
|
|
|
+ geometry1 = this.AssemblySurface(Points1);
|
|
|
|
+ }
|
|
|
|
+ if (Points2) {
|
|
|
|
+ geometry2 = this.AssemblySurface(Points2);
|
|
|
|
+ }
|
|
|
|
+ if (Points3) {
|
|
|
|
+ geometry3 = this.AssemblySurface(Points3);
|
|
|
|
+ }
|
|
|
|
+ let areaPs;
|
|
|
|
+ if (geometry1 && geometry2) {
|
|
|
|
+ areaPs = intersect(geometry1, geometry2);
|
|
|
|
+ }
|
|
|
|
+ if (areaPs && geometry3) {
|
|
|
|
+ areaPs = intersect(areaPs, geometry3);
|
|
|
|
+ }
|
|
|
|
+ if (areaPs) {
|
|
|
|
+ const areadifference = area(areaPs);
|
|
|
|
+ return Number(areadifference.toFixed(2));
|
|
|
|
+ } else {
|
|
|
|
+ return 0;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 组装带洞和不带洞的面
|
|
|
|
+ * @param geometry 超图返回的图形数组
|
|
|
|
+ */
|
|
|
|
+ AssemblySurface(geometry) {
|
|
|
|
+ let point3ds = [];
|
|
|
|
+ let pointholes = [];
|
|
|
|
+ let startindex = 0;
|
|
|
|
+ for (let index = 0; index < geometry.parts.length; index++) {
|
|
|
|
+ let thisps = [];
|
|
|
|
+ const endindex = startindex + geometry.parts[index];
|
|
|
|
+ let geometryPoints = geometry.points.slice(startindex, endindex);
|
|
|
|
+ for (
|
|
|
|
+ let pointindex = 0;
|
|
|
|
+ pointindex < geometryPoints.length;
|
|
|
|
+ pointindex++
|
|
|
|
+ ) {
|
|
|
|
+ const point = geometryPoints[pointindex];
|
|
|
|
+ thisps.push([point.x, point.y]);
|
|
|
|
+ }
|
|
|
|
+ if (geometry.partTopo[index] === 1) {
|
|
|
|
+ point3ds.push(thisps);
|
|
|
|
+ } else {
|
|
|
|
+ pointholes.push(thisps);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ startindex = endindex;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 主多边形
|
|
|
|
+ var mainPolygon = polygon(point3ds);
|
|
|
|
+
|
|
|
|
+ // 岛洞多边形
|
|
|
|
+ var holePolygon = polygon(pointholes);
|
|
|
|
+
|
|
|
|
+ // 计算差集 得到有导洞的图形
|
|
|
|
+ var getdifference = difference(mainPolygon, holePolygon);
|
|
|
|
+ return getdifference;
|
|
|
|
+ },
|
|
|
|
+ clear() {
|
|
|
|
+ //删除国有土地权属图层
|
|
|
|
+ for (let index = 0; index < this.LayerData.GYData.length; index++) {
|
|
|
|
+ const element = this.LayerData.GYData[index];
|
|
|
|
+ viewer.entities.removeById("GYTD-" + element.id);
|
|
|
|
+ }
|
|
|
|
+ this.LayerData.GYData = [];
|
|
|
|
+ //删除国有土集体属图层
|
|
|
|
+ for (let index = 0; index < this.LayerData.JTData.length; index++) {
|
|
|
|
+ const element = this.LayerData.JTData[index];
|
|
|
|
+ viewer.entities.removeById("JTTD-" + element.id);
|
|
|
|
+ }
|
|
|
|
+ this.LayerData.JTData = [];
|
|
|
|
+ //删除规划地块图层
|
|
|
|
+ for (let index = 0; index < this.LayerData.GHDKData.length; index++) {
|
|
|
|
+ const element = this.LayerData.GHDKData[index];
|
|
|
|
+ viewer.entities.removeById("GHDK-" + element.id);
|
|
|
|
+ }
|
|
|
|
+ this.LayerData.GHDKData = [];
|
|
|
|
+ //删除绘制范围
|
|
|
|
+ viewer.entities.removeById("HZFW");
|
|
|
|
+ },
|
|
|
|
+ initGY() {
|
|
|
|
+ this.GYmyChart = window.echarts.init(this.$refs.GYEcharts);
|
|
|
|
+
|
|
|
|
+ let djGroup = this.GroupByzdj(this.LayerData.GYData);
|
|
|
|
+ let data = [];
|
|
|
|
+ djGroup.forEach((element) => {
|
|
|
|
+ data.push({
|
|
|
|
+ value: Number((element.zdj / 10000).toFixed(2)),
|
|
|
|
+ name: element.tdjb,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var option = {
|
|
|
|
+ color: [
|
|
|
|
+ "#5470c6",
|
|
|
|
+ "#91cc75",
|
|
|
|
+ "#fac858",
|
|
|
|
+ "#ee6666",
|
|
|
|
+ "#73c0de",
|
|
|
|
+ "#3ba272",
|
|
|
|
+ "#fc8452",
|
|
|
|
+ "#9a60b4",
|
|
|
|
+ "#ea7ccc",
|
|
|
|
+ ],
|
|
|
|
+ tooltip: {
|
|
|
|
+ trigger: "item",
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ legend: {
|
|
|
|
+ orient: "vertical",
|
|
|
|
+ top: "center",
|
|
|
|
+ right: 0,
|
|
|
|
+ radius: "60%",
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: "#FFFFFF",
|
|
|
|
+ },
|
|
|
|
+ formatter: function (name) {
|
|
|
|
+ var val = data.find((t) => t.name == name);
|
|
|
|
+ if (val) {
|
|
|
|
+ return name + " " + val.value + "万元";
|
|
|
|
+ } else {
|
|
|
|
+ return name;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ type: "pie",
|
|
|
|
+ radius: ["40%", "70%"],
|
|
|
|
+ center: ["35%", "50%"], // 将饼图的中心点向左调整到容器宽度的30%,纵坐标保持在中心
|
|
|
|
+ avoidLabelOverlap: false,
|
|
|
|
+ itemStyle: {
|
|
|
|
+ borderRadius: 10,
|
|
|
|
+ borderColor: "#fff",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ label: {
|
|
|
|
+ position: "center",
|
|
|
|
+ show: true,
|
|
|
|
+ formatter: () => {
|
|
|
|
+ let str =
|
|
|
|
+ "国有建设用地" +
|
|
|
|
+ "\n" +
|
|
|
|
+ "基准地价预估" +
|
|
|
|
+ "\n" +
|
|
|
|
+ (this.formData.gyzdj / 10000).toFixed(2) +
|
|
|
|
+ "万元";
|
|
|
|
+ return str;
|
|
|
|
+ },
|
|
|
|
+ color: "#FFFFFF",
|
|
|
|
+ lineHeight: 16,
|
|
|
|
+ fontSize: 12,
|
|
|
|
+ },
|
|
|
|
+ // emphasis: {
|
|
|
|
+ // label: {
|
|
|
|
+ // show: true,
|
|
|
|
+ // fontSize: 20,
|
|
|
|
+ // fontWeight: "bold",
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ labelLine: {
|
|
|
|
+ show: false,
|
|
|
|
+ },
|
|
|
|
+ data: data.length > 0 ? data : [{ value: 0, name: "无数据" }],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ this.GYmyChart.setOption(option);
|
|
|
|
+ },
|
|
|
|
+ initJT() {
|
|
|
|
+ this.JTmyChart = window.echarts.init(this.$refs.JTEcharts);
|
|
|
|
+
|
|
|
|
+ let djGroup = this.GroupByzdj(this.LayerData.JTData);
|
|
|
|
+ let data = [];
|
|
|
|
+ djGroup.forEach((element) => {
|
|
|
|
+ data.push({
|
|
|
|
+ value: Number((element.zdj / 10000).toFixed(2)),
|
|
|
|
+ name: element.tdjb,
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ var option = {
|
|
|
|
+ color: [
|
|
|
|
+ "#5470c6",
|
|
|
|
+ "#91cc75",
|
|
|
|
+ "#fac858",
|
|
|
|
+ "#ee6666",
|
|
|
|
+ "#73c0de",
|
|
|
|
+ "#3ba272",
|
|
|
|
+ "#fc8452",
|
|
|
|
+ "#9a60b4",
|
|
|
|
+ "#ea7ccc",
|
|
|
|
+ ],
|
|
|
|
+ tooltip: {
|
|
|
|
+ trigger: "item",
|
|
|
|
+ },
|
|
|
|
+ legend: {
|
|
|
|
+ orient: "vertical",
|
|
|
|
+ top: "center",
|
|
|
|
+ right: 0,
|
|
|
|
+ radius: "60%",
|
|
|
|
+ textStyle: {
|
|
|
|
+ color: "#FFFFFF",
|
|
|
|
+ },
|
|
|
|
+ formatter: function (name) {
|
|
|
|
+ var val = data.find((t) => t.name == name);
|
|
|
|
+ if (val) {
|
|
|
|
+ return name + " " + val.value + "万元";
|
|
|
|
+ } else {
|
|
|
|
+ return name;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ type: "pie",
|
|
|
|
+ radius: ["40%", "70%"],
|
|
|
|
+ center: ["35%", "50%"], // 将饼图的中心点向左调整到容器宽度的30%,纵坐标保持在中心
|
|
|
|
+ avoidLabelOverlap: false,
|
|
|
|
+ itemStyle: {
|
|
|
|
+ borderRadius: 10,
|
|
|
|
+ borderColor: "#fff",
|
|
|
|
+ borderWidth: 2,
|
|
|
|
+ },
|
|
|
|
+ label: {
|
|
|
|
+ position: "center",
|
|
|
|
+ show: true,
|
|
|
|
+ formatter: () => {
|
|
|
|
+ let str =
|
|
|
|
+ "集体建设用地" +
|
|
|
|
+ "\n" +
|
|
|
|
+ "基准地价预估" +
|
|
|
|
+ "\n" +
|
|
|
|
+ (this.formData.jtzdj / 10000).toFixed(2) +
|
|
|
|
+ "万元";
|
|
|
|
+ return str;
|
|
|
|
+ },
|
|
|
|
+ color: "#FFFFFF",
|
|
|
|
+ lineHeight: 16,
|
|
|
|
+ fontSize: 12,
|
|
|
|
+ },
|
|
|
|
+ // emphasis: {
|
|
|
|
+ // label: {
|
|
|
|
+ // show: true,
|
|
|
|
+ // fontSize: 20,
|
|
|
|
+ // fontWeight: "bold",
|
|
|
|
+ // },
|
|
|
|
+ // },
|
|
|
|
+ labelLine: {
|
|
|
|
+ show: false,
|
|
|
|
+ },
|
|
|
|
+ data: data.length > 0 ? data : [{ value: 0, name: "无数据" }],
|
|
|
|
+ },
|
|
|
|
+ ],
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ this.JTmyChart.setOption(option);
|
|
|
|
+ },
|
|
|
|
+ //切换用地类型时加载用地规划图层
|
|
|
|
+ async handleChange() {
|
|
|
|
+ //先清空数据
|
|
|
|
+ this.formData.gyzdj = 0;
|
|
|
|
+ this.formData.jtzdj = 0;
|
|
|
|
+ this.LayerData.GYData.forEach((element) => {
|
|
|
|
+ element.fromData = [];
|
|
|
|
+ });
|
|
|
|
+ this.LayerData.JTData.forEach((element) => {
|
|
|
|
+ element.fromData = [];
|
|
|
|
+ });
|
|
|
|
+ this.LayerData.JZDJData = [];
|
|
|
|
+
|
|
|
|
+ await this.CalculateJZDJ();
|
|
|
|
+ await this.initGY();
|
|
|
|
+ await this.initJT();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 对数组字段分组并求和计算每个土地级别的总地价
|
|
|
|
+ * @param djData
|
|
|
|
+ */
|
|
|
|
+ GroupByzdj(djData) {
|
|
|
|
+ let data = [];
|
|
|
|
+ djData.forEach((element) => {
|
|
|
|
+ data = data.concat(element.fromData);
|
|
|
|
+ });
|
|
|
|
+ const groupedData = data.reduce((accumulator, currentValue) => {
|
|
|
|
+ // 如果累加器(accumulator)中没有这个分组,就添加它
|
|
|
|
+ if (!accumulator[currentValue.tdjb]) {
|
|
|
|
+ accumulator[currentValue.tdjb] = { tdjb: currentValue.tdjb, zdj: 0 };
|
|
|
|
+ }
|
|
|
|
+ // 将当前对象的b值累加到对应分组上
|
|
|
|
+ accumulator[currentValue.tdjb].zdj += currentValue.zdj;
|
|
|
|
+ // 返回累加器,以便下一次迭代使用
|
|
|
|
+ return accumulator;
|
|
|
|
+ }, {});
|
|
|
|
+
|
|
|
|
+ // 将结果转换为数组(如果需要的话)
|
|
|
|
+ const resultArray = Object.keys(groupedData).map(
|
|
|
|
+ (key) => groupedData[key]
|
|
|
|
+ );
|
|
|
|
+ return resultArray;
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ beforeDestroy() {
|
|
|
|
+ if (this.getEntitiesHandler) {
|
|
|
|
+ this.getEntitiesHandler.removeInputAction(
|
|
|
|
+ Cesium.ScreenSpaceEventType.LEFT_CLICK
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ this.clear();
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss">
|
|
|
|
+@import "@/../../zt.scss";
|
|
|
|
+</style>
|
|
|
|
+<style scoped>
|
|
|
|
+.el-date-editor--daterange.el-input__inner {
|
|
|
|
+ width: auto;
|
|
|
|
+ background-color: rgba(4, 28, 50, 0.5);
|
|
|
|
+ border: 1px solid rgba(15, 122, 200, 0.4);
|
|
|
|
+}
|
|
|
|
+.card_body_style {
|
|
|
|
+ border: 1px dashed #02a7f0;
|
|
|
|
+}
|
|
|
|
+.hover_style:hover {
|
|
|
|
+ border: 1px solid #02a7f0;
|
|
|
|
+}
|
|
|
|
+.con-col {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-flow: column nowrap;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.container_center {
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center; /* 垂直居中 */
|
|
|
|
+ justify-content: center; /* 水平居中,如果也需要水平居中的话 */
|
|
|
|
+}
|
|
|
|
+.EchartsWH {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 16rem;
|
|
|
|
+}
|
|
|
|
+</style>
|