ソースを参照

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

lkk 1 年間 前
コミット
72d0ea17bc

+ 2 - 181
src/components/Query/clickQuery/CockpitVector.vue

@@ -1,12 +1,7 @@
 <template>
   <div class="CockpitVectorBox">
-    <el-autocomplete class="search" @input="change_witch" v-model="state" :fetch-suggestions="querySearchAsync"
-      placeholder="请输入内容" @select="handleSelect" popper-class="select-option"
-      :popper-append-to-body="false"></el-autocomplete>
+    
     <div class="cockpit_vector">
-
-
-
       <div class="list_vector list_vector_multi" v-for="(item, index ) in store.state.vectorData" :key="index"
         v-if="item.name != 'geom'">
         <div class="filed_box">
@@ -44,50 +39,6 @@ export default {
   watch: {},
   //方法集合
   methods: {
-    change_witch() {
-      this.get_search(this.state);
-    },
-    get_search(word) {
-      if (word.length == 0) {
-        return false;
-      }
-      let gy_ju = {
-        jscType: 'jsc_tdgy_gy_zbmx_cx',
-        id: '4602',
-        val0: word,
-
-      }
-
-      // let bj_sl = {
-      //   beginTime: store.state.cockpit_date[0],
-      //   endTime: store.state.cockpit_date[1],
-      //   jscType: 'jsc_bjxm_csbj_zbmx_cx',
-      //   id: '4602',
-      //   val0: word,
-
-      // }
-
-      Promise.all([QueryList(gy_ju)]).then((values) => {
-        console.log('values: ', values);
-        this.restaurants = [];
-        values.forEach((item, index) => {
-          item.data.forEach((item, index) => {
-            if (item.xmmc != undefined && item.xmmc.length > 0) {
-              item.value = item.xmmc
-            }
-            if (item.sxnr != undefined && item.sxnr.length > 0) {
-              item.value = item.sxnr
-            }
-            this.restaurants.push(item);
-          });
-        });
-        console.log(this.restaurants);
-
-        // 当所有 promise 都成功完成时,values 是包含所有结果的数组  
-      }).catch((error) => {
-        console.error(error); // 如果有任何一个 promise 失败,则捕获这个错误  
-      });
-    },
     build_data(geojson) {
       geojson.coordinates.forEach((res) => {
         const twoDArray = res[0];
@@ -145,130 +96,6 @@ export default {
 
       })
     },
-    querySearchAsync(queryString, cb) {
-      var restaurants = this.restaurants;
-      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
-
-      clearTimeout(this.timeout);
-      this.timeout = setTimeout(() => {
-        cb(results);
-      }, 3000 * Math.random());
-    },
-    createStateFilter(queryString) {
-
-      return (state) => {
-
-        return (state.项目名称.indexOf(queryString) != -1);
-      };
-    },
-    handleSelect(item) {
-      let arr = [];
-      const that = this;
-      pick_entity = new Cesium.CustomDataSource("pick_entity");
-      viewer.dataSources.add(pick_entity);
-
-      Object.keys(item).forEach(key => {
-
-        arr.push({
-          "name": key,
-          "value": item[key],
-        });
-
-        if (key == 'geom') {
-          console.log(item[key]);
-
-
-          let geojson = wellknown.parse(item[key]);
-          console.log('geojson: ', geojson);
-
-
-
-          if (geojson.type == 'MultiPolygon') {
-            this.build_data(geojson);
-          } else {
-            const twoDArray = geojson.coordinates[0];
-            const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
-            pick_entity.entities.add({
-              polygon: {
-                // 获取指定属性(positions,holes(图形内需要挖空的区域))
-                hierarchy: {
-                  positions: Cesium.Cartesian3.fromDegreesArrayHeights(oneDArray),
-                },
-                // 边框
-                outline: true,
-                // 边框颜色
-                outlineColor: Cesium.Color.RED,
-                // 边框尺寸
-                outlineWidth: 2,
-                // 填充的颜色,withAlpha透明度
-                material: Cesium.Color.GREEN.withAlpha(0),
-                // 是否被提供的材质填充
-                fill: true,
-                // 恒定高度
-                height: 1.1,
-                // 显示在距相机的距离处的属性,多少区间内是可以显示的
-                // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1000, 10000000),
-                // 是否显示
-                show: true,
-                // 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
-                zIndex: 10
-              }
-            });
-            // 注意:polygon首尾坐标要一致
-            var polygon = turf.polygon([geojson.coordinates[0]]);
-
-            var centroid = turf.centroid(polygon).geometry.coordinates;
-
-            viewer.camera.flyTo({
-              duration: 1,
-
-              destination: Cesium.Cartesian3.fromDegrees(centroid[0], centroid[1], 3000),
-              // destination: {
-              //     x: -6283267.004204832,
-              //     y: 28123682.896774407,
-              //     z: 23709669.98539126
-              // },
-              orientation: {
-                heading: 6.149339593573709,
-                pitch: -1.539825618847483,
-                roll: 0
-              },
-            });
-
-
-          }
-
-          let flag = true;
-          let time = setInterval(() => {
-            flag = !flag
-            that.switch_show(flag);
-          }, 500);
-          setTimeout(() => {
-            clearInterval(time);
-            viewer.dataSources.remove(pick_entity);
-            // pick_entity.entities.values.forEach((res) => {
-            //   console.log('res: ', res);
-
-            //   pick_entity.entities.remove(res);
-
-            // })
-          }, 6000)
-
-
-
-        }
-      });
-
-
-      store.state.vectorData = arr
-
-
-    },
-    switch_show(flag) {
-      pick_entity.entities.values.forEach((res) => {
-        res.show = flag;
-      })
-    },
   },
   beforeCreate() { }, //生命周期 - 创建之前
   created() { }, //生命周期 - 创建完成(可以访问当前this实例)
@@ -294,12 +121,6 @@ export default {
   // color: #198ec0;
 }
 
-.search {
-  position: absolute;
-  top: 5rem;
-  right: 1rem;
-  width: 19rem;
-}
 
 .list_vector {
   background-image: url("/static/images/ghzc/内容框.png");
@@ -318,7 +139,7 @@ export default {
 
 .cockpit_vector {
   position: absolute;
-  top: 8rem;
+  top: 6rem;
   width: 20rem;
   height: 35rem;
   overflow: auto;

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

@@ -43,7 +43,7 @@
       </el-collapse>
     </div>
 
-    <CockpitVector v-if="store.state.query_vector_input"></CockpitVector>
+    <CockpitVector></CockpitVector>
     <MultiLevelQuery ref="MultiLevelQuery" />
   </div>
 </template>

+ 1 - 1
src/components/Query/clickQuery/pick_cockpit_vector.js

@@ -31,7 +31,7 @@ export const init_handler = () => {
         if (Cesium.defined(pickObj)) {
             let obj = {}
             let arr = [];
-            if (pickObj.primitive instanceof Cesium.Primitive && pickObj.id.properties && pickObj.id.properties.type == '国有建设用地完成项目') {//点击primitive
+            if (pickObj.primitive instanceof Cesium.Primitive && pickObj.id.properties && pickObj.id.properties.type._value == '国有建设用地完成项目') {//点击primitive
                 // primitive相关操作
                 let propertyNames = pickObj.id.properties.propertyNames
                 propertyNames.forEach((res) => {

+ 7 - 0
src/store/store.js

@@ -45,6 +45,11 @@ var store2 = {
         query_pick_pane: [],
         query_pick_last_pane: null,
         query_vector_input:false,
+        cockpit_vector:{
+            title:"",
+            tableData:"",
+            columns:[],
+        },
         cockpit_wpjg: {
             title: {},
             echart: {}
@@ -264,6 +269,8 @@ var store2 = {
 
     setXzqh_flag(newValue) {
         this.state.xzqh_flag = newValue;
+    },setCockpit_vector(newValue) {
+        this.state.cockpit_vector = newValue;
     },
 }
 

+ 6 - 9
src/views/cockpit/common/DialWatch.vue

@@ -30,8 +30,9 @@
                 <span>{{ dial_watch_info.rb.value }}</span>{{ dial_watch_info.rb.unit }}
                 <!-- <i style="pointer-events:all" :class="[`${dial_watch_info.rb.viewer}` ,viewer_switch]"></i> -->
 
-                <i v-show="dial_watch_info.rb.viewer" style="pointer-events:all"
-                    :class="{ 'el-icon-view-switch': icon_switch, 'el-icon-view': true }"></i>
+                <i v-show="dial_watch_info.rb.viewer" style="pointer-events:all" :class="{ 'el-icon-view': true }"></i>
+                <!-- <i v-show="dial_watch_info.rb.viewer" style="pointer-events:all"
+                    :class="{ 'el-icon-view-switch': icon_switch, 'el-icon-view': true }"></i> -->
             </div>
         </div>
     </div>
@@ -85,15 +86,11 @@ export default {
     methods: {
         draw_vector() {
             this.icon_switch = !this.icon_switch
-            console.log('this.icon_switch: ', this.icon_switch);
             this.$emit('draw_vector', this.icon_switch)
 
-            if (this.icon_switch) {
-                store.setViewerFlagb(false);
-                store.setToolBarShow(false);
-                store.setXzqh_flag(false);
-            }
-
+            store.setViewerFlagb(false);
+            store.setToolBarShow(false);
+            store.setXzqh_flag(false);
         },
         init_dial_watch(echart_data) {
             var myChart = echarts.init(this.$refs.dial_watch_scjg);

+ 264 - 179
src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

@@ -1,55 +1,33 @@
 <template>
-    <!-- <div class="BoxCommonVector">
-        <div class="innerContainerVector leftPaneVector">
-            <h2 class="PangetitleVector">
-                <span class="pange_textVector">智选址111</span>
-                <i class="el-icon-close" @click="close"></i>
-            </h2>
-
-            <el-autocomplete class="search" @input="change_witch" v-model="state" :fetch-suggestions="querySearchAsync"
-                placeholder="请输入内容" @select="handleSelect" popper-class="select-option"
-                :popper-append-to-body="false"></el-autocomplete>
-        </div>
-    </div> -->
-
     <div class="BoxCommonVector">
         <div class="innerContainerVector leftPaneVector">
 
             <h2 class="PangetitleVector">
-                <span class="pange_textVector">智选址</span>
-                <i class="el-icon-close" @click="close"></i>
+                <span class="pange_textVector">{{ title }}</span>
             </h2>
+            <i class="el-icon-close" @click="close"></i>
 
-            <el-autocomplete class="search" @input="change_witch" style="z-index: 1111;" v-model="state"
-                :fetch-suggestions="querySearchAsync" placeholder="请输入内容" @select="handleSelect"
-                :popper-append-to-body="false"></el-autocomplete>
-
+            <el-input clearable v-model="state" @input="change_witch" class="search" placeholder="请输入内容"></el-input>
 
-            <el-table :data="tableData" style="width: 100%" height="440" :header-cell-style="{
+            <el-table :data="active_dableData" style="width: 100%" height="490" :header-cell-style="{
                 background: 'rgba(10, 25, 38, 0.6)',
-                color: '#fff',
+                color: '#66b1ff',
                 fontSize: '14px',
                 fontFamily: 'Microsoft YaHei',
                 fontWeight: '400',
             }">
 
-                <el-table-column prop="date" label="日期" width="150">
-                </el-table-column>
-                <el-table-column prop="name" label="姓名" width="120">
-                </el-table-column>
-                <el-table-column prop="province" label="省份" width="120">
-                </el-table-column>
-                <el-table-column prop="city" label="市区" width="120">
-                </el-table-column>
-                <el-table-column prop="address" label="地址" width="300">
-                </el-table-column>
-                <el-table-column prop="zip" label="邮编" width="120">
+
+                <el-table-column show-overflow-tooltip="true" v-for="(index, item) in store.state.cockpit_vector.columns"
+                    :key="index" width="120" :prop="store.state.cockpit_vector.columns[item]"
+                    :label="store.state.cockpit_vector.columns[item]">
+
                 </el-table-column>
 
-                <el-table-column fixed="right" label="操作" width="100">
+                <el-table-column fixed="right" label="操作" width="90">
                     <template slot-scope="scope">
-                        <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
-                        <el-button type="text" size="small">编辑</el-button>
+                        <el-button @click="info(scope.row)" type="text" size="small">详情</el-button>
+                        <el-button @click="go(scope.row)" type="text" size="small">定位</el-button>
                     </template>
                 </el-table-column>
             </el-table>
@@ -59,165 +37,269 @@
   
 <script>
 import { QueryList } from '@/api/cockpitNew'
+import * as tdsy from "@/views/cockpit/js/tdsy";
+
 import * as wellknown from "wellknown";
 import * as turf from "@turf/turf";
+
+let pick_entity = null;
 export default {
     data() {
         return {
-            restaurants: [],
             state: '',
             timeout: null,
-            tableData: [{
-                date: '2016-05-03',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-02',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-04',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-01',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-08',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-06',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-07',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            },{
-                date: '2016-05-03',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-02',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            },{
-                date: '2016-05-03',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }, {
-                date: '2016-05-02',
-                name: '王小虎',
-                province: '上海',
-                city: '普陀区',
-                address: '上海市普陀区金沙江路 1518 弄',
-                zip: 200333
-            }]
+            title: "",
+            active_dableData: null,
+            tableData: null,
         };
     },
     methods: {
+        draw_vector_tdgy_gy_jd(data) {
+            data.forEach((res) => {
+                res.type = '国有建设用地完成项目'
+                if (res.geom) {
+                    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);
+                    })
+                }
+            })
+        },
 
         close() {
 
             store.setViewerFlagb(true);
+            tdsy.remove();
+            store.state.vectorData = [];
+
         },
-        change_witch() {
-            this.get_search(this.state);
+        info() { },
+        switch_show(flag) {
+            pick_entity.entities.values.forEach((res) => {
+                res.show = flag;
+            })
         },
-        get_search(word) {
-            if (word.length == 0) {
-                return false;
-            }
-            let gy_ju = {
-                jscType: 'jsc_tdgy_gy_zbmx_cx',
-                id: '4602',
-                val0: word,
-
-            }
+        build_data(geojson) {
+            geojson.coordinates.forEach((res) => {
+                const twoDArray = res[0];
+                const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+                console.log('oneDArray: ', oneDArray);
+
+                pick_entity.entities.add({
+                    polygon: {
+                        // 获取指定属性(positions,holes(图形内需要挖空的区域))
+                        hierarchy: {
+                            positions: Cesium.Cartesian3.fromDegreesArrayHeights(oneDArray),
+                        },
+                        // 边框
+                        outline: true,
+                        // 边框颜色
+                        outlineColor: Cesium.Color.RED,
+                        // 边框尺寸
+                        outlineWidth: 10,
+                        // 填充的颜色,withAlpha透明度
+                        material: Cesium.Color.GREEN.withAlpha(0),
+                        // 是否被提供的材质填充
+                        fill: true,
+                        // 恒定高度
+                        height: 1.1,
+                        // 显示在距相机的距离处的属性,多少区间内是可以显示的
+                        // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1000, 10000000),
+                        // 是否显示
+                        show: true,
+                        // 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
+                        zIndex: 10
+                    }
+                });
 
-            // let bj_sl = {
-            //   beginTime: store.state.cockpit_date[0],
-            //   endTime: store.state.cockpit_date[1],
-            //   jscType: 'jsc_bjxm_csbj_zbmx_cx',
-            //   id: '4602',
-            //   val0: word,
-
-            // }
-
-            Promise.all([QueryList(gy_ju)]).then((values) => {
-                this.restaurants = [];
-                values.forEach((item, index) => {
-                    item.data.forEach((item, index) => {
-                        if (item.项目名称 != undefined && item.项目名称.length > 0) {
-                            item.value = item.项目名称
-                        }
-                        if (item.sxnr != undefined && item.sxnr.length > 0) {
-                            item.value = item.sxnr
-                        }
-                        this.restaurants.push(item);
-                    });
+                // 注意:polygon首尾坐标要一致
+                var polygon = turf.polygon([twoDArray]);
+
+                var centroid = turf.centroid(polygon).geometry.coordinates;
+
+                viewer.camera.flyTo({
+                    duration: 1,
+
+                    destination: Cesium.Cartesian3.fromDegrees(centroid[0], centroid[1], 3000),
+                    // destination: {
+                    //     x: -6283267.004204832,
+                    //     y: 28123682.896774407,
+                    //     z: 23709669.98539126
+                    // },
+                    orientation: {
+                        heading: 6.149339593573709,
+                        pitch: -1.539825618847483,
+                        roll: 0
+                    },
                 });
 
 
-                // 当所有 promise 都成功完成时,values 是包含所有结果的数组  
-            }).catch((error) => {
-                console.error(error); // 如果有任何一个 promise 失败,则捕获这个错误  
+            })
+        },
+        go(item) {
+            let arr = [];
+            const that = this;
+            pick_entity = new Cesium.CustomDataSource("pick_entity");
+            viewer.dataSources.add(pick_entity);
+
+            Object.keys(item).forEach(key => {
+
+                arr.push({
+                    "name": key,
+                    "value": item[key],
+                });
+
+                if (key == 'geom') {
+                    console.log();
+
+
+                    let geojson = item[key];
+
+                    if (geojson.type == 'MultiPolygon') {
+                        this.build_data(geojson);
+                    } else {
+                        const twoDArray = geojson.coordinates[0];
+                        const oneDArray = twoDArray.reduce((accumulator, currentValue) => accumulator.concat(currentValue), []);
+                        pick_entity.entities.add({
+                            polygon: {
+                                // 获取指定属性(positions,holes(图形内需要挖空的区域))
+                                hierarchy: {
+                                    positions: Cesium.Cartesian3.fromDegreesArrayHeights(oneDArray),
+                                },
+                                // 边框
+                                outline: true,
+                                // 边框颜色
+                                outlineColor: Cesium.Color.RED,
+                                // 边框尺寸
+                                outlineWidth: 10,
+                                // 填充的颜色,withAlpha透明度
+                                material: Cesium.Color.GREEN.withAlpha(0),
+                                // 是否被提供的材质填充
+                                fill: true,
+                                // 恒定高度
+                                height: 1.1,
+                                // 显示在距相机的距离处的属性,多少区间内是可以显示的
+                                // distanceDisplayCondition: new Cesium.DistanceDisplayCondition(1000, 10000000),
+                                // 是否显示
+                                show: true,
+                                // 顺序,仅当`clampToGround`为true并且支持地形上的折线时才有效。
+                                zIndex: 10
+                            }
+                        });
+                        // 注意:polygon首尾坐标要一致
+                        var polygon = turf.polygon([geojson.coordinates[0]]);
+
+                        var centroid = turf.centroid(polygon).geometry.coordinates;
+
+                        viewer.camera.flyTo({
+                            duration: 1,
+
+                            destination: Cesium.Cartesian3.fromDegrees(centroid[0], centroid[1], 3000),
+                            // destination: {
+                            //     x: -6283267.004204832,
+                            //     y: 28123682.896774407,
+                            //     z: 23709669.98539126
+                            // },
+                            orientation: {
+                                heading: 6.149339593573709,
+                                pitch: -1.539825618847483,
+                                roll: 0
+                            },
+                        });
+
+
+                    }
+
+                    let flag = true;
+                    let time = setInterval(() => {
+                        flag = !flag
+                        that.switch_show(flag);
+                    }, 500);
+                    setTimeout(() => {
+                        clearInterval(time);
+                        console.log("s");
+                        console.log(pick_entity);
+                        viewer.dataSources.remove(pick_entity);
+
+
+                    }, 6000)
+
+
+
+                }
             });
+
+
+            store.state.vectorData = arr
+
+
         },
-        querySearchAsync(queryString, cb) {
-            var restaurants = this.restaurants;
-            var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
-
-            clearTimeout(this.timeout);
-            this.timeout = setTimeout(() => {
-                cb(results);
-            }, 3000 * Math.random());
+        change_witch() {
+            this.get_search(this.state);
+        },
+        get_search(word) {
+            if (word.length == 0) {
+                this.active_dableData = this.tableData;
+            } else {
+                let gy_ju = {
+                    jscType: 'jsc_tdgy_gy_zbmx_cx',
+                    id: '4602',
+                    val0: word,
+
+                }
+
+                // let bj_sl = {
+                //   beginTime: store.state.cockpit_date[0],
+                //   endTime: store.state.cockpit_date[1],
+                //   jscType: 'jsc_bjxm_csbj_zbmx_cx',
+                //   id: '4602',
+                //   val0: word,
+
+                // }
+
+                Promise.all([QueryList(gy_ju)]).then((values) => {
+                    this.active_dableData = values[0].data
+                }).catch((error) => {
+                    console.error(error); // 如果有任何一个 promise 失败,则捕获这个错误  
+                });
+            }
+
         },
-        createStateFilter(queryString) {
 
-            return (state) => {
+    },
+    computed: {
+        cockpit_vector() {
+            return store.state.cockpit_vector;
+        },
 
-                return (state.项目名称.indexOf(queryString) != -1);
-            };
+    },
+    watch: {
+        cockpit_vector(newVal, oldVal) {
+            console.log('newVal: ', newVal);
+            this.title = newVal.title
+            this.active_dableData = newVal.tableData
+            this.tableData = newVal.tableData
         },
-        handleSelect(item) {
-            console.log(item);
+        active_dableData(newVal, oldVal) {
+            this.draw_vector_tdgy_gy_jd(newVal);
         }
     },
     mounted() {
+        const that = this;
+        this.$nextTick(() => {
+
+            pick_entity = new Cesium.CustomDataSource("pick_entity");
+            viewer.dataSources.add(pick_entity);
+
+        });
     }
 
 };
@@ -245,12 +327,11 @@ export default {
     border-top-right-radius: 15px;
 
     .search {
-        margin: 2rem;
+        // margin: 2rem;
     }
 
     /deep/ .el-input {
         display: inline-block;
-        width: 130%;
     }
 
     /deep/ .el-input__inner {
@@ -266,6 +347,19 @@ export default {
 .leftPaneVector {
     left: 20px;
 
+    .el-icon-close {
+        width: 22px;
+        height: 22px;
+        color: #fff !important;
+        background-color: #335f87;
+        line-height: 23px;
+        padding: 0 5px;
+        border-radius: 4px;
+        top: -1.9rem !important;
+        position: relative;
+        right: -19.5rem;
+    }
+
     .PangetitleVector {
         box-sizing: border-box;
         width: 100%;
@@ -279,18 +373,7 @@ export default {
         position: relative;
         overflow: hidden;
 
-        .el-icon-close {
-            width: 22px;
-            height: 22px;
-            color: #fff !important;
-            background-color: #335f87;
-            line-height: 23px;
-            padding: 0 5px;
-            border-radius: 4px;
-            top: 5px !important;
-            position: relative;
-            right: -14.5rem;
-        }
+
     }
 
     .pange_textVector {
@@ -396,7 +479,9 @@ export default {
 
 }
 
-/deep/ .el-table--border::after, .el-table--group::after, .el-table::before {
+/deep/ .el-table--border::after,
+.el-table--group::after,
+.el-table::before {
     background: rgba(10, 25, 38, 0) !important;
 }
 </style>

+ 26 - 7
src/views/cockpit/js/tdsy.js

@@ -1,21 +1,24 @@
-let gy_jd_entity = {};
+let gy_jd_entity = null;
 let _viewer = {};
 
 export const init = (viewer) => {
 
-    gy_jd_entity = new Cesium.CustomDataSource("gy_jd_entity");
-    viewer.dataSources.add(gy_jd_entity);
-    gy_jd_entity.show = false;
-    _viewer = viewer;
+    if (gy_jd_entity == null) {
+        gy_jd_entity = new Cesium.CustomDataSource("gy_jd_entity");
+        viewer.dataSources.add(gy_jd_entity);
+        // gy_jd_entity.show = false;
+        _viewer = viewer;
+    }
 
 }
 
 export const add = (res, oneDArray) => {
 
+    init(viewer);
     gy_jd_entity.entities.add({
         // position: Cesium.Cartesian3.fromDegrees(res_coordinates[0], res_coordinates[1], 0),
         properties: res,
-        name: "国有建设用地完成项目",
+        
         polygon: {
             zIndex: 1,
             hierarchy: {
@@ -25,14 +28,30 @@ export const add = (res, oneDArray) => {
             // material: Cesium.Color.fromCssColorString(xzqh_color),
 
             height: 5,
-            extrudedHeight: 0,
+            // extrudedHeight: 5,
             outline: true,
             // outlineColor : Cesium.Color.BLACK
             outlineColor: Cesium.Color.fromCssColorString('#55A1E3'),
         }
     })
 }
+export const remove = () => {
+    viewer.dataSources.remove(gy_jd_entity);
+    gy_jd_entity = null
+    store.setCockpit_vector({
+        title: "",
+        tableData: [],
+        columns: [],
+    })
+    // if (gy_jd_entity.entities) {
+    //     gy_jd_entity.entities.values.forEach((res) => {
+    //         if (res.name == type) {
+    //             gy_jd_entity.remove(res);
+    //         }
+    //     })
+    // }
 
+}
 export const hidden = (flag) => {
     gy_jd_entity.show = flag;
 

+ 19 - 42
src/views/cockpit/tdsy.vue

@@ -837,48 +837,25 @@ export default {
       this.$refs.hysy_bar_graph.setOptions(this.legendData, this.xdata, this.result);
 
     },
-    draw_vector_tdgy_gy_jd() {
-      this.vector_data.forEach((res) => {
-        res.type = '国有建设用地完成项目'
-        if (res.geom) {
-          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), []);
-
-            // this.gy_jd_entity.entities.add({
-            //   // position: Cesium.Cartesian3.fromDegrees(res_coordinates[0], res_coordinates[1], 0),
-            //   properties: res,
-            //   name: "国有建设用地完成项目",
-            //   polygon: {
-            //     zIndex: 1,
-            //     hierarchy: {
-            //       positions: Cesium.Cartesian3.fromDegreesArrayHeights(oneDArray),
-            //     },
-            //     // outline: false,
-            //     // material: Cesium.Color.fromCssColorString(xzqh_color),
-
-            //     height: 5,
-            //     extrudedHeight: 0,
-            //     outline: true,
-            //     // outlineColor : Cesium.Color.BLACK
-            //     outlineColor: Cesium.Color.fromCssColorString('#55A1E3'),
-            //   }
-            // })
-
-            tdsy.add(res, oneDArray);
-          })
-        }
-      })
-    },
     switch_vector_tdgy_gy_jd(flag) {
-      store.state.query_vector_input = !store.state.query_vector_input
+
+      // store.state.query_vector_input = !store.state.query_vector_input
+      // if (flag) {
+      //   store.setCockpit_vector({
+      //     title: "土地供应完成项目",
+      //     tableData: this.vector_data,
+      //     columns:["项目名称","土地用途","出让面积(公顷)","土地使用权","土地座落","批准文号","批准机关"],
+      //   })
+      // }
+
+
+      store.setCockpit_vector({
+        title: "土地供应完成项目",
+        tableData: this.vector_data,
+        columns: ["项目名称", "土地用途", "出让面积(公顷)", "土地使用权", "土地座落", "批准文号", "批准机关"],
+      })
+
     },
     async init_vector(params) {
       const that = this;
@@ -894,7 +871,7 @@ export default {
 
       })
       this.vector_data = data.data;
-      // this.draw_vector_tdgy_gy_jd()
+
     }
   },
   mounted() {
@@ -917,7 +894,7 @@ export default {
       // viewer.dataSources.add(this.gy_jd_entity);
       // this.gy_jd_entity.show = false
 
-      tdsy.init(viewer);
+      // tdsy.init(viewer);
 
 
     });