Parcourir la source

Merge branch 'master' of http://114.244.114.158:8802/siwei/real3d-portalsite

gushoubang il y a 9 mois
Parent
commit
138561933d

+ 7 - 1
src/components/Combinations/toolBar/toolBar.vue

@@ -242,7 +242,13 @@ export default {
     },
     getXzqTreeData() {
       GetXzqhTree().then((res) => {
-        this.xzqTreeData = res.data;
+        if (res.data.length > 0) {
+          const list = res.data[0].children.filter((item) => {
+            return item.label == "三亚市";
+          });
+          if (list.length > 0) this.xzqTreeData = list[0];
+          else this.xzqTreeData = res.data;
+        }
       });
     },
     toggleVisibility() {

+ 1 - 1
src/components/Query/clickQuery/MultiLevelQuery.vue

@@ -484,7 +484,7 @@ export default {
             return secondArray;
         },
         handleClick(tab, event) {
-            let index = Number(tab.index) - 1
+            let index = Number(tab.index) - 2
 
             if (tab.name == '权属') {
                 this.qwnershipTabsFun();

+ 104 - 60
src/components/Query/clickQuery/clickQuery.vue

@@ -1,14 +1,28 @@
 <template>
-  <div class="sm-panel sm-function-module-query" v-show="PoinyQueryShow && vectorShow" v-drag>
+  <div
+    class="sm-panel sm-function-module-query"
+    v-show="PoinyQueryShow && vectorShow"
+    v-drag
+  >
     <div class="sm-panel-header">
       <span>{{ Resource.PoinyQuery }}</span>
       <span class="closeBtn" @click="toggleVisibility">&times;</span>
     </div>
     <!-- <div class="sm-function-module-content-btn"> -->
     <div class="btnList">
-      <span v-for="(item, index) in actionOptions" :key="index" class="icon-span" :title="item.lable"
-        :class="item.isSelect ? 'selected-icon' : ''" @click="changleQueryItem(item)">
-        <i class="iconfont iconSize" :class="item.iconName" style="margin-top: 0px"></i>
+      <span
+        v-for="(item, index) in actionOptions"
+        :key="index"
+        class="icon-span"
+        :title="item.lable"
+        :class="item.isSelect ? 'selected-icon' : ''"
+        @click="changleQueryItem(item)"
+      >
+        <i
+          class="iconfont iconSize"
+          :class="item.iconName"
+          style="margin-top: 0px"
+        ></i>
       </span>
       <!-- <el-button type="primary" size="small" @click.stop="mapLayerQuery"
         >点击</el-button
@@ -19,27 +33,51 @@
     </div>
     <div class="sm-function-module-content-tabs">
       <el-tabs @tab-click="handleTabClick" v-model="activeLayerId">
-        <el-tab-pane :label="item.label" :name="item.id" v-for="(item, index) in layerList" :key="index"></el-tab-pane>
+        <el-tab-pane
+          :label="item.label"
+          :name="item.id"
+          v-for="(item, index) in layerList"
+          :key="index"
+        ></el-tab-pane>
       </el-tabs>
     </div>
     <div class="sm-function-module-content-table">
-      <el-collapse :value="activeNames" @change="handleCollapseChange" v-if="activeLayerId &&
-        queryResults[activeLayerId] &&
-        queryResults[activeLayerId].length > 0
-        ">
-        <el-collapse-item :title="'查询结果' + (index + 1)" :name="'查询结果' + (index + 1)"
-          v-for="(item, index) in queryResults[activeLayerId]" :key="index">
+      <el-collapse
+        :value="activeNames"
+        @change="handleCollapseChange"
+        v-if="
+          activeLayerId &&
+          queryResults[activeLayerId] &&
+          queryResults[activeLayerId].length > 0
+        "
+      >
+        <el-collapse-item
+          :title="'查询结果' + (index + 1)"
+          :name="'查询结果' + (index + 1)"
+          v-for="(item, index) in queryResults[activeLayerId]"
+          :key="index"
+        >
           <template slot="title">
             查询结果{{ index + 1
-            }}<i title="定位" class="header-icon el-icon-s-promotion flyBtn2" @click.stop="flyTo(index)"></i>
+            }}<i
+              title="定位"
+              class="header-icon el-icon-s-promotion flyBtn2"
+              @click.stop="flyTo(index)"
+            ></i>
           </template>
-          <el-table :data="item" :show-header="false" border style="width: 100%" :header-cell-style="{
-            background: 'rgba(10, 25, 38, 0.6)',
-            color: '#66b1ff',
-            fontSize: '14px',
-            fontFamily: 'Microsoft YaHei',
-            fontWeight: '400',
-          }">
+          <el-table
+            :data="item"
+            :show-header="false"
+            border
+            style="width: 100%"
+            :header-cell-style="{
+              background: 'rgba(10, 25, 38, 0.6)',
+              color: '#66b1ff',
+              fontSize: '14px',
+              fontFamily: 'Microsoft YaHei',
+              fontWeight: '400',
+            }"
+          >
             <el-table-column prop="name" label="字段" width="100">
             </el-table-column>
             <el-table-column prop="value" label="值" width="208">
