ソースを参照

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

maxiaoxiao 11 ヶ月 前
コミット
ecacaa253c

+ 1 - 0
src/views/complianceAnalysis/components/scjgContent.vue

@@ -56,6 +56,7 @@ export default {
       });
     },
     echartClick(name, { iseyes }) {
+      console.log('name: ', name);
       let iszoom = iseyes == undefined;//红色高亮,不受眼睛控制
       if (this.piseyes || iszoom) {
         let click = this.litem.dataList.filter((c) => c.name == name);

+ 64 - 4
src/views/siteselection/components/dkDetailsNew.vue

@@ -9,11 +9,11 @@
       element-loading-background="rgba(0, 0, 0, 0.8)" class="loadingDiv" v-if="title == '规划信息'">
 
 
-      <el-tabs v-model="activeName" @tab-click="handleClick">
+      <el-tabs @tab-click="handleClick">
         <el-tab-pane :label="item.tableName" :name="item.tableName" v-for="(item, index) in tabs_list" :key="index">
 
           <div v-if="item.tableName != '权属'">
-            <pie class="echart" unit="平方米" :ref="`ghxz_pie`"></pie>
+            <pie class="echart" unit="平方米" :ref="`ghxz_pie`" @echartClick="echartClick"></pie>
 
             <el-table :data="tableData" style="width: 100%" :header-cell-style="{
               background: 'rgba(10, 25, 38, 0.6)',
@@ -76,6 +76,8 @@ import pie from "@/components/echartsTemplate/pieNew.vue";
 import { GetCascadeList, GetTabsPanePost } from "@/api/cockpitNew";
 import * as wellknown from "wellknown";
 
+let dataSourceList_gh = {};
+
 // 使用
 export default {
   components: { pie },
@@ -97,9 +99,67 @@ export default {
     };
   },
   methods: {
-    async show(item, title) {
-      console.log('item: ', item);
+    addPolygon(geom, id, colors, fillreset) {
+      let geojson = wellknown.parse(geom);
+      let _this = this;
+      // viewer.entities.removeAll();
+      let scolor = colors
+        ? Cesium.Color.fromCssColorString(colors)
+        : Cesium.Color.RED;
+      let fcolor =
+        colors && !fillreset
+          ? Cesium.Color.fromCssColorString(colors)
+          : Cesium.Color.WHITE;
+
+      let polygon = Cesium.GeoJsonDataSource.load(geojson, {
+        clampToGround: true,
+        stroke: scolor,
+        fill: fcolor.withAlpha(0.3), //注意:颜色必须大写,即不能为blue
+        strokeWidth: 5,
+      });
+      polygon.then(function (dataSource) {
+        // dataSource.id = id;
+        // 将数据源添加到Cesium Viewer
+        dataSource.name = 'qwe'
+        viewer.dataSources.add(dataSource);
+        viewer.zoomTo(dataSource);
+        dataSourceList_gh[id] = dataSource;
+        if (id == "all") _this.isshowAll = true;
+     
+      });
+    },
+    reset() {
+
+      for (let index = 0; index < 10; index++) {
+        var len = viewer.dataSources.length;
+        if (len > 0) {
+          for (var n = 0; n < len; n++) {
+
+            if (viewer.dataSources.get(n) != undefined && viewer.dataSources.get(n).name != undefined && viewer.dataSources.get(n).name === 'qwe') {
+              viewer.dataSources.remove(viewer.dataSources.get(n));
+            }
+          }
+        }
+      }
+
+    },
+    echartClick(name, { iseyes }) {
+      this.reset();
+
+      this.tableData.forEach((res) => {
+        const keys = Object.keys(res);
+        for (const key of keys) {
+          let value = res[key];
+          if (value == name) {
+            this.addPolygon(res.空间信息.split(";")[1], "all", "#ff0000", true);
+          }
+        }
 
+      })
+
+
+    },
+    async show(item, title) {
 
       this.title = title;
       this.isDateilsShow = true;