Procházet zdrojové kódy

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

zpf před 10 měsíci
rodič
revize
6be715da3a
1 změnil soubory, kde provedl 48 přidání a 25 odebrání
  1. 48 25
      src/views/complianceAnalysis/components/scjg.vue

+ 48 - 25
src/views/complianceAnalysis/components/scjg.vue

@@ -1,16 +1,21 @@
 <template>
 <template>
   <div class="scjg">
   <div class="scjg">
-    <div>
-      <div class="downloadDiv">
+    <div class="downloadDiv">
+      <div>
         <span class="xmmc">
         <span class="xmmc">
           项目名称:
           项目名称:
           <span class="text">{{ scjgObj.xmmc }}</span>
           <span class="text">{{ scjgObj.xmmc }}</span>
         </span>
         </span>
-        <span class="export" @click="download">导出报告</span>
+        <div
+          class="eicon"
+          :class="isshowAll ? 'eyes' : 'close_eyes'"
+          @click="allChange('all')"
+        ></div>
       </div>
       </div>
       <div>
       <div>
         分析面积:
         分析面积:
         <span class="text">{{ compute(scjgObj.fxmj) }}亩</span>
         <span class="text">{{ compute(scjgObj.fxmj) }}亩</span>
+        <span class="export" @click="download">导出报告</span>
       </div>
       </div>
     </div>
     </div>
 
 
@@ -88,10 +93,11 @@ export default {
       tempdataSourcesId: null,
       tempdataSourcesId: null,
       fileid: 1,
       fileid: 1,
       reflist: {},
       reflist: {},
+      isshowAll: true,
     };
     };
   },
   },
   mounted() {
   mounted() {
-    this.initData();
+    // this.initData();
   },
   },
   methods: {
   methods: {
     compute(mj) {
     compute(mj) {
@@ -103,6 +109,7 @@ export default {
     initData() {
     initData() {
       this.echarts = [];
       this.echarts = [];
       this.$emit("updateParent", "loading", true);
       this.$emit("updateParent", "loading", true);
+      this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000", true);
       GetFxjg({ bsm: this.$props.scjgObj.bsm }).then((res) => {
       GetFxjg({ bsm: this.$props.scjgObj.bsm }).then((res) => {
         if (res.success) {
         if (res.success) {
           res.data.forEach((e) => {
           res.data.forEach((e) => {
@@ -130,6 +137,14 @@ export default {
         }
         }
       });
       });
     },
     },
+    allChange(id) {
+      this.isshowAll = !this.isshowAll;
+      if (dataSourceList[id]) {
+        dataSourceList[id].show = this.isshowAll;
+      } else {
+        this.addPolygon(this.$props.scjgObj.geom, "all", "#ff0000", true);
+      }
+    },
     eyesChaneg(i) {
     eyesChaneg(i) {
       this.echarts[i].iseyes = !this.echarts[i].iseyes;
       this.echarts[i].iseyes = !this.echarts[i].iseyes;
       // if (i == 0 || i == 2) {
       // if (i == 0 || i == 2) {
@@ -199,16 +214,17 @@ export default {
       });
       });
     },
     },
     // 加载GeoJSON数据
     // 加载GeoJSON数据
-    addPolygon(geom, id, colors) {
+    addPolygon(geom, id, colors, fillreset) {
       let geojson = parse(geom);
       let geojson = parse(geom);
       let _this = this;
       let _this = this;
       // viewer.entities.removeAll();
       // viewer.entities.removeAll();
       let scolor = colors
       let scolor = colors
         ? Cesium.Color.fromCssColorString(colors)
         ? Cesium.Color.fromCssColorString(colors)
         : Cesium.Color.RED;
         : Cesium.Color.RED;
-      let fcolor = colors
-        ? Cesium.Color.fromCssColorString(colors)
-        : Cesium.Color.WHITE;
+      let fcolor =
+        colors && !fillreset
+          ? Cesium.Color.fromCssColorString(colors)
+          : Cesium.Color.WHITE;
 
 
       let polygon = Cesium.GeoJsonDataSource.load(geojson, {
       let polygon = Cesium.GeoJsonDataSource.load(geojson, {
         clampToGround: true,
         clampToGround: true,
@@ -279,21 +295,40 @@ export default {
   padding-right: 10px;
   padding-right: 10px;
   line-height: 40px;
   line-height: 40px;
   .downloadDiv {
   .downloadDiv {
+    position: relative;
     .xmmc {
     .xmmc {
-      width: calc(100% - 120px);
+      width: calc(100% - 60px);
       display: inline-block;
       display: inline-block;
     }
     }
     .export {
     .export {
-      width: 110px;
-      height: 32px;
+      width: 95px;
+      height: 28px;
       background: #0f7ac8;
       background: #0f7ac8;
       text-align: center;
       text-align: center;
       line-height: 32px;
       line-height: 32px;
       display: inline-block;
       display: inline-block;
+      position: absolute;
+      right: 2px;
+      bottom: 6px;
+    }
+    .text {
+      color: #cddeeb;
     }
     }
   }
   }
-  .text {
-    color: #cddeeb;
+
+  .eicon {
+    width: 20px;
+    height: 20px;
+    margin-top: 10px;
+    background-size: 100% 100%;
+    display: inline-block;
+    cursor: pointer;
+  }
+  .eyes {
+    background-image: url("/static/images/ghzc/eyes.png");
+  }
+  .close_eyes {
+    background-image: url("/static/images/ghzc/close_eyes.png");
   }
   }
 
 
   .echars {
   .echars {
@@ -311,18 +346,6 @@ export default {
       .block-title {
       .block-title {
         width: calc(100% - 50px);
         width: calc(100% - 50px);
       }
       }
-      .eicon {
-        width: 20px;
-        height: 20px;
-        margin-top: 10px;
-        background-size: 100% 100%;
-      }
-      .eyes {
-        background-image: url("/static/images/ghzc/eyes.png");
-      }
-      .close_eyes {
-        background-image: url("/static/images/ghzc/close_eyes.png");
-      }
       .eshow {
       .eshow {
         background-image: url("/static/images/ghzc/to_bottom.png");
         background-image: url("/static/images/ghzc/to_bottom.png");
       }
       }