zpf 10 ماه پیش
والد
کامیت
5904d94063
3فایلهای تغییر یافته به همراه80 افزوده شده و 50 حذف شده
  1. 57 35
      src/views/cockpit/common/VectorSpace/BoxCommonVector.vue
  2. 21 14
      src/views/cockpit/gdbh.vue
  3. 2 1
      src/views/viewer.vue

+ 57 - 35
src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

@@ -57,8 +57,26 @@ export default {
         draw_vector_tdgy_gy_jd(data) {
             // tdsy.remove();
             data.forEach((res) => {
+
                 res.type = this.title
-                if (res.geom) {
+
+                if (res.geom.type == "MultiPolygon") {
+                    console.log("多面");
+
+                    res.geom.coordinates.forEach((res_coordinates) => {
+                        let arrayt = [];
+                        if (res_coordinates.length == 1) {
+                            arrayt = res_coordinates[0]
+                        } else {
+                            arrayt = res_coordinates
+                        }
+
+                        const twoDArray = arrayt;
+                        const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+                        tdsy.add(res, oneDArray);
+                    })
+                } else {
+                    console.log("单面");
                     res.geom.coordinates.forEach((res_coordinates) => {
                         let arrayt = [];
                         if (res_coordinates.length == 1) {
@@ -72,6 +90,7 @@ export default {
                         tdsy.add(res, oneDArray);
                     })
                 }
+
             })
         },
 
@@ -257,14 +276,14 @@ export default {
                 this.active_dableData = this.tableData;
             } else {
                 let gy_ju = {
-                  beginTime: store.state.cockpit_date[0],
-                  endTime: store.state.cockpit_date[1],
-                  jscType: store.state.cockpit_vector.tablejscType + '_cx',
-                  id: '4602',
-                  val0: word,
+                    beginTime: store.state.cockpit_date[0],
+                    endTime: store.state.cockpit_date[1],
+                    jscType: store.state.cockpit_vector.tablejscType + '_cx',
+                    id: '4602',
+                    val0: word,
 
                 }
-                if(this.title == '土地供应完成项目' || this.title == '山水工程完成项目'){
+                if (this.title == '土地供应完成项目' || this.title == '山水工程完成项目') {
                     gy_ju.beginTime = undefined
                     gy_ju.endTime = undefined
                 }
@@ -293,27 +312,28 @@ export default {
             }
 
         },
-    async init_vector(params) {
-      const that = this;
-      let obj = {
-        jscType: store.state.cockpit_vector.tablejscType,
-        beginTime: store.state.cockpit_date[0],
-        endTime: store.state.cockpit_date[1],
-        id: params ? params.id : "4602",
-      };
-      if(this.title == '土地供应完成项目' || this.title == '山水工程完成项目'){
-            obj.beginTime = undefined
-            obj.endTime = undefined
-        }
-      let data = await QueryList(obj);
-      data.data.map((res) => {
-        if (res.geom) {
-          res.geom = wellknown.parse(res.geom.split(";")[1]);
-        }
-      });
-      this.active_dableData = data.data
-      this.tableData = data.data
-    },
+        async init_vector(params) {
+            const that = this;
+            let obj = {
+                jscType: store.state.cockpit_vector.tablejscType,
+                beginTime: store.state.cockpit_date[0],
+                endTime: store.state.cockpit_date[1],
+                id: params ? params.id : "4602",
+            };
+            if (this.title == '土地供应完成项目' || this.title == '山水工程完成项目') {
+                obj.beginTime = undefined
+                obj.endTime = undefined
+            }
+            let data = await QueryList(obj);
+            console.log('data: ', data);
+            data.data.map((res) => {
+                if (res.geom) {
+                    res.geom = wellknown.parse(res.geom.split(";")[1]);
+                }
+            });
+            this.active_dableData = data.data
+            this.tableData = data.data
+        },
 
     },
     computed: {
@@ -324,16 +344,18 @@ export default {
     },
     watch: {
         cockpit_vector(newVal, oldVal) {
-            console.log('newVal: ', newVal);
             this.title = newVal.title
+            if (newVal.tableData.length <= 0) {
+                this.tableData = []
+            }
             if (newVal.tableData.length > 0) {
-              this.active_dableData = newVal.tableData
-              this.tableData = newVal.tableData
-            }else {
-              this.init_vector()
+                this.active_dableData = newVal.tableData
+                this.tableData = newVal.tableData
+            } else {
+                this.init_vector()
             }
-            if(newVal.goitem){
-              this.go(newVal.goitem)
+            if (newVal.goitem) {
+                this.go(newVal.goitem)
             }
         },
         active_dableData(newVal, oldVal) {

+ 21 - 14
src/views/cockpit/gdbh.vue

@@ -100,7 +100,8 @@
       </div>
 
       <div v-show="tab == options[2].value">
-        <div class="content">
+
+        <div class="content" @click="vector_viewer">
           <div class="item">
             <div class="icon">
               <div class="icon_st">
@@ -110,6 +111,7 @@
             <div class="text">
               <p>流入耕地</p>
               <span>{{ zbpg_hz.jcpg.lrgd }}</span>km²
+              <i style="pointer-events:all" :class="{ 'el-icon-view': true }"></i>
 
             </div>
           </div>
@@ -122,6 +124,7 @@
             <div class="text">
               <p>流出耕地</p>
               <span>{{ zbpg_hz.jcpg.lcgd }}</span>km²
+              <i style="pointer-events:all" :class="{ 'el-icon-view': true }"></i>
 
             </div>
           </div>
@@ -636,13 +639,25 @@ export default {
       })
       this.$refs.jcpg.setOptions(arr);
     },
+    vector_viewer() {
+      store.setCockpit_vector({
+        title: "进出平衡",
+        tableData: this.vector_data,
+        tablejscType: 'jsc_tdgy_gy_zbmx',
+        columns: [
+          "进出状态",
+          "地类编码",
+          "地类编码名称",
+        ],
+      });
+    },
     async init_jcph_table(params) {
       const that = this;
       let obj = {
         jscType: "jsc_gdbh_jcph_zbmc",
         id: params ? params.id : "4602",
-        val1: 1,
-        val2: 50000,
+        val2: 0,
+        val1: 50000,
         beginTime: store.state.cockpit_date[1].slice(0, 4)
       };
       let data = await QueryList(obj);
@@ -652,16 +667,8 @@ export default {
         }
       });
       this.vector_data = data.data;
-      store.setCockpit_vector({
-        title: "进出平衡",
-        tableData: this.vector_data,
-        tablejscType: 'jsc_tdgy_gy_zbmx',
-        columns: [
-          "进出状态",
-          "地类编码",
-          "地类编码名称",
-        ],
-      });
+      console.log('this.vector_data: ', this.vector_data);
+
     },
     async init_jcpg_hz(params) {
 
@@ -694,7 +701,7 @@ export default {
       this.init_zbph();
       this.init_jcpg();
       this.init_zbph_hz();
-      // this.init_jcph_table();
+      this.init_jcph_table();
       this.init_jcpg_hz();
     })
   },

+ 2 - 1
src/views/viewer.vue

@@ -138,8 +138,9 @@ export default {
             this.$refs.gdbh_ref.init_info(this.params);
             this.$refs.gdbh_ref.init_zbph_hz(this.params);
             this.$refs.gdbh_ref.init_jcpg_hz(this.params);
+            this.$refs.gdbh_ref.init_jcph_table(this.params);
 
-
+            
             // this.$refs.stxf_ref.setData({ id: this.params.id });
             // this.$refs.wpjg_ref.setData(this.params);
             // 卫片监管