提交 39ca1364 编写于 作者: KK's avatar KK

地图逻辑调整

上级 5d945402
...@@ -144,7 +144,7 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -144,7 +144,7 @@ import { Http } from "@/ibiz-core/utils";
this.items = []; this.items = [];
this.items = response.data; this.items = response.data;
this.series.forEach((temp:any) => { this.series.forEach((temp:any) => {
temp.data = this.convertDat(this,temp.name); temp.data = this.convertDat(temp.name);
}); });
this.setOptions(); this.setOptions();
return response; return response;
...@@ -202,7 +202,8 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -202,7 +202,8 @@ import { Http } from "@/ibiz-core/utils";
longitude:'<#if mapitem.getLongitudePSAppDEField?? && mapitem.getLongitudePSAppDEField()??>${mapitem.getLongitudePSAppDEField().getCodeName()?lower_case}</#if>', longitude:'<#if mapitem.getLongitudePSAppDEField?? && mapitem.getLongitudePSAppDEField()??>${mapitem.getLongitudePSAppDEField().getCodeName()?lower_case}</#if>',
text:'<#if mapitem.getTextPSAppDEField?? && mapitem.getTextPSAppDEField()??>${mapitem.getTextPSAppDEField().getCodeName()?lower_case}</#if>', text:'<#if mapitem.getTextPSAppDEField?? && mapitem.getTextPSAppDEField()??>${mapitem.getTextPSAppDEField().getCodeName()?lower_case}</#if>',
tips:'<#if mapitem.getTipsPSAppDEField?? && mapitem.getTipsPSAppDEField()??>${mapitem.getTipsPSAppDEField().getCodeName()?lower_case}</#if>', tips:'<#if mapitem.getTipsPSAppDEField?? && mapitem.getTipsPSAppDEField()??>${mapitem.getTipsPSAppDEField().getCodeName()?lower_case}</#if>',
}, code:'${mapitem_index}'
}<#if mapitem_has_next>,</#if>
</#list> </#list>
</#if> </#if>
} }
...@@ -221,6 +222,9 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -221,6 +222,9 @@ import { Http } from "@/ibiz-core/utils";
{ {
label:'<#if mapitem.getName?? && mapitem.getName()??>${mapitem.getName()}</#if>', label:'<#if mapitem.getName?? && mapitem.getName()??>${mapitem.getName()}</#if>',
color:'<#if mapitem.getColor?? && mapitem.getColor()??>${mapitem.getColor()}</#if>', color:'<#if mapitem.getColor?? && mapitem.getColor()??>${mapitem.getColor()}</#if>',
dimension:4,
min:${mapitem_index},
max:${mapitem_index},
}<#if mapitem_has_next>,</#if> }<#if mapitem_has_next>,</#if>
</#list> </#list>
</#if> </#if>
...@@ -339,21 +343,21 @@ import { Http } from "@/ibiz-core/utils"; ...@@ -339,21 +343,21 @@ import { Http } from "@/ibiz-core/utils";
} }
// 定位数据位置 // 定位数据位置
public convertDat (_this:any,tag:any) { public convertDat (tag:any) {
if( !this.geoCoordMap){ if( !this.geoCoordMap){
return [] return []
} }
let res:any = [] let res:any = []
let mapItemModel = _this.mapItems[tag]; let mapItemModel = this.mapItems[tag];
let mapItemData :any= _this.items[tag]; let mapItemData :any= this.items[tag];
mapItemData.forEach((item:any) => { mapItemData.forEach((item:any) => {
let latitude = item[mapItemModel.latitude]; let latitude = item[mapItemModel.latitude];
let longitude = item[mapItemModel.longitude]; let longitude = item[mapItemModel.longitude];
let geoCoord:number = _this.geoCoordMap.findIndex((temp:any)=>{return temp.latitude == latitude && temp.longitude == longitude}); let geoCoord:number = this.geoCoordMap.findIndex((temp:any)=>{return temp.latitude == latitude && temp.longitude == longitude});
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) value: [latitude,longitude].concat(mapItemData.filter((temp:any)=>{return temp[mapItemModel.latitude] == latitude && temp[mapItemModel.longitude]==longitude }).length,mapItemModel.code)
}); });
} }
}); });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册