|
@@ -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) {
|