@@ -117,7 +155,8 @@ export default {
           lable: "矢量",
           iconName: "el-icon-picture",
           isSelect: false,
-        }, {
+        },
+        {
           index: 5,
           lable: "联级查询",
           iconName: "el-icon-c-scale-to-original",
@@ -137,10 +176,13 @@ export default {
       return store.state.toolBar[9];
     },
     vectorShow: function () {
-      return store.state.cockpit_vector.title || store.state.cockpit_vector.goitem ? !store.state.viewer_flag : true
+      return store.state.cockpit_vector.title ||
+        store.state.cockpit_vector.goitem
+        ? !store.state.viewer_flag
+        : true;
     },
   },
-  created() { },
+  created() {},
   watch: {
     activeLayerId(val) {
       if (val && val != "0") {
@@ -169,14 +211,12 @@ export default {
     },
   },
   mounted() {
-
     this.$nextTick((res) => {
       query_click = new Cesium.CustomDataSource("query_click");
       viewer.dataSources.add(query_click);
 
       manager_layer_png = new Cesium.CustomDataSource("manager_layer_png");
       viewer.dataSources.add(manager_layer_png);
-
     });
   },
   methods: {
@@ -199,7 +239,7 @@ export default {
     toggleVisibility() {
       this.removeMapLayerQuery();
       store.setToolBarAction(9);
-      tdsy.remove(false)
+      tdsy.remove(false);
       store.state.vectorData = [];
     },
     addGeometrys(fill) {
@@ -298,7 +338,6 @@ export default {
     },
     handleTabClick(item, a) {
       this.activeLayerId = item.name;
-      console.log('this.: ', this.activeLayerId);
     },
     // 设置数据
     setData() {
@@ -332,7 +371,10 @@ export default {
         let Pid = "";
         var tempArr = [];
         // "ResultNetWork@管线#1"///"ResultNetWork_Node@管线#1"
-        if (eneityName.indexOf("雨水") > -1 || eneityName.indexOf("管线") > -1) {
+        if (
+          eneityName.indexOf("雨水") > -1 ||
+          eneityName.indexOf("管线") > -1
+        ) {
           let buildingLayer = scene.layers.find(eneityName);
           buildingLayer.indexedDBSetting.isAttributesSave = true; //保存属性
           if (buildingLayer.getSelection().length > 0) {
@@ -450,7 +492,6 @@ export default {
 
           // positions = oneDArray;
 
-
           // if (this.isArray2D(oneDArray)) {
           //   const oneDArray2 = oneDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
           //   positions = oneDArray2;
@@ -486,7 +527,6 @@ export default {
           //   }
           // });
 
-
           if (e && e.totalCount > 0) {
             that.layerList.push(store.state.vectorlayerlist[i]);
             let queryData = [];
@@ -545,18 +585,21 @@ export default {
               //   var linSAr = JSON.parse(JSON.stringify(e.features[u]));
               // }
               var linSAr = JSON.parse(JSON.stringify(e.features[u]));
-              let parseJson = legendJson.legend != "" ? JSON.parse(legendJson.legend) : [];
+              let parseJson =
+                legendJson.legend != "" ? JSON.parse(legendJson.legend) : [];
               function condition(ci) {
                 return ci.status != undefined && ci.status;
               }
               if (e.features[u].fieldNames) {
                 linSAr.fieldNames.forEach((fieldName, i) => {
-                  let perjson = parseJson.filter(p => p.fieldname.toUpperCase() == fieldName);
+                  let perjson = parseJson.filter(
+                    (p) => p.fieldname.toUpperCase() == fieldName
+                  );
                   if (perjson.length > 0) {
                     var show = condition(perjson[0]);
                     var order = perjson[0].order || linSAr.fieldNames.length;
                     if (fieldName != perjson[0].fieldaliasname)
-                      fieldName = perjson[0].fieldaliasname
+                      fieldName = perjson[0].fieldaliasname;
                   }
                   if (show) {
                     let v = linSAr.fieldValues[i];
@@ -590,7 +633,7 @@ export default {
                 });
               }
 
-              //排序  
+              //排序
               cur.sort((a, b) => a.order - b.order);
               // cur.sort((a, b) => {
               //   if (a === b) {
@@ -604,13 +647,20 @@ export default {
               //     return a.value < b.value ? 1 : -1;
               //   }
               // });
-
+              let urlNew = obj.url + ".json";
+              let resNew = await axios.get(urlNew);
+              let serCode = resNew.data.prjCoordSys.epsgCode;
               let points = [];
               for (let y = 0; y < e.features[u].geometry.points.length; y++) {
-                let c = that.cartesianToCartographic84(
-                  e.features[u].geometry.points[y].x,
-                  e.features[u].geometry.points[y].y
-                );
+                let c  = {}
+                if (serCode == 3857) {
+                  c = that.cartesianToCartographic84(
+                    e.features[u].geometry.points[y].x,
+                    e.features[u].geometry.points[y].y
+                  );
+                } else {
+                   c = e.features[u].geometry.points[y];
+                }
                 points.push([c.x, c.y]);
               }
               parts.push(e.features[u].geometry.parts);
@@ -645,10 +695,9 @@ export default {
           width: 36,
           scale: 1.0,
           zIndex: 2,
-          show: true
+          show: true,
         },
-
-      })
+      });
     },
     addLayerList(label) {
       if (this.layerList.findIndex((a) => a.label == label) >= 0) return;
@@ -747,7 +796,7 @@ export default {
       }
     },
     convertCoordinates(coordArray) {
-      return coordArray.map(coord => [coord.x, coord.y]);
+      return coordArray.map((coord) => [coord.x, coord.y]);
     },
     // 取消左键点击查询
     removeMapLayerQuery() {
@@ -809,13 +858,10 @@ export default {
     remove_query_click() {
       for (var i = 0; i < 10; i++) {
         query_click.entities.values.forEach((res) => {
-
           query_click.entities.remove(res);
-
-        })
+        });
       }
 
-
       // 图标
       var entities = manager_layer_png.entities.values;
       for (var i = entities.length - 1; i >= 0; i--) {
@@ -838,17 +884,20 @@ export default {
         case 3: {
           this.removeMapLayerQuery(); //清除
           clearTranslate();
-          pick_cockpit_vector.clear_data();//矢量拾取清除
-          this.$refs.MultiLevelQuery.clear_data();//多级查询
+          pick_cockpit_vector.clear_data(); //矢量拾取清除
+          this.$refs.MultiLevelQuery.clear_data(); //多级查询
 
           this.remove_query_click();
 
           break;
         }
-        case 4: {//驾驶舱矢量数据点选查询
+        case 4: {
+          //驾驶舱矢量数据点选查询
           pick_cockpit_vector.init_handler();
           break;
-        } case 5: {//联级查询
+        }
+        case 5: {
+          //联级查询
           this.$refs.MultiLevelQuery.init_handler();
           break;
         }
@@ -932,7 +981,6 @@ export default {
 <style lang="scss" scoped>
 @import "clickQuery";
 
-
 /deep/ .el-table tr {
   background: rgba(10, 25, 38, 0.5) !important;
 }
@@ -941,10 +989,9 @@ export default {
 .el-table th.el-table__cell.is-leaf {
   background: rgba(10, 25, 38, 0.5) !important;
 
-  border-bottom: 1px solid #EBEEF5;
+  border-bottom: 1px solid #ebeef5;
 }
 
-
 .el-table {
   color: #fff;
   background: rgba(10, 25, 38, 0.5) !important;
@@ -952,14 +999,11 @@ export default {
 
 /deep/ .el-table__fixed-right::before,
 .el-table__fixed::before {
-
   background: rgba(10, 25, 38, 0.9) !important;
-
 }
 
 /deep/ .el-table__fixed-right-patch {
   background: rgba(10, 25, 38, 0.9) !important;
-
 }
 
 /deep/ .el-table--border::after,
@@ -974,12 +1018,12 @@ export default {
 }
 
 /deep/ .el-collapse {
-  border: none
-    /* border-top: 1px solid #EBEEF5; */
-    /* border-bottom: 1px solid #EBEEF5; */
+  border: none;
+  /* border-top: 1px solid #EBEEF5; */
+  /* border-bottom: 1px solid #EBEEF5; */
 }
 
 /deep/ .el-collapse-item__content {
-  padding-bottom: 0px
+  padding-bottom: 0px;
 }
 </style>

+ 7 - 2
src/views/cockpit/gdbh.vue

@@ -350,13 +350,18 @@ export default {
 
       this.init_gdxz_echart();
     },
+    formatDate(dateStr) {
+      return dateStr.substring(0, 4) + '-' + dateStr.substring(4, 6) + '-' + dateStr.substring(6, 8);
+    },
     async init_zbph_hz(params) {
       const that = this;
+      let bTime = params ? params.beginTime : store.state.cockpit_date[0];
+      let eTime = params ? params.endTime : store.state.cockpit_date[1];
       let obj = {
         jscType: 'jsc_gdbh_zbph_hz',
         id: params ? params.id : '4602',
-        beginTime: params ? params.beginTime : store.state.cockpit_date[0],
-        endTime: params ? params.endTime : store.state.cockpit_date[1],
+        beginTime: this.formatDate(bTime),
+        endTime: this.formatDate(eTime)
       };
       let data = await QueryOne(obj);
       this.balanceData = data.data

+ 2 - 1
src/views/siteselection/components/dkDetailsNew.vue

@@ -54,9 +54,10 @@
       <el-form :model="ruleForm" ref="ruleForm" label-width="100px">
         <el-form-item label="地块编码">
           <div>{{ optional.dkbm }}</div>
+          <!-- :min="0" :precision="2" -->
         </el-form-item>
         <el-form-item label="拉膜高度:" prop="height">
-          <el-input class="inputwidth" v-model="ruleForm.height" size="mini" type="number"
+          <el-input class="inputwidth" v-model.number="ruleForm.height" size="mini" type="number"
             placeholder="请输入地块拉白膜高度"></el-input>
         </el-form-item>

+ 44 - 22
src/views/siteselection/components/xzjg.vue

@@ -82,7 +82,7 @@
                 ></i>
                 <i
                   class="header-icon el-icon-download"
-                  title="下载报告"
+                  title="下载矢量"
                   @click="downloadFile($event, item)"
                 ></i>
                 <i
@@ -149,6 +149,7 @@ import { WriteWkt, DownFile } from "@/api/cockpitNew";
 
 // 使用
 import parse from "wellknown";
+import * as turf from "@turf/turf";
 let dataSources = {};
 export default {
   components: { dkDetails },
@@ -332,9 +333,9 @@ export default {
         .then((data) => {
           viewer.dataSources.add(data);
           let entities = data.entities.values;
-          let addlabel = false;
+          // let addlabel = false;
           if (!geojson.type.includes("Polygon") || height) {
-            entities.forEach((entity) => {
+            entities.forEach((entity, ei) => {
               if (entity.billboard) {
                 entity.billboard = undefined;
                 entity.point = {
@@ -347,23 +348,25 @@ export default {
                 entity.polygon.material = Cesium.Color.WHITE;
                 entity.polygon.outlineColor = Cesium.Color.BLACK;
                 entity.polygon.outlineWidth = 1.0;
-                if (!addlabel) {
-                  var polycenter = Cesium.Cartesian3.fromDegrees(
-                    geojson.coordinates[0][0][0],
-                    geojson.coordinates[0][0][1],
-                    100
-                  );
-                  entity.position = polycenter;
-                  entity.label = {
-                    font: "bolder 18px sans-serif",
-                    style: Cesium.LabelStyle.FILL_AND_OUTLINE,
-                    text: name, //图标名称
-                    fillColor: Cesium.Color.fromCssColorString("#fff000"),
-                    pixelOffset: new Cesium.Cartesian2(5, -15),
-                    zIndex: 3,
-                  };
-                  addlabel = true;
-                }
+                // if (!addlabel) {
+                let center = this.getCentroid(geojson, ei);
+
+                var polycenter = Cesium.Cartesian3.fromDegrees(
+                  center[0],
+                  center[1],
+                  height
+                );
+                entity.position = polycenter;
+                entity.label = {
+                  font: "bolder 18px sans-serif",
+                  style: Cesium.LabelStyle.FILL_AND_OUTLINE,
+                  text: name, //图标名称
+                  fillColor: Cesium.Color.fromCssColorString("#fff000"),
+                  pixelOffset: new Cesium.Cartesian2(0, -20),
+                  zIndex: 3,
+                };
+                // addlabel = true;
+                // }
               }
             });
           }
@@ -379,6 +382,19 @@ export default {
           if (id == "all") _this.isshowAll = true;
         });
     },
+    getCentroid(geojson, eindex) {
+      if (turf.getType(geojson) === "Feature") {
+        geojson = geojson.geometry;
+      }
+      if (turf.getType(geojson) === "Polygon") {
+        return turf.centroid(geojson).geometry.coordinates;
+      } else if (turf.getType(geojson) === "MultiPolygon") {
+        let polygon = turf.polygon(geojson.coordinates[eindex]);
+        return turf.centroid(polygon).geometry.coordinates;
+      } else {
+        throw new Error("Unsupported geometry type");
+      }
+    },
     addprogramme(e, item) {
       e.stopPropagation();
       const list = this.bgList.filter((item1) => {
@@ -426,7 +442,7 @@ export default {
         viewer.flyTo(dataSources[upid], {
           offset: new Cesium.HeadingPitchRange(0, -0.8, 3000),
         });
-        else this.mapview(item)
+      else this.mapview(item);
     },
 
     deleteprogramme(e, item) {
@@ -462,9 +478,15 @@ export default {
         this.loadGeoJSON(parse(item.geom), "#000000", upid, height, item.dkbm);
       else {
         let entities = dataSources[upid].entities.values;
-        entities.forEach((entity) => {
+        entities.forEach((entity, ei) => {
           if (height && entity.polygon) {
             entity.polygon.extrudedHeight = height;
+            let center = this.getCentroid(parse(item.geom), ei);
+            entity.position = Cesium.Cartesian3.fromDegrees(
+              center[0],
+              center[1],
+              height
+            );
           }
         });
         viewer.flyTo(dataSources[upid], {

+ 1 - 1
src/views/siteselection/components/yxyzPop.vue

@@ -345,7 +345,7 @@ export default {
   },
   watch: {
     dialogVisible(oldVal, newVal) {
-      // this.resetDialogData();
+      if (newVal) this.resetDialogData();
     },
     yzTableData(oldVal, newVal) {
       let idArr = [];