提交 148cc27b 编写于 作者: KK's avatar KK

地图逻辑调整

上级 39ca1364
...@@ -191,7 +191,7 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -191,7 +191,7 @@ import { Http } from "@/ibiz-core/utils";
* @type {} * @type {}
* @memberof ${srfclassname('${ctrl.name}')}Base * @memberof ${srfclassname('${ctrl.name}')}Base
*/ */
public mapItems = { public mapItems:any = {
<#if ctrl.getPSSysMapItems?? && ctrl.getPSSysMapItems()??> <#if ctrl.getPSSysMapItems?? && ctrl.getPSSysMapItems()??>
<#list ctrl.getPSSysMapItems() as mapitem> <#list ctrl.getPSSysMapItems() as mapitem>
'${mapitem.getName()}':{ '${mapitem.getName()}':{
...@@ -300,6 +300,13 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -300,6 +300,13 @@ import { Http } from "@/ibiz-core/utils";
* mounted * mounted
*/ */
public mounted() { public mounted() {
this.afterMounted();
}
/**
* afterMounted
*/
public afterMounted(){
Object.assign(this.option, { tooltip: this.tooltip }, { visualMap: this.visualMap }, { geo: this.geo }, { series: this.series }) Object.assign(this.option, { tooltip: this.tooltip }, { visualMap: this.visualMap }, { geo: this.geo }, { series: this.series })
let element: any = document.getElementById(this.mapId); let element: any = document.getElementById(this.mapId);
this.map = echarts.init(element); this.map = echarts.init(element);
...@@ -313,6 +320,7 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -313,6 +320,7 @@ import { Http } from "@/ibiz-core/utils";
if(!this.map){ if(!this.map){
return return
} }
console.log(this.option);
this.map.setOption(this.option); this.map.setOption(this.option);
} }
...@@ -357,7 +365,7 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -357,7 +365,7 @@ import { Http } from "@/ibiz-core/utils";
if (geoCoord > -1) { if (geoCoord > -1) {
res.push({ res.push({
name: this.geoCoordMap[geoCoord].name, name: this.geoCoordMap[geoCoord].name,
value: [latitude,longitude].concat(mapItemData.filter((temp:any)=>{return temp[mapItemModel.latitude] == latitude && temp[mapItemModel.longitude]==longitude }).length,mapItemModel.code) value: [longitude,latitude].concat(mapItemData.filter((temp:any)=>{return temp[mapItemModel.latitude] == latitude && temp[mapItemModel.longitude]==longitude }).length,mapItemModel.code)
}); });
} }
}); });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册