站点地图、单站监控-实时运行部分接口联调

This commit is contained in:
白菜
2025-06-20 13:53:36 +08:00
parent c19d829a87
commit 51a479923e
3 changed files with 28 additions and 41 deletions

View File

@ -47,6 +47,7 @@ export default {
return {
singleSiteId:'',
singleSiteName:'',
singleSiteLocation:[],
// 单个电站 四个方块数据
singleZdSqaure:[
{
@ -76,7 +77,7 @@ export default {
singleZdInfo:[{
title:'电站位置',
value:'',
attr:'siteLocation'
attr:'siteAddress'
},{
title:'投运时间',
value:'',
@ -101,13 +102,16 @@ export default {
console.log('单个站点详情数据',response)
const res = response.data || {}
this.singleSiteName = res?.siteName || ''//站点名称
this.singleSiteLocation = res?.siteLocation || []//站点坐标
this.singleZdSqaure.forEach(item=>{
item.value =( res[item.attr] || res[item.attr] == 0 ) ? res[item.attr] : '-'
})
this.singleZdInfo.forEach(item=>{
item.value = ( res[item.attr] || res[item.attr] == 0 ) ? res[item.attr] : '-'
})
this.$refs.barChart.setOption(res?.sevenDayDischargeStats || [])
this.$refs.barChart.setOption(res?.sevenDayDisChargeStats || [])
this.$refs.mapChart.setOption([{name:this.singleSiteName,value:this.singleSiteLocation}])
})
},
//跳转单站监控页面
@ -120,14 +124,6 @@ export default {
})
}
},
mounted() {
//todo 在获取到数据后更新chart
// 电站名称,坐标,样式
this.$nextTick(()=>{
console.log('this.$refs.mapChart',this.$refs)
this.$refs.mapChart.setOption([{name:'电站一',value:[121.627049,31.444993]}])
})
}
}
</script>