Browse Source

合并中途代码

zpf 11 months ago
parent
commit
13b3cf8691

File diff suppressed because it is too large
+ 0 - 381
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/BenchmarkLandPrice.js


+ 58 - 38
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/BenchmarkLandPrice.vue

@@ -151,6 +151,9 @@
               </el-col>
             </el-row>
           </el-tab-pane>
+          <el-tab-pane label="分析报告" name="third">
+            <jzdjfxsmjg  v-if="iSjzdjfxsmjgShow" :info="{BenchmarkLandPrice:BenchmarkLandPriceinfo}"></jzdjfxsmjg>
+          </el-tab-pane>
         </el-tabs>
       </el-col>
     </el-row>
@@ -161,7 +164,7 @@ import { v4 as uuidv4 } from "uuid";
 import moment from "moment";
 import jzdjfxsmInfo from "./jzdjfxsmInfo.vue";
 import jzdjfxsmjg from "./jzdjfxsmjg.vue";
-import BenchmarkLandPrice from "./BenchmarkLandPrice.js";
+import BenchmarkLandPrice from "./BenchmarkLandPrice_old.js";
 import {
   cartesian3ToWGS84,
   mapQuery,
@@ -191,7 +194,8 @@ export default {
       activeName: "first",
       //绘制事件
       // handlerPolygon: null,
-
+      iSjzdjfxsmjgShow:false,
+      BenchmarkLandPriceinfo:null,
       form: {
         id: "",
         ProjectScope: [],
@@ -199,7 +203,6 @@ export default {
         ProjectType: "",
         ConstructionUnit: "",
         imageBase64: [],
-        jgData:null
       },
       rules: {
         ProjectName: [
@@ -218,6 +221,9 @@ export default {
       },
     };
   },
+  components: {
+    jzdjfxsmjg
+  },
   mounted() {
     this.init();
   },
@@ -248,7 +254,12 @@ export default {
      * @param {Object} event
      */
     handleClick(tab, event) {
-      console.log(tab, event);
+      if (this.activeName == "third") {
+        this.iSjzdjfxsmjgShow=true;
+      }else{
+        this.iSjzdjfxsmjgShow=false;
+      }
+      
     },
 
     /**
@@ -309,9 +320,12 @@ export default {
       handlerPolygon.drawEvt.addEventListener((result) => {
 
         handlerPolygon.polygon.show = true;
-        handlerPolygon.polyline.show = true;
-        handlerPolygon.polygon.polygon.material.color =
-          Cesium.Color.CHARTREUSE.withAlpha(0.5);
+        handlerPolygon.polyline.show = false;
+        debugger
+        handlerPolygon.polygon.polygon.material.color = Cesium.Color.WHITE.withAlpha(0.3);
+        handlerPolygon.polygon.polygon.outline= true;
+        handlerPolygon.polygon.polygon.outlineColor= Cesium.Color.RED;
+          handlerPolygon.polygon.polygon.outlineWidth= 2.0;
         that.tooltip.setVisible(false);
         var polygon = result.object;
         if (!polygon) {
@@ -351,7 +365,7 @@ export default {
           );
           this.init();
           let data=this.BenchmarkLandPriceList.find(c=>c.id==that.form.id);
-          BenchmarkLandPrice.calculateLandPrice(data,function(response){
+          BenchmarkLandPrice.calculateLandPrice(data,true,function(response){
             if(response){
                 data.AnalysisStatus = "完成";
                 data.AnalysisResults=response;
@@ -416,6 +430,7 @@ export default {
         let res = e.target.result; //ArrayBuffer
         shp(res)
           .then(function (res) {
+            debugger
             // self.addGeometry(res)
             geojson = res;
             console.log(geojson);
@@ -464,10 +479,10 @@ export default {
             new Cesium.Cartesian3.fromDegreesArray(positions)
           ),
           // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
-          material: new Cesium.Color(255 / 255, 211 / 255, 128 / 255, 1),
+          material: Cesium.Color.WHITE.withAlpha(0.3),
           outline: true,
-          outlineColor: Cesium.Color.BLACK,
-          outlineWidth: 1.0,
+          outlineColor: Cesium.Color.RED,
+          outlineWidth: 2.0,
         },
       });
       
@@ -481,33 +496,38 @@ export default {
      * @param BenchmarkLandPrice 基准地价信息
      */
     openAnalyzeResults(BenchmarkLandPrice) {
-      debugger
-      if (this.FXJGInfolayerid) {
-        this.$layer.close(this.FXJGInfolayerid);
-      }
-      let that = this;
-      let w = document.body.offsetWidth;
-      let h = document.body.offsetHeight;
-      //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
-      //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
-      let left = w - 480 + 480 / 2;
-      let top = 830 / 2 + 60;
-      this.FXJGInfolayerid = this.$layer.iframe({
-        content: {
-          content: jzdjfxsmjg, //传递的组件对象
-          parent: this, //当前的vue对象
-          data: { info: { BenchmarkLandPrice } }, //props
-        },
-        offset: [left, top], //left top
-        area: ["480px", "830px"], //宽 高
-        title: "分析结果",
-        maxmin: false,
-        shade: false, //是否显示遮罩
-        shadeClose: false, //点击遮罩是否关闭
-        cancel: () => {
-          // this.init();
-        },
-      });
+      this.BenchmarkLandPriceinfo=JSON.parse(JSON.stringify(BenchmarkLandPrice));
+      this.iSjzdjfxsmjgShow=true;
+      this.activeName = "third";
+      
+
+      // debugger
+      // if (this.FXJGInfolayerid) {
+      //   this.$layer.close(this.FXJGInfolayerid);
+      // }
+      // let that = this;
+      // let w = document.body.offsetWidth;
+      // let h = document.body.offsetHeight;
+      // //左上角(left=弹窗宽/2;top=弹窗高/2+header高)
+      // //右上角 (left=w-弹窗宽+(弹窗宽/2);top=弹窗高/2+header高);
+      // let left = w - 480 + 480 / 2;
+      // let top = 830 / 2 + 60;
+      // this.FXJGInfolayerid = this.$layer.iframe({
+      //   content: {
+      //     content: jzdjfxsmjg, //传递的组件对象
+      //     parent: this, //当前的vue对象
+      //     data: { info: { BenchmarkLandPrice } }, //props
+      //   },
+      //   offset: [left, top], //left top
+      //   area: ["480px", "830px"], //宽 高
+      //   title: "分析结果",
+      //   maxmin: false,
+      //   shade: false, //是否显示遮罩
+      //   shadeClose: false, //点击遮罩是否关闭
+      //   cancel: () => {
+      //     // this.init();
+      //   },
+      // });
     },
     //切换用地类型时加载用地规划图层
     handleChange() {

+ 397 - 0
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/BenchmarkLandPrice_old.js

@@ -0,0 +1,397 @@
+import { v4 as uuidv4 } from "uuid";
+import moment from "moment";
+import {
+  cartesian3ToWGS84,
+  mapQuery,
+  flatten,
+  mercator2lonLat,
+  undergroundMode,
+} from "@/utils/MapHelper/MapHelper.js";
+import {
+  area,
+  intersect,
+  polygon,
+  point,
+  midpoint,
+  difference,
+} from "@turf/turf";
+const BenchmarkLandPrice = {
+  /**
+   * 基准地价分析
+   * @param {*} BenchmarkLandPrice {
+        ProjectScope: [],分析范围
+        ProjectName: "",项目名称
+        ConstructionUnit: "",建设单位
+        imageBase64: [],输出图片
+      }
+   * @param {*} isOutputImg 是否输出范围图片 true false 如需输出图片,请确保要输出的范围已在屏幕正确认为
+   * @param {*} Callback 回调
+   */
+  async calculateLandPrice(BenchmarkLandPrice, isOutputImg = false, Callback) {
+    let GHDKList = await this.getGHDKs(BenchmarkLandPrice);
+    await this.GetJZDJ(BenchmarkLandPrice, GHDKList);
+    let data = await this.CalculateJZDJ(BenchmarkLandPrice, GHDKList);
+    if (isOutputImg) {
+      if (data && data.picBase64List) {
+        var promise = scene.outputSceneToFile();
+        Cesium.when(promise, function (base64data) {
+          data.picBase64List.push(base64data);
+          if (Callback) Callback(data);
+        });
+      } else {
+        if (Callback) Callback(false);
+      }
+    } else {
+      if (data) {
+        if (Callback) Callback(data);
+      } else {
+        if (Callback) Callback(false);
+      }
+    }
+  },
+
+  /**
+   * 查询区域内规划地块
+   * @param {*} BenchmarkLandPrice 基准地价信息
+   * @returns {*} 图层返回信息
+   * {
+          id: uuidv4(),
+          layerInfo: layer,
+          data: [],
+          geometry: feature.geometry,
+        }
+   */
+  async getGHDKs(BenchmarkLandPrice) {
+    let featureDataList = [];
+    //查询规划地块
+    let layer = flatten(window.layerTree).find((item) => item.core == "003006");
+    let points = 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: [],
+          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: feature.fieldValues[i],
+            });
+          }
+        });
+        featureDataList.push(featureData);
+      });
+    }
+    return featureDataList;
+  },
+
+  /**
+   * 获取基准地价
+   * @param {*} BenchmarkLandPrice
+   * @param {*} GHDKList
+   * @returns
+   */
+  async GetJZDJ(BenchmarkLandPrice, GHDKList) {
+    for (let GHDKindex = 0; GHDKindex < GHDKList.length; GHDKindex++) {
+      let GHDK = GHDKList[GHDKindex];
+      GHDK.JZDJList = [];
+      let KZXXGYDDM = GHDK.data.find((c) => c.label == "KZXXGYDDM");
+      let landUseNatureRelation = flatten(window.landUseNatureRelation).find(
+        (c) => {
+          let GHDKType = c.GHDKType.find((a) =>
+            KZXXGYDDM.value.startsWith(a.ydxzdl)
+          );
+
+          return GHDKType != null;
+        }
+      );
+      if (landUseNatureRelation) {
+        let layerinfos = landUseNatureRelation.layerinfo;
+        for (let index = 0; index < layerinfos.length; index++) {
+          let 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 = 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],
+                    });
+                  }
+                });
+                GHDK.JZDJList.push(layerData);
+              });
+            }
+          } else {
+            console.log(
+              "服务编码【" + layerinfo.layerCore + "】配置不正确,请检查后重试"
+            );
+          }
+        }
+      } else {
+        console.log(KZXXGYDDM + "未配置当前土地用途,请联系管理员添加");
+      }
+    }
+  },
+
+  /**
+   * 计算基准地价
+   */
+  async CalculateJZDJ(BenchmarkLandPrice, GHDKList) {
+    //转换成超图格式面
+    let HZgeometry = {
+      partTopo: [1],
+      parts: [BenchmarkLandPrice.ProjectScope.length],
+      points: BenchmarkLandPrice.ProjectScope,
+    };
+    // 循环规划地块区域信息
+    GHDKList.forEach((GHDK) => {
+      GHDK.fromData = [];
+      GHDK.JZDJList.forEach((JZDJ) => {
+        let area = this.calculateIntersectArea(
+          GHDK.geometry,
+          JZDJ.geometry,
+          HZgeometry
+        );
+        if (Number(area) > 0) {
+          let fromData = { data: JZDJ.data, area: Number(area) / 666.66 };
+          //土地级别
+          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) * 666.66) / 10000;
+          //占用面积地价
+          fromData.zdj = Number(area * dj) / 10000;
+          fromData.geometry = JZDJ.geometry;
+          GHDK.fromData.push(fromData);
+        }
+      });
+    });
+
+    //计算分析面积
+    let fxzmj = this.CalculateAnalysisArea(BenchmarkLandPrice);
+    //总地价
+    let zdj = 0;
+    //参与地价计算的面积(规划地块+绘制范围+地价地块范围三者交集)
+    let jszmj = 0;
+    //规划地块详细地价
+    let ghdkDetailedDjList = [];
+    GHDKList.forEach((GHDK) => {
+      let ghdkDetailed = {};
+      ghdkDetailed.id = GHDK.id;
+      ghdkDetailed.geometry = GHDK.geometry;
+      ghdkDetailed.data = GHDK.data;
+      ghdkDetailed.ghyt = GHDK.data.find((c) => c.label == "KZXXGYDMC").value;
+      ghdkDetailed.dkbm = GHDK.data.find((c) => c.label == "DKBM").value;
+      //占用土地
+      ghdkDetailed.zytdList = GHDK.fromData;
+      ghdkDetailedDjList.push(ghdkDetailed);
+      GHDK.fromData.forEach((fromData) => {
+        zdj += fromData.zdj;
+        jszmj += fromData.area;
+      });
+    });
+    ghdkDetailedDjList = ghdkDetailedDjList.filter(
+      (c) => c.zytdList && c.zytdList.length > 0
+    );
+
+    return {
+      projectName: BenchmarkLandPrice.ProjectName, //项目名称
+      analysisDate: moment(new Date()).format("YYYY-MM-DD HH:mm:ss"), //分析时间
+      // projectType: BenchmarkLandPrice.ProjectType, //项目类型
+      buildUnit: BenchmarkLandPrice.ConstructionUnit, //建设单位
+      analysisArea: fxzmj, //分析面积(亩)
+      ParticipationArea: jszmj, //参与地价计算的面积(亩)
+      totalLandPrice: zdj, //总地价(万元)  总地价预估合计
+      ghdkDetailedDjList: ghdkDetailedDjList, //规划地块详细地价
+      picBase64List: [], //图片集 分析范围
+    };
+  },
+
+  /**
+   * 计算分析面积
+   * @param {*} BenchmarkLandPrice 基准地价信息
+   * @returns {number} 分析总面积
+   */
+  CalculateAnalysisArea(BenchmarkLandPrice) {
+    let fxzmj = 0;
+    let points = 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]);
+      }
+      debugger;
+      let polygonPs = polygon([DataPs]);
+      let sdsd = area(polygonPs);
+      let areaPs = area(polygonPs) * window.earthRadius;
+      fxzmj = Number(areaPs / 666.66).toFixed(2);
+    }
+    return fxzmj;
+  },
+
+  /**
+   * 计算两个面的交集面积
+   * @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) {
+      let areadifference = area(areaPs) * window.earthRadius;
+      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 = [];
+      let endindex = startindex + geometry.parts[index];
+      let geometryPoints = geometry.points.slice(startindex, endindex);
+      for (
+        let pointindex = 0;
+        pointindex < geometryPoints.length;
+        pointindex++
+      ) {
+        let 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;
+  },
+};
+/**
+ * 基准地价分析
+ */
+export default BenchmarkLandPrice;

