소스 검색

Merge branch 'master' into maxx

maxiaoxiao 11 달 전
부모
커밋
73f470887b

+ 10 - 1
src/api/ghss/ghxz.js

@@ -31,4 +31,13 @@ export function AddFzxz(data) {
         method: 'post',
         data:data
     })
-}
+}
+
+// 选址结果信息
+export function GetXzjg(params) {
+    return request({
+        url: '/analyse/fzss/GetXzjg',
+        method: 'get',
+        params
+    })
+}

+ 1 - 1
src/views/cockpit/hysy.vue

@@ -362,7 +362,7 @@ export default {
         font-weight: bold;
         position: relative;
         top: 0.3rem;
-        left: 18rem;
+        left: -18rem;
     }
 }
 

+ 9 - 0
src/views/complianceAnalysis/components/lsjl.vue

@@ -83,6 +83,9 @@ export default {
     type: {
       type: String,
     },
+    recordBsm: {
+      type: String,
+    },
   },
   data() {
     return {
@@ -98,6 +101,7 @@ export default {
       ], // '00:00:00', '23:59:59'
       datalist: [],
       now: "",
+      // recordBsm: "", //辅助选址成功后的标识码
     };
   },
   mounted() {
@@ -107,6 +111,11 @@ export default {
     } else {
       this.datalist = hgxfx.datalist;
     }
+    // this.bus.$on("recordBsm", (val) => {
+    //   console.log(val, "recordBsm");
+    //   this.recordBsm = val
+    // });
+
   },
   methods: {
     report(item) {

+ 53 - 34
src/views/siteselection/components/fzxz.vue

@@ -113,7 +113,7 @@
 <script>
 import yxyzPop from "./yxyzPop.vue"; ///mapview/range
 import range from "@/components/mapview/range.vue"; ///mapview/range
-import { GetDldmTree, GetSjyList ,AddFzxz} from "../../../api/ghss/ghxz.js";
+import { GetDldmTree, GetSjyList, AddFzxz } from "../../../api/ghss/ghxz.js";
 import hgxfx from "../../../../static/data/ghss/data.js";
 export default {
   components: {
@@ -459,40 +459,59 @@ export default {
       this.ruleForm.xzmj = _temp.xzmj || hgxfx.xzmj;
       this.$refs.ruleForm.validate((valid) => {
         if (valid) {
-          // let obj = {
-          //   xzmj: this.ruleForm.xzmj,
-          //   xmmc: this.ruleForm.xmmc,
-          //   xmlx: this.ruleForm.xmlx,
-          //   jsdw: this.ruleForm.jsdw,
-          //   ydxz_bsm: this.ydlxBSM, //用地性质标识码
-          //   // ydlx: this.ruleForm.ydlx,
-          //   ydmjbegin: this.ruleForm.ydmjbegin, //用地面积开始
-          //   ydmjend: this.ruleForm.ydmjend, //用地面积结束
-          //   sjy: this.sjyBSM, //数据源标识码
-          //   geomId: this.$refs.range.fileDataID,
-          //   yxyz: this.tableData,
-          // };
-          // console.log(obj, "objobj");
-          // AddFzxz(obj).then((res) => {
-          //   console.log(res, "哈哈哈哈哈");
-          // });
-
-          const loading = this.$loading({
-            lock: true,
-            text: "分析中",
-            spinner: "el-icon-loading",
-            background: "rgba(0, 0, 0, 0.7)",
+          let obj = {
+            xzmj: Number(this.ruleForm.xzmj),
+            xmmc: this.ruleForm.xmmc,
+            xmlx: this.ruleForm.xmlx,
+            jsdw: this.ruleForm.jsdw,
+            ydxz_bsm: this.ydlxBSM, //用地性质标识码
+            // ydlx: this.ruleForm.ydlx,
+            ydmjbegin: Number(this.ruleForm.ydmjbegin), //用地面积开始
+            ydmjend: Number(this.ruleForm.ydmjend), //用地面积结束
+            sjy: this.sjyBSM, //数据源标识码
+            geomId: this.$refs.range.fileDataID,
+            yxyz: this.tableData,
+          };
+          console.log(obj, "objobj");
+          AddFzxz(obj).then((res) => {
+            console.log(res, "哈哈哈哈哈");
+            if (res.success) {
+              // this.bus.$emit("recordBsm", res.data.rwbsm);
+              const loading = this.$loading({
+                lock: true,
+                text: "分析中",
+                spinner: "el-icon-loading",
+                background: "rgba(0, 0, 0, 0.7)",
+              });
+              setTimeout(() => {
+                loading.close();
+                this.activeTabs = "lsju";
+                this.$emit("updateParent", "activeTabs", "lsju");
+                this.$message({
+                  message: "分析成功!",
+                  type: "success",
+                });
+                this.reset();
+              }, 2000);
+            }
           });
-          setTimeout(() => {
-            loading.close();
-            this.activeTabs = "lsju";
-            this.$emit("updateParent", "activeTabs", "lsju");
-            this.$message({
-              message: "分析成功!",
-              type: "success",
-            });
-            this.reset();
-          }, 2000);
+
+          // const loading = this.$loading({
+          //   lock: true,
+          //   text: "分析中",
+          //   spinner: "el-icon-loading",
+          //   background: "rgba(0, 0, 0, 0.7)",
+          // });
+          // setTimeout(() => {
+          //   loading.close();
+          //   this.activeTabs = "lsju";
+          //   this.$emit("updateParent", "activeTabs", "lsju");
+          //   this.$message({
+          //     message: "分析成功!",
+          //     type: "success",
+          //   });
+          //   this.reset();
+          // }, 2000);
         } else {
           console.log("error submit!!");
           return false;

+ 105 - 64
src/views/siteselection/components/xzjg.vue

@@ -3,10 +3,10 @@
     <div>项目名称:选址结果</div>
     <div class="box-sizing" style="height: 47%; width: 100%">
       <div class="title block-title">
-        意向地块({{ bgList ? bgList.length : 0 }})
+        意向地块 ({{ bgList ? bgList.length : 0 }})
         <span @click="download" class="export">导出报告</span>
       </div>
-      <div class="bxCon" style="height: 90%;">
+      <div class="bxCon" style="height: 90%">
         <el-collapse accordion v-model="activeNames">
           <el-collapse-item
             :name="'gb' + index1"
@@ -14,9 +14,7 @@
             :key="index1"
           >
             <template slot="title">
-              地块编号{{ item1.properties.dkbm }} ({{
-                item1.properties.ydmj.toFixed(0)
-              }})
+              地块编号{{ item1.dkbm }} ({{ item1.area.toFixed(0) }})
               <span class="tools">
                 <i
                   class="header-icon el-icon-place"
@@ -30,14 +28,14 @@
             </template>
             <div class="collapseCon">
               <p class="oneItem">
-                <span>{{ item1.properties.kzxxgydmc }}</span>
-                <span>{{ item1.properties.ydmj.toFixed(2) }}平方米</span>
+                <span>{{ item1.kzxxgydmc }}</span>
+                <span>{{ item1.area.toFixed(2) }}平方米</span>
               </p>
               <p style="color: #cddeeb">
                 <img src="/static/images/ghzc/iconSun.png" />
                 <span style="margin-left: 20px">基准地标价:</span
                 ><span style="color: #02a7f0"
-                  >{{ item1.properties.landPrice }}万元</span
+                  >{{ item1.landPrice || 0 }}万元</span
                 >
               </p>
             </div>
@@ -45,26 +43,22 @@
         </el-collapse>
       </div>
     </div>
-    <div style="height: 47%; width: 100%">
+    <div style="height: 47%; width: 100%" v-if="xzjgObj">
       <div class="title flex-box">
         <span class="block-title"
-          >备选地块({{
-            xzjgObj.features ? xzjgObj.features.length : 0
-          }})</span
-        >
+          >备选地块 ({{ xzjgObj.dks ? xzjgObj.dks.length : 0 }})
+        </span>
       </div>
       <div class="bxCon">
         <el-collapse accordion v-model="activeNames">
           <el-collapse-item
             :name="index"
-            v-for="(item, index) in xzjgObj.features"
-            :key="item.properties.dkbm"
+            v-for="(item, index) in xzjgObj.dks"
+            :key="item.dkbm"
           >
             <template slot="title">
               <!-- 地块编号B_P_123 -->
-              地块编号{{ item.properties.dkbm }} ({{
-                item.properties.ydmj.toFixed(0)
-              }})
+              地块编号{{ item.dkbm }} ({{ item.area.toFixed(0) }})
               <span class="tools">
                 <i
                   class="header-icon el-icon-place"
@@ -78,15 +72,15 @@
             </template>
             <div class="collapseCon">
               <p class="oneItem">
-                <span>{{ item.properties.kzxxgydmc }}</span>
-                <span>{{ item.properties.ydmj.toFixed(2) }}平方米</span>
+                <span>{{ item.kzxxgydmc }}</span>
+                <span>{{ item.area.toFixed(2) }}平方米</span>
               </p>
               <p style="color: #cddeeb">
                 <!-- <i class="iconSun"></i> -->
                 <img src="/static/images/ghzc/iconSun.png" />
                 <span style="margin-left: 20px">基准地标价:</span
                 ><span style="color: #02a7f0"
-                  >{{ item.properties.landPrice }}万元</span
+                  >{{ item.landPrice || 0 }}万元</span
                 >
               </p>
             </div>
@@ -118,6 +112,9 @@
 <script>
 import drawData from "./draw.json";
 import ghjgData from "./规划结果.json";
+import { GetXzjg } from "../../../api/ghss/ghxz.js";
+// 使用
+import parse from "wellknown";
 export default {
   components: {},
   props: {
@@ -153,16 +150,27 @@ export default {
       },
       geoJsonEntities: null,
       xzjgObj: null,
-      tempObj: JSON.parse(JSON.stringify(ghjgData)),
+      tempObj: null,
       copyData: null,
       arrww: [],
     };
   },
   mounted() {
-    this.xzjgObj = JSON.parse(JSON.stringify(ghjgData))
-    this.copyData = JSON.parse(JSON.stringify(ghjgData));
-    this.addPolygon("规划结果", "ghjg", "#0000FF");
-    this.addPolygon("draw", "draw", "#FF0000");
+    GetXzjg({ bsm: "dbc5fcf178fc4592b4940627e758b90d" }).then((res) => {
+      console.log(res, "-------");
+      this.xzjgObj = JSON.parse(JSON.stringify(res.data));
+      this.copyData = JSON.parse(JSON.stringify(res.data));
+      this.tempObj = JSON.parse(JSON.stringify(res.data));
+      this.xzjgObj.dks.forEach((item) => {
+        this.drawWktPloygon(item.geom, "#0000ff");
+      });
+      this.drawWktPloygon(this.geom, "#ff0000");
+    });
+
+    // this.xzjgObj = JSON.parse(JSON.stringify(ghjgData));
+    // this.copyData = JSON.parse(JSON.stringify(ghjgData));
+    // this.addPolygon("规划结果", "ghjg", "#0000FF");
+    // this.addPolygon("draw", "draw", "#FF0000");
   },
   methods: {
     download() {
@@ -174,6 +182,41 @@ export default {
         "_blank"
       );
     },
+
+    drawWktPloygon(item, itemColor) {
+      // const geometry = parse(item); // 就可以得到{type: 'MultiPolygon', coordinates: Array(1)}
+      // console.log(geometry, "geometry");
+      // viewer.entities.removeAll();
+      let geoms =
+        item
+          .substring(item.indexOf("(((") + 3, item.length - 3)
+          .split(")),((") ||
+        item.substring(item.indexOf("((") + 2, item.length - 2).split(")),((");
+      for (let i = 0; i < geoms.length; i++) {
+        let geom = geoms[i].split(",");
+        let points = [];
+        for (let j = 0; j < geom.length; j++) {
+          points.push(parseFloat(geom[j].split(" ")[0]));
+          points.push(parseFloat(geom[j].split(" ")[1]));
+        }
+        points.push(parseFloat(geom[0].split(" ")[0]));
+        points.push(parseFloat(geom[0].split(" ")[1]));
+        viewer.entities.add({
+          polygon: {
+            hierarchy: {
+              positions: Cesium.Cartesian3.fromDegreesArray(points),
+            },
+            material: Cesium.Color.WHITE.withAlpha(0.3),
+            clampToGround: true,
+            outline: true,
+            outlineWidth: 5,
+            outlineColor: Cesium.Color.fromCssColorString(itemColor),
+          },
+        });
+      }
+      viewer.flyTo(viewer.entities);
+    },
+
     // 加载GeoJSON数据
     addPolygon(label, id, color) {
       let _this = this;
@@ -203,26 +246,26 @@ export default {
       });
       if (list.length == 0) {
         this.bgList.push(item);
-        const list = this.xzjgObj.features.filter((item1) => {
-          return item1.properties.dkbm != item.properties.dkbm;
+        const list = this.xzjgObj.dks.filter((item1) => {
+          return item1.dkbm != item.dkbm;
         });
-        this.xzjgObj.features = list;
+        this.xzjgObj.dks = list;
       }
     },
 
     deleteprogramme(e, item) {
       e.stopPropagation();
       this.bgList = this.bgList.filter((item1) => {
-        return item1.properties.dkbm != item.properties.dkbm;
+        return item1.dkbm != item.dkbm;
       });
       const temp = JSON.parse(
         JSON.stringify(
-          this.tempObj.features.filter((item1) => {
-            return item1.properties.dkbm == item.properties.dkbm;
+          this.tempObj.dks.filter((item1) => {
+            return item1.dkbm == item.dkbm;
           })
         )
       );
-      this.xzjgObj.features.push(temp[0]);
+      this.xzjgObj.dks.push(temp[0]);
     },
     resetAll() {
       // this.xzjgObj = JSON.parse(JSON.stringify(this.tempObj))
@@ -232,33 +275,33 @@ export default {
       this.bgList = [];
     },
     mapview(item) {
-      this.edlARR();
-      // e.stopPropagation()
-      let tempArr = item.geometry.coordinates[0];
-      for (let i = 0; i < tempArr.length; i++) {
-        const oneDArray = tempArr[i].reduce(
-          (accumulator, currentValue) => accumulator.concat(currentValue),
-          []
-        );
-        let entity = new Cesium.Entity({
-          name: "地块" + i,
-          show: true,
-          polygon: {
-            hierarchy: {
-              positions: Cesium.Cartesian3.fromDegreesArray(oneDArray),
-            },
-            material: Cesium.Color.WHITE.withAlpha(0.3),
-            clampToGround: true,
-            outline: true,
-            outlineWidth: 6,
-            outlineColor: Cesium.Color.fromCssColorString("#FF0000"),
-          },
-        });
-        viewer.entities.add(entity);
-        // 存ID
-        this.arrww.push(entity.id);
-        viewer.flyTo(entity);
-      }
+      // this.edlARR();
+      // // e.stopPropagation()
+      // let tempArr = item.geometry.coordinates[0];
+      // for (let i = 0; i < tempArr.length; i++) {
+      //   const oneDArray = tempArr[i].reduce(
+      //     (accumulator, currentValue) => accumulator.concat(currentValue),
+      //     []
+      //   );
+      //   let entity = new Cesium.Entity({
+      //     name: "地块" + i,
+      //     show: true,
+      //     polygon: {
+      //       hierarchy: {
+      //         positions: Cesium.Cartesian3.fromDegreesArray(oneDArray),
+      //       },
+      //       material: Cesium.Color.WHITE.withAlpha(0.3),
+      //       clampToGround: true,
+      //       outline: true,
+      //       outlineWidth: 6,
+      //       outlineColor: Cesium.Color.fromCssColorString("#FF0000"),
+      //     },
+      //   });
+      //   viewer.entities.add(entity);
+      //   // 存ID
+      //   this.arrww.push(entity.id);
+      //   viewer.flyTo(entity);
+      // }
     },
 
     edlARR() {
@@ -287,10 +330,7 @@ export default {
     initData() {
       this.model = this.rwObj;
       this.bgList = this.tempObj.items.filter(
-        (item) =>
-          !this.xzjgObj.features.some(
-            (ele) => ele.properties.dkbm === item.properties.dkbm
-          )
+        (item) => !this.xzjgObj.dks.some((ele) => ele.dkbm === item.dkbm)
       );
       this.bgList.sort(function (a, b) {
         return parseInt(a.yxfa) - parseInt(b.yxfa);
@@ -307,6 +347,7 @@ export default {
   },
 
   beforeDestroy() {
+    viewer.entities.removeAll();
     viewer.dataSources.removeAll();
     this.edlARR();
   },