|
@@ -155,18 +155,21 @@ export default {
|
|
|
copyData: null,
|
|
|
arrww: [],
|
|
|
dataSources: {},
|
|
|
- tempdataSourcesId:null,
|
|
|
+ tempdataSourcesId: null,
|
|
|
+ xzjgBSM: "",
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
- GetXzjg({ bsm: "dbc5fcf178fc4592b4940627e758b90d" }).then((res) => {
|
|
|
- this.xzjgObj = JSON.parse(JSON.stringify(res.data));
|
|
|
- this.copyData = JSON.parse(JSON.stringify(res.data));
|
|
|
- this.tempObj = JSON.parse(JSON.stringify(res.data));
|
|
|
- this.xzjgObj.dks.forEach((item) => {
|
|
|
- this.drawWktPloygon(item.geom, "#0000ff"); //item.dkbm
|
|
|
+ this.bus.$on("xzjgBSM", (val) => {
|
|
|
+ GetXzjg({ bsm: val }).then((res) => {
|
|
|
+ this.xzjgObj = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.copyData = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.tempObj = JSON.parse(JSON.stringify(res.data));
|
|
|
+ this.xzjgObj.dks.forEach((item) => {
|
|
|
+ this.drawWktPloygon(item.geom, "#0000ff"); //item.dkbm
|
|
|
+ });
|
|
|
+ this.drawWktPloygon(res.data.geom, "#ff0000"); //res.data.bsm
|
|
|
});
|
|
|
- this.drawWktPloygon(res.data.geom, "#ff0000"); //res.data.bsm
|
|
|
});
|
|
|
},
|
|
|
methods: {
|
|
@@ -254,7 +257,7 @@ export default {
|
|
|
offset: new Cesium.HeadingPitchRange(0, -45, 5000),
|
|
|
});
|
|
|
if (id) {
|
|
|
- this.tempdataSourcesId = id
|
|
|
+ this.tempdataSourcesId = id;
|
|
|
_this.dataSources[id] = dataSource;
|
|
|
}
|
|
|
});
|
|
@@ -326,6 +329,9 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
+ beforeResolve(to, from, next) {
|
|
|
+ console.log(to, from, next, "to, from, next");
|
|
|
+ },
|
|
|
|
|
|
watch: {
|
|
|
activeTabs(newValue, oldValue) {
|
|
@@ -334,16 +340,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//监听区域id的变化,用于删除上一次点击生成的geojson区域面
|
|
|
- tempdataSourcesId(newVal,oldVal){
|
|
|
+ tempdataSourcesId(newVal, oldVal) {
|
|
|
if (oldVal) {
|
|
|
viewer.dataSources.remove(this.dataSources[oldVal]);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
|
|
|
beforeDestroy() {
|
|
|
viewer.entities.removeAll();
|
|
|
viewer.dataSources.removeAll();
|
|
|
+ this.bus.$off("xzjgBSM"); //清除全局事件总线
|
|
|
},
|
|
|
};
|
|
|
</script>
|