+ 30 - 25
src/views/ConstructionApplication3D/BenchmarkLandPriceAnalysis/jzdjfxsmjg.vue

@@ -1,10 +1,12 @@
 <template>
-  <div
-    class="ZTGlobal"
-    style="width: 100%; padding: 1rem 1rem 0rem 1rem; color: white"
-  >
-    <el-container style="height: 100%">
-      <el-header height="12rem">
+  <div class="ZTGlobal" style="width: 100%; height: 37rem; color: white">
+    <el-empty
+      image=""
+      v-if="info.BenchmarkLandPrice == null"
+      description="暂无数据"
+    ></el-empty>
+    <el-container v-if="info.BenchmarkLandPrice != null" style="height: 100%">
+      <el-header height="12rem" style="padding: 0px">
         <el-row :gutter="10" style="display: flex; align-items: center">
           <el-col :span="18">
             {{ info.BenchmarkLandPrice.ProjectName }}
@@ -109,7 +111,7 @@
           </el-col>
         </el-row>
       </el-header>
-      <el-main>
+      <el-main height="12rem">
         <el-tabs v-model="activeName" class="full-height">
           <el-tab-pane label="总体情况" name="first" style="height: 100%">
             <div id="echartFGY" ref="echartFGY" class="EchartsWH">
@@ -133,7 +135,7 @@
               </el-table-column>
               <el-table-column prop="ghyt" label="地类名称"> </el-table-column>
 
-              <el-table-column prop="area" align="center">
+              <el-table-column prop="area" align="center" width="60">
                 <template slot="header">
                   <div>占用面积</div>
                   <div>(亩)</div>
@@ -187,7 +189,7 @@ export default {
       spanArray: [],
 
       //点查entities事件
-      getEntitiesHandler: {},
+      getEntitiesHandler: null,
       /**
        * tabs 标签
        */
@@ -225,17 +227,21 @@ export default {
   },
   created() {},
   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();
+    if (this.info.BenchmarkLandPrice != null) {
+      this.$nextTick(function () {
+        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();
       });
-    });
-    this.init();
+    }
   },
   methods: {
     async init() {
@@ -348,7 +354,7 @@ export default {
           id: "HZFW",
           polygon: {
             hierarchy: Cesium.Cartesian3.fromDegreesArray(points),
-            material: Cesium.Color.CHARTREUSE.withAlpha(0.1), //Cesium.Color.RED.withAlpha(0.4),
+            material: Cesium.Color.WHITE.withAlpha(0.3), //Cesium.Color.RED.withAlpha(0.4),
             outline: true,
             outlineColor: Cesium.Color.RED,
             outlineWidth: 2.0,
@@ -402,7 +408,6 @@ export default {
       );
     },
     objectSpanMethod({ rowIndex, columnIndex }) {
-      debugger;
       if (columnIndex === 0 || columnIndex === 1) {
         let _row = this.spanArray[rowIndex];
         let _col = _row > 0 ? 1 : 0;
@@ -428,7 +433,6 @@ export default {
     },
     rowClick(row) {
       let that = this;
-      debugger;
       if (that.Interval) {
         clearInterval(that.Interval);
         that.Interval = null;
@@ -534,7 +538,6 @@ export default {
         this.info.BenchmarkLandPrice &&
         this.info.BenchmarkLandPrice.AnalysisResults
       ) {
-        debugger;
         await getJZDJWord(this.info.BenchmarkLandPrice.AnalysisResults);
       }
     },
@@ -553,7 +556,7 @@ export default {
           ];
         viewer.entities.removeById(element.id);
       }
-      this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList = [];
+      // this.info.BenchmarkLandPrice.AnalysisResults.ghdkDetailedDjList = [];
       //删除绘制范围
       viewer.entities.removeById("HZFW");
     },
@@ -725,7 +728,9 @@ export default {
         Cesium.ScreenSpaceEventType.LEFT_CLICK
       );
     }
-    this.clear();
+    if (this.info.BenchmarkLandPrice != null) {
+      this.clear();
+    }
   },
 };
 </script>

+ 51 - 203
src/views/ConstructionApplication3D/Demolition/DemolitionList.vue

@@ -129,7 +129,7 @@
                 </div>
                 <div class="divText">
                   <div>
-                    <span style="color: #fff"> 预计征地面积(亩)</span>
+                    <span style="color: #fff">分析范围(亩)</span>
                   </div>
                   <div>
                     <span color="#2d8cf0">{{ zdResult.totalZDMJ }}</span>
@@ -1423,10 +1423,10 @@ export default {
             new Cesium.Cartesian3.fromDegreesArray(positions)
           ),
           // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
-          material: new Cesium.Color(255 / 255, 211 / 255, 128 / 255, 1),
+          material: Cesium.Color.WHITE.withAlpha(0.3),
           outline: true,
-          outlineColor: Cesium.Color.BLACK,
-          outlineWidth: 1.0,
+          outlineColor: Cesium.Color.RED,
+          outlineWidth: 2.0,
         },
       });
 
@@ -2168,19 +2168,39 @@ export default {
         // window.createTooltip.setVisible(false);
         debugger;
         console.log(result);
-        handlerPolygon.polygon.show = true;
-        handlerPolygon.polyline.show = true;
-        handlerPolygon.polygon.polygon.material.color =
-          Cesium.Color.CHARTREUSE.withAlpha(0.5);
-        that.positions = [];
+        handlerPolygon.polygon.show = false;
+        handlerPolygon.polyline.show = false;
+
+        var nPositions = [];
         for (var pt of result.object.positions) {
           var cartographic = Cesium.Cartographic.fromCartesian(pt);
           var longitude = Cesium.Math.toDegrees(cartographic.longitude);
           var latitude = Cesium.Math.toDegrees(cartographic.latitude);
           var height = cartographic.height;
           that.regions.push({ x: longitude, y: latitude });
+          nPositions.push(longitude)
+          nPositions.push(latitude)
         }
-        that.regions.push(that.regions[0]);
+        viewer.entities.removeById('polygon');
+        polygonEntity = new Cesium.Entity({
+          id: 'polygon',
+          // position: Cesium.Cartesian3.fromDegreesArray([
+          //   centerX,
+          //   centerY,
+          // ]),
+          // classificationType: ClassificationType.TERRAIN,
+          polygon: {
+            hierarchy: new Cesium.PolygonHierarchy(
+              new Cesium.Cartesian3.fromDegreesArray(nPositions)
+            ),
+            // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
+            material: Cesium.Color.WHITE.withAlpha(0.3),
+            outline: true,
+            outlineColor: Cesium.Color.RED,
+            outlineWidth: 2.0,
+          },
+        });
+        viewer.entities.add(polygonEntity)
 
         // that.regions = [];
         // that.regions.push(that.positions);
@@ -2462,196 +2482,9 @@ export default {
           return false;
         }
       });
-      // this.kring();
 
     },
-    kring() {
-
-      //创建阴影查询对象
-      var that = this
-      var shadowQuery = new Cesium.ShadowQueryPoints(scene);
-      var layers = scene.layers._layers
-      // layers[0].selectEnabled = false;
-      // layers[1].selectEnabled = false;
-      // //设置图层的阴影模式
-      // layers[0].shadowType = 2;
-      // layers[1].shadowType = 2;
-
-      var startTime = new Date('2024-07-14');
-      startTime.setHours(10);
-      shadowQuery.startTime = Cesium.JulianDate.fromDate(startTime);
-
-
-      var endTime = new Date('2024-07-14');
-      endTime.setHours(14);
-      shadowQuery.endTime = Cesium.JulianDate.fromDate(endTime);
-
-      shadowQuery.spacing = 10;
-      shadowQuery.timeInterval = 60;
-      var poisnts = [];
-      this.regions.forEach((item) => {
-        poisnts.push(item.x)
-        poisnts.push(item.y)
-      })
-      shadowQuery.qureyRegion({
-        position: poisnts,
-        bottom: 20,
-        extend: 5
-      });
-
-
-      endTime = new Date('2024-07-14');
-      endTime.setHours(14);
-      viewer.clock.currentTime = Cesium.JulianDate.fromDate(endTime);
-      viewer.clock.multiplier = 1;
-      viewer.clock.shouldAnimate = true;
-      shadowQuery.build();
-
-      let params = {
-        maxValue: 100,
-        krigingModel: 'exponential',//model还可选'gaussian','spherical',exponential
-        krigingSigma2: 0,
-        krigingAlpha: 100,
-        canvasAlpha: 0.75,//canvas图层透明度
-        colors: ["rgb(0,0,255)", "rgb(0,217,255)", "rgb(0,255,245)", "rgb(0,255,128)", "rgb(237,255,0)", "rgb(255,214,0)",
-          "rgb(255,85,0)", "rgb(255,85,0)"]
-        //  ["#0000FF", "#7FFF00", "#FFD700", "#FFA500", "#FF4500", "#ffffbf",
-        // "#fee08b", "#fdae61", "#f46d43", "#d73027", "#a50026"],
-      }
-      var temPoinst = [];
-      var values = [];
-      var lons = [];
-      var lats = [];
-      shadowQuery.queryPointsEvent.addEventListener(function (points) {
-        temPoinst = []
-        var values = [];
-        lons = [];
-        lats = [];
-        debugger
-        for (var i = 0; i < points.length; i++) {
-          var pt = points[i]
-
-          var cartographic = Cesium.Cartographic.fromCartesian(pt.position);
-          var shadowRadio = shadowQuery.getShadowRadio(cartographic);
-          var longitude = Cesium.Math.toDegrees(cartographic.longitude);
-          var latitude = Cesium.Math.toDegrees(cartographic.latitude);
-
-          temPoinst.push({ x: longitude, y: latitude, z: shadowRadio })
-          values.push(shadowRadio)
-          lons.push(longitude)
-          lats.push(latitude)
-        }
 
-        debugger
-        // pointArray.push(point([longitude, latitude], { 'shadowRatio': poisnts[i].shadowRatio }))
-        let variogram = kriging.train(
-          values,
-          lons,
-          lats,
-          params.krigingModel,
-          params.krigingSigma2,
-          params.krigingAlpha
-        )
-        debugger
-        let polygons = [[]];
-
-        var xmin = that.regions[0].x;
-        var xmax = that.regions[0].x;
-        var ymin = that.regions[0].y;
-        var ymax = that.regions[0].y;
-        that.regions.forEach((t) => {
-          if (xmin > t.x)
-            xmin = t.x;
-          if (xmax < t.x)
-            xmax = t.x;
-          if (ymin > t.y)
-            ymin = t.y;
-          if (ymax < t.y)
-            ymax = t.y;
-          polygons[0].push([t.x, t.y])
-        })
-        var extent = [xmin, ymin, xmax, ymax]
-        let grid = kriging.grid(polygons, variogram, (xmax - xmin) / 100);
-
-        //根据scope边界线,生成范围信息
-        var xlim = [xmin, xmax];
-        var ylim = [ymin, ymax];
-        // var canvas = document.getElementById("CVS")
-        // kriging.plot(canvas, grid, xlim, ylim, params.colors)
-        // let fc = that.gridFeatureCollection(grid, xlim, ylim);
-        // var collection = featureCollection(fc);
-        // var breaks = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0];
-        // var obands = isobands(collection, breaks, { zProperty: 'value' });
-
-        // // var colors = ["rgb(0,0,255)", "rgb(0,217,255)", "rgb(0,255,245)", "rgb(0,255,128)", "rgb(237,255,0)", "rgb(255,214,0)",
-        // //   "rgb(255,85,0)", "rgb(255,85,0)"];
-        //   var colors = [Cesium.Color.fromCssColorString("rgb(0,0,255)"),
-        //   Cesium.Color.fromCssColorString("rgb(0,217,255)"),
-        //   Cesium.Color.fromCssColorString("rgb(0,255,245)"),
-        //   Cesium.Color.fromCssColorString("rgb(0,255,128)"),
-        //   Cesium.Color.fromCssColorString("rgb(237,255,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,214,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,0,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,0,0)"),
-        //   Cesium.Color.fromCssColorString("rgb(255,0,0)")];
-        // viewer.entities.removeAll()
-        // obands.features.forEach((element, index) => {
-        //   // color = colors[index]
-        //   let sd;
-        //   let color;
-        //   if (index > colors.length)
-        //     color = colors.splice(colors.length - 1, 1);
-        //   else
-        //     color = colors[index]
-        //   if (element.geometry.coordinates.length != 0) {
-        //     sd = element.geometry.coordinates[0][0].flat();
-        //     // color = Cesium.Color.BLUE.withAlpha(0.5)
-        //     // if (element.properties.value == "0-0.2")
-        //     //   color = Cesium.Color.BLUE
-        //     // else if (element.properties.value == "0.2-0.4")
-        //     //   color = Cesium.Color.CYAN.withAlpha(0.5)
-        //     // else if (element.properties.value == "0.4-0.6")
-        //     //   color = Cesium.Color.GREENYELLOW
-        //     // else if (element.properties.value == "0.6-0.8")
-        //     //   color = Cesium.Color.ORANGERED
-        //     // else if (element.properties.value == "0.8-1")
-        //     //   color = Cesium.Color.RED
-        //     var entity = new Cesium.Entity({
-        //       polygon: {
-        //         hierarchy: Cesium.Cartesian3.fromDegreesArray(sd),
-        //         material:color,
-        //         outline: true,
-        //         outlineColor: Cesium.Color.BLACK,
-        //         outlineWidth: 0.5,
-        //         // Cesium.Color.fromCssColorString(color)
-        //       },
-        //     })
-        //     viewer.entities.add(entity);
-        //   }
-        // });
-        // that.holePolygon.deactivate()
-        shadowQuery.clear();
-      })
-
-      // console.log(obands)
-    },
-    gridFeatureCollection(grid, xlim, ylim) {
-      var range = grid.zlim[1] - grid.zlim[0];
-      var i, j, x, y, z;
-      var n = grid.length;//列数
-      var m = grid[0].length;//行数
-      var pointArray = [];
-      for (i = 0; i < n; i++)
-        for (j = 0; j < m; j++) {
-          x = (i) * grid.width + grid.xlim[0];
-          y = (j) * grid.width + grid.ylim[0];
-          z = (grid[i][j] - grid.zlim[0]) / range;
-          if (z < 0.0) z = 0.0;
-          if (z > 1.0) z = 1.0;
-          pointArray.push(point([x, y], { value: z }));
-        }
-      return pointArray;
-    },
     /**
      * 征地计算
      */
@@ -2863,7 +2696,7 @@ export default {
       if (ZDBZ) {
 
         //征地面积
-        that.zdResult.totalZDMJ = parseFloat(totalZDMJ.toFixed(2));
+        that.zdResult.totalZDMJ = 0.00;// parseFloat(totalZDMJ.toFixed(2));
         // //总补偿
         // that.zdResult.totalPay = parseFloat(
         //   ((totalZDMJ * ZDBZ.BCBZ.BCHJ) / 10000).toFixed(2)
@@ -2892,9 +2725,24 @@ export default {
       }
       that.zdResult.features = features;
       that.zdResult.fieldInfos = fieldInfos;
+      that.zdResult.totalZDMJ = parseFloat((that.getRegionArea() / 666.66).toFixed(2));
 
       //<--
     },
+    //范围面积
+    getRegionArea() {
+      debugger
+      var points1 = this.regions;
+      var parts1 = [];
+      var poly1;
+      for (var i = 0; i < points1.length; i++) {
+        parts1.push([points1[i].x, points1[i].y]);
+      }
+      poly1 = polygon([parts1]);
+      var textarea = area(poly1) * window.earthRadius;
+      return textarea;
+
+    },
     getfldIndex(fieldInfos, fldName) {
       var fldIndex = -1;
       fieldInfos.forEach((fld, index) => {
@@ -3171,17 +3019,17 @@ export default {
         parts1.push([points1[i].x, points1[i].y]);
       }
       poly1 = polygon([parts1]);
-      var textarea = area(poly1);
+      var textarea = area(poly1) * window.earthRadius;
       console.log("分析范围:" + textarea);
       for (var i = 0; i < points2.length; i++) {
         parts2.push([points2[i].x, points2[i].y]);
       }
       poly2 = polygon([parts2]);
       var isContain = booleanContains(poly1, poly2);
-      if (isContain) return area(poly2);
+      if (isContain) return area(poly2) * window.earthRadius;
       else {
         var intersection = intersect(poly1, poly2);
-        return area(intersection);
+        return area(intersection) * window.earthRadius;
       }
       return 0;
     },
@@ -3191,12 +3039,12 @@ export default {
     calculateIntersectArea(Points1, Points2) {
       const geometry1 = this.AssemblySurface(Points1);
 
-      var textarea = area(geometry1);
+      var textarea = area(geometry1) * window.earthRadius;
       console.log("分析范围:" + textarea);
       const geometry2 = this.AssemblySurface(Points2);
       let areaPs = intersect(geometry1, geometry2);
       if (areaPs) {
-        const areadifference = area(areaPs);
+        const areadifference = area(areaPs) * window.earthRadius;
         return Number(areadifference.toFixed(2));
       } else {
         return 0;

+ 2 - 2
src/views/ConstructionApplication3D/MXDBinfo/MXDBinfo.vue

@@ -177,7 +177,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 xmzmj += areaPs;
               }
             });
@@ -317,7 +317,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 jzjdzmj += areaPs;
               }
             });

+ 1 - 2
src/views/ConstructionApplication3D/ZBFXAnalysisinfo/ZBFXAnalysisinfo.vue

@@ -103,7 +103,6 @@ export default {
   },
   computed: {},
   mounted() {
-    debugger;
     this.init();
   },
   methods: {
@@ -119,7 +118,6 @@ export default {
             DKBM: Data.KG_Data.DKBM,
           };
           let TableData = [];
-          debugger;
           let YDMJrow = {};
           YDMJrow.zbmc = "用地总面积";
           YDMJrow.fazbyg = Number(Data.FA_Data.YDMJ).toFixed(2);
@@ -173,6 +171,7 @@ export default {
           JRJZMJrow.zbmc = "计容建筑面积";
           JRJZMJrow.tjfazb = Number(Data.TJFA_Data.JRJZMJ).toFixed(2);
           JRJZMJrow.fazbyg = Number(Data.FA_Data.JRJZMJ).toFixed(2);
+          debugger;
           if (Data.KG_Data.JRJZMJX && Data.KG_Data.JRJZMJD) {
             JRJZMJrow.kgyq = Data.KG_Data.JRJZMJX + "/" + Data.KG_Data.JRJZMJD;
           } else {

+ 1 - 1
src/views/ConstructionApplication3D/ZYAnalysisinfo/ZYAnalysisinfo.vue

@@ -147,7 +147,7 @@ export default {
       //交集
       let differenceion = intersect(polygon1, polygon2);
       if (differenceion) {
-        const areadifference = area(differenceion);
+        const areadifference = area(differenceion) * window.earthRadius;
         return areadifference.toFixed(2);
       } else {
         return 0;

+ 1 - 1
src/views/ConstructionApplication3D/backLineAnalysis/backLineAnalysisinfo.vue

@@ -196,7 +196,7 @@ export default {
       //差集
       let differenceion = difference(polygon1, polygon2);
       if (differenceion) {
-        const areadifference = area(differenceion);
+        const areadifference = area(differenceion) * window.earthRadius;
         return areadifference.toFixed(2);
       } else {
         return 0;

+ 50 - 1
src/views/ConstructionApplication3D/billboard/billboardDesign.vue

@@ -98,7 +98,13 @@ import billboarddetail from "@/views/ConstructionApplication3D/billboard/billboa
 import billboardCheck from "@/views/ConstructionApplication3D/billboard/billboardCheckList.vue";
 import addBiillboardModel from "@/views/ConstructionApplication3D/billboard/addBiillboardModel.vue";
 import billboarddetailInfo from "@/views/ConstructionApplication3D/billboard/billboarddetailInfo.vue";
-
+import {
+  cartesian3ToWGS84,
+  mapQuery,
+  flatten,
+  mercator2lonLat,
+  undergroundMode,
+} from "@/utils/MapHelper/MapHelper.js";
 import lodash from "lodash-es";
 let entityList = [];
 export default {
@@ -127,6 +133,7 @@ export default {
         that.thislayers.push(element.name);
       });
     });
+    this.yp();
   },
   methods: {
     handleCurrentChange() {},
@@ -496,8 +503,50 @@ export default {
       viewer.entities.removeAll();
       entityList = [];
     },
+    /**
+     * 压平
+     * @param Minfos 模型信息
+     */
+    async yp() {
+      const Minfo = window.billboardModelLT;
+
+      //获取模型信息
+      let queryBySQLParameters = {
+        getFeatureMode: "SQL",
+        datasetNames: [Minfo.dataSourceName + ":项目范围"],
+        queryParameter: {
+          attributeFilter: "1=1",
+        },
+        hasGeometry: true,
+      };
+      let e = await mapQuery(
+        Minfo.dataurl + "/featureResults.json?returnContent=true",
+        queryBySQLParameters
+      );
+
+      if (e && e.totalCount > 0) {
+        e.features.forEach((element) => {
+          let flatPoints = element.geometry.points
+            .map((item) => [item.x, item.y, 6.5])
+            .flat();
+          viewer.scene.layers.layerQueue.forEach((layer) => {
+            let name = "flatten" + Math.random();
+            let istrue = layer.addFlattenRegion({
+              position: flatPoints,
+              name: name,
+            });
+          });
+        });
+      }
+    },
+    qxyp() {
+      viewer.scene.layers.layerQueue.forEach((layer) => {
+        layer.removeAllFlattenRegion();
+      });
+    },
   },
   beforeDestroy() {
+    this.qxyp();
     this.removeAllentities();
     debugger;
     this.thislayers.forEach((element) => {

+ 7 - 10
src/views/ConstructionApplication3D/projectManagement/projectManagement.vue

@@ -1079,6 +1079,7 @@ export default {
     //添加多个模型
     async addModels(Minfos, completed) {
       await this.yp(Minfos);
+      debugger;
       let models = [];
       Minfos.forEach((element) => {
         var modelLayer = scene.open(element.url);
@@ -1098,6 +1099,7 @@ export default {
 
       Cesium.when
         .all(modifiedPromises, async function (modelLayers) {
+          debugger;
           for (let index = 0; index < modelLayers.length; index++) {
             let modelData = {
               id: uuidv4(),
@@ -1233,6 +1235,7 @@ export default {
           }
         })
         .otherwise(function (error) {
+          debugger;
           that.loading = false;
           that.$message({
             message: "加载失败,请联系管理员",
@@ -2193,6 +2196,7 @@ export default {
      * @param Minfo
      */
     async getnorm(Minfo) {
+      debugger;
       //组装指标对象
       let tableDataList = [];
       for (let index = 0; index < this.LandPlanningList.length; index++) {
@@ -2265,7 +2269,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 xmzmj += areaPs;
               }
             });
@@ -2346,7 +2350,7 @@ export default {
                   DataPs.push(DataPs[0]);
                 }
                 let polygonPs = polygon([DataPs]);
-                let areaPs = area(polygonPs);
+                let areaPs = area(polygonPs) * window.earthRadius;
                 jzjdzmj += areaPs;
               }
             });
@@ -2372,7 +2376,6 @@ export default {
           var land = result.buildings.find(
             (t) => t.landNo == item.KG_Data.DKBM
           );
-          debugger;
           if (land == null) continue;
           tableDataList[i].FA_Data.JZMJ = land.mj;
           tableDataList[i].FA_Data.JRJZMJ = land.jrmj;
@@ -2381,7 +2384,7 @@ export default {
           ).toFixed(2);
 
           //开发商提交的方案文档指标
-
+          debugger;
           tableDataList[i].TJFA_Data.JZMJ = land.famj;
           tableDataList[i].TJFA_Data.JRJZMJ = land.fajrmj;
           tableDataList[i].infoData = land;
@@ -2506,7 +2509,6 @@ export default {
        */
       var totalJRArea = 0.0;
       var jrFldIndex = -1;
-      debugger;
       var datasetInfos = result.datasetInfos;
       if (datasetInfos == null || datasetInfos.length == 0) {
         that.$message("未查询到停车位和报建分层数据数据,请重新尝试");
@@ -2519,13 +2521,11 @@ export default {
       for (var i = 0; i < datasetInfos.length; i++) {
         start = datasetInfos[i].featureRange.start;
         end = datasetInfos[i].featureRange.end;
-        debugger;
         curFreatures = result.features.filter((item, index) => {
           return index >= start && index <= end;
         });
         if (datasetInfos[i].datasetName.indexOf(tcwLayerName) > -1) {
           layerName = tcwLayerName;
-          debugger;
           JSResult.parks = that.statisticscCarpark(
             datasetInfos[i].fieldInfos,
             curFreatures
@@ -3493,7 +3493,6 @@ export default {
      */
     openMXDBInfo() {
       let that = this;
-      debugger;
       let modelsloadData = that.modelsload.map((item) => {
         return {
           id: item.id,
@@ -3527,7 +3526,6 @@ export default {
         shade: false, //是否显示遮罩
         shadeClose: false, //点击遮罩是否关闭
         cancel: () => {
-          debugger;
           //还原弹窗
           this.$layer.full(that.layerid);
           //关闭事件
@@ -3612,7 +3610,6 @@ export default {
           queryBySQLParameters
         );
 
-        debugger;
         if (e && e.totalCount > 0) {
           e.features.forEach((element) => {
             let flatPoints = element.geometry.points

Some files were not shown because too many files changed in this diff