|
@@ -49,7 +49,7 @@
|
|
|
<pie
|
|
|
:class="`echart${edata.length <= 6 ? '' : '_vertical'}`"
|
|
|
unit="㎡"
|
|
|
- @echartClick="(name) => echartClick(name, item.value)"
|
|
|
+ @echartClick="(name) => echartClick(name)"
|
|
|
:ref="`echartRef`"
|
|
|
></pie>
|
|
|
</div>
|
|
@@ -117,6 +117,8 @@ export default {
|
|
|
methods: {
|
|
|
download() {},
|
|
|
resultDeatils(val, mxbsm) {
|
|
|
+ // viewer.entities.removeAll();
|
|
|
+ viewer.dataSources.removeAll();
|
|
|
let obj = {
|
|
|
bsm: this.fxjgObj.bsm,
|
|
|
mxbsm: mxbsm,
|
|
@@ -129,7 +131,6 @@ export default {
|
|
|
QueryGdbhJg({ bsm: this.fxjgObj.bsm }).then((res) => {
|
|
|
let data = [];
|
|
|
if (res.statuscode == 200) {
|
|
|
- console.log(res, ":resresres");
|
|
|
if (res.data.sandiao.mx_data.length) {
|
|
|
res.data.sandiao.mx_data.forEach((el) => {
|
|
|
data.push({
|
|
@@ -155,20 +156,17 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- echartClick(name, { iseyes }) {
|
|
|
- console.log(name, ":name");
|
|
|
- // this.reset();
|
|
|
-
|
|
|
- // this.tableData.forEach((res) => {
|
|
|
- // const keys = Object.keys(res);
|
|
|
- // for (const key of keys) {
|
|
|
- // let value = res[key];
|
|
|
- // if (value == name) {
|
|
|
- // this.addPolygon(res.空间信息.split(";")[1], "all", "#ff0000", true);
|
|
|
- // }
|
|
|
- // }
|
|
|
+ echartClick(name) {
|
|
|
+ this.edata.forEach((res) => {
|
|
|
+ const keys = Object.keys(res);
|
|
|
+ for (const key of keys) {
|
|
|
+ let value = res[key];
|
|
|
+ if (value == name) {
|
|
|
+ this.loadGeoJSON(parse(res.geom), res.itemStyle.color, "all");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- // })
|
|
|
+ })
|
|
|
},
|
|
|
drawWktPloygon(item, itemColor, id) {
|
|
|
// console.log(geometry, "geometry");
|
|
@@ -185,6 +183,7 @@ export default {
|
|
|
},
|
|
|
// 加载GeoJSON数据
|
|
|
loadGeoJSON(geojson, yanse, id, height, name) {
|
|
|
+ viewer.dataSources.removeAll()
|
|
|
let _this = this;
|
|
|
let fcolor =
|
|
|
id && id != "all"
|
|
@@ -223,11 +222,14 @@ export default {
|
|
|
if (id) {
|
|
|
dataSources[id] = data;
|
|
|
}
|
|
|
- if (id == "all") _this.isshowAll = true;
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
mounted() {},
|
|
|
+ beforeDestroy() {
|
|
|
+ viewer.entities.removeAll();
|
|
|
+ viewer.dataSources.removeAll();
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
|