update code

main
lijun 2024-11-23 18:57:14 +08:00
parent 0f4c38e89f
commit 1cf7f37fe2
1 changed files with 19 additions and 40 deletions

View File

@ -171,8 +171,7 @@
<div :style="'background-image:url('+mapInfo.url+')'" class="map-image">
<el-popover v-for="(it,idx) in mapInfo.regions" popper-class="power-pop"
placement="top-start"
:title="it.regionName"
:title="it.regionName"
trigger="click"
>
<div class="pop-body">
@ -394,26 +393,7 @@
{
projectId: 1912,
url: './power/prj3.png',
regions: [
{
"regionId": 1,
"regionName": "区域1",
x:400,
y:300
},
{
"regionId": 2,
"regionName": "区域1245",
x:470,
y:490
},
{
"regionId": 3,
"regionName": "区域2",
x:770,
y:160
}
]
regions: []
}
]
</script>
@ -513,6 +493,13 @@
let url = '/api/device/smart_meter/region_information';
this.post(url, { projectId: projectId }).then(d => {
this.regions = d.data?.data || [];
this.mapInfo.regions=this.regions.map(it=>{
it.data=null;
it.CurrentType='';
it.dailyElectricity='加载中...';
it.load='';
return it;
})
this.regionElKey++;
});
},
@ -544,7 +531,6 @@
this.loadAreaEleTrendSel();
this.loadWarningCount();
this.loadWarningList();
//this.loadMapInfo();
setTimeout(this.init, 10000)
},
getDates(n) {
@ -836,17 +822,7 @@
this.block1.MonthAvgDailyElectricity = (data.MonthAvgDailyElectricity || 0).toFixed(2)
this.block1.YearAvgDailyElectricity = (data.YearAvgDailyElectricity || 0).toFixed(2)
});
},
loadMapInfo(){
let url="/api/device/smart_meter/region_electricity_information";
let postData={
projectId:projectId,
regionId:1
};
this.post(url,postData).then(d=>{
});
},
},
getRegionMapInfo(it){
let url="/api/device/smart_meter/region_electricity_information";
let postData={
@ -855,12 +831,15 @@
};
it.dailyElectricity="加载中..."
this.post(url,postData).then(d=>{
let data=d.data?.data||{};
it.CurrentType=data.CurrentType||'';
it.dailyElectricity=data.dailyElectricity||'';
it.load=data.load||'';
it.data=d.data?.data||null;
if(it.data==null){
let datas=d.data?.data||[];
if(datas.length>0){
let data=datas[0];
it.CurrentType=data.CurrentType||'';
it.dailyElectricity=data.dailyElectricity||'';
it.load=data.load||'';
it.data=data
}else{
it.data=null;
it.dailyElectricity="暂无数据"
}
});