Explorar el Código

新增海域用地图表

lkk hace 1 año
padre
commit
bcd69ef187

+ 24 - 8
src/components/Query/clickQuery/CockpitVector.vue

@@ -57,12 +57,28 @@ export default {
       state: "",
       timeout: null,
       pick_entity: null,
+      dataid: 0,
+      tempData: [],
     };
   },
   //监听属性 类似于data概念
-  computed: {},
+  computed: {
+    vectordataid() {
+      return store.state.vectordataid;
+    },
+  },
   //监控data中的数据变化
-  watch: {},
+  watch: {
+    vectordataid: {
+      immediate: true,
+      handler(newValue) {
+        this.dataid = newValue;
+        this.$nextTick(()=>{
+          this.initChart();
+        })
+      },
+    },
+  },
   //方法集合
   methods: {
     build_data(geojson) {
@@ -134,17 +150,17 @@ export default {
         beginTime: params ? params.beginTime : store.state.cockpit_date[0],
         endTime: params ? params.endTime : store.state.cockpit_date[1],
         id: params ? params.id : "4602",
-        val0: params ? params.dataid : "3",
+        val0: this.dataid == 0 ? store.state.vectordataid : this.dataid,
       };
       let res = await QueryList(obj);
       const data = [];
-      var total = 0
+      var total = 0;
       res.data.forEach((item, index) => {
         data.push({
           name: item["用海类型"],
           value: item["宗海面积(公顷)"],
         });
-        total += Number(item["宗海面积(公顷)"])
+        total += Number(item["宗海面积(公顷)"]);
       });
       const color = [
         "#3591FF",
@@ -186,7 +202,7 @@ export default {
       });
       let option = {
         //你的代码
-        backgroundColor:'transparent',
+        backgroundColor: "transparent",
         legend: {
           // type: 'scroll',
           show: true,
@@ -285,11 +301,11 @@ export default {
       pick_entity = new Cesium.CustomDataSource("pick_entity");
       viewer.dataSources.add(pick_entity);
     }); //生命周期 - 挂在完成
-    this.initChart();
   }, //生命周期 - 挂在完成
   beforeUpdate() {}, //生命周期 - 更新之前
   updated() {}, //生命周期 - 更新之后
-  beforeDestroy() {}, //生命周期 - 销毁之前
+  beforeDestroy() {
+  }, //生命周期 - 销毁之前
   destroy() {}, //生命周期 - 销毁完成
   activated() {}, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件被插入到 DOM 中时调用。
   deactivated() {}, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件从 DOM 中被移除时调用。

+ 5 - 1
src/store/store.js

@@ -137,7 +137,8 @@ var store2 = {
             ghdkmj: 0,//已入库管控范围
             tbmj_ys: 0,
             isNightSwitch: false, //夜景状态(中图)
-        }
+        },
+        vectordataid:0,
     },
     setisInitViewer(newValue) {
         this.state.isInitViewer = newValue;
@@ -155,6 +156,9 @@ var store2 = {
     setLayerList(newValue) {//分层分户
         this.state.chooseLayer = newValue;
     },
+    setVectordataid(newValue) {//分层分户
+        this.state.vectordataid = newValue;
+    },
     setFlattenNames(newValue) {//压平
         this.state.flattenNames = newValue;
     },

+ 1 - 0
src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

@@ -189,6 +189,7 @@ export default {
             })
         },
         go(item) {
+            store.setVectordataid(item.dataid)
             let arr = [];
             const that = this;
             // BoxCommonVector_entity = new Cesium.CustomDataSource("BoxCommonVector_entity");

+ 0 - 2
src/views/cockpit/tdsy.vue

@@ -130,7 +130,6 @@ import Title from './common/Title.vue';
 import parse from "wellknown";
 import * as tdsy from "./js/tdsy";
 let dataSources = {};
-import { mapState, mapGetters } from "vuex";
 export default {
   components: { pie3d, DialWatch, Graph3D, Title },
   data() {
@@ -1184,7 +1183,6 @@ export default {
       this.vector_data = data.data;
     },
      SeaTransfer(){
-      console.log("多喝水撒大华三路");
       store.setViewerFlagb(false);
       store.setToolBarShow(false);
       store.setXzqh_flag(false);