光伏功能逻辑代码及BUG修改
This commit is contained in:
@ -27,7 +27,6 @@
|
||||
currentStation() {
|
||||
return this.vuex_currentStation;
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
currentStation: {
|
||||
|
||||
@ -1,23 +1,30 @@
|
||||
<template>
|
||||
<view class="grid" :style="{'grid-template-columns': `repeat(${col}, 1fr)`}">
|
||||
<view class="item" v-for="(item,index) in list" :key="index">
|
||||
<image v-if="item.showMark" src="/static/aidex/images/history-icon.png" mode="" class="rightMark"></image>
|
||||
<view>
|
||||
<image :src="item.image" mode="" :style="{height:imgHeight,width:imgWidth}"></image>
|
||||
<zero-loading v-if="loading"></zero-loading>
|
||||
<template v-else>
|
||||
<view class="item" v-for="(item,index) in list" :key="index">
|
||||
<image v-if="item.showMark" src="/static/aidex/images/history-icon.png" mode="" class="rightMark"></image>
|
||||
<view>
|
||||
<image :src="item.image" mode="" :style="{height:imgHeight,width:imgWidth}"></image>
|
||||
</view>
|
||||
<view class="num">
|
||||
{{item.value}}
|
||||
</view>
|
||||
<view class="label">
|
||||
{{item.label}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="num">
|
||||
{{item.value}}
|
||||
</view>
|
||||
<view class="label">
|
||||
{{item.label}}
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
loading:{
|
||||
type: Boolean,
|
||||
default:false
|
||||
},
|
||||
list: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
|
||||
@ -21,9 +21,7 @@
|
||||
<view class="item-num">{{ panelData.totalCapacity | kwhFormat }}
|
||||
|
||||
</view>
|
||||
<view class="item-title">{{ this.$t('homePage.home.totalCapacity') }}({{
|
||||
panelData.totalCapacity | kwhUnitFormat
|
||||
}})</view>
|
||||
<view class="item-title">{{ this.$t('homePage.home.totalCapacity') }}({{ panelData.totalCapacity | kwhUnitFormat }})</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="group-item">
|
||||
|
||||
@ -87,8 +87,7 @@
|
||||
<image src="/static/aidex/images/rfdl.png"></image>
|
||||
</view>
|
||||
<view class="item-con">
|
||||
<view class="item-num">{{ panelData.dailyDischargeElec | kwhFormat
|
||||
}}</view>
|
||||
<view class="item-num">{{ panelData.dailyDischargeElec | kwhFormat }}</view>
|
||||
<view class="item-title">{{ this.$t('homePage.home.dailyDischarge') }}({{ panelData.dailyDischargeElec | kwhUnitFormat }})</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="svgBoxss" style="height: 100%;width: 100%;"
|
||||
viewBox="0 0 1280 1680">
|
||||
viewBox="0 0 1280 1680" ref="svgBoxss">
|
||||
|
||||
<path d="M 1092,93L 1080,93L 1080,94L 1092,94Z" style="fill:rgb(0,128,0);" />
|
||||
<path d="M 173,854L 174,853L 174,851L 174.5,848L 175,847L 175,846L 174,843L 168,843L 168,853L 170,854Z"
|
||||
@ -1209,7 +1209,7 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.getElementById('svgBoxss')?.appendChild(this.createSvgText(this.tags))
|
||||
this.$refs.svgBoxss?.appendChild(this.createSvgText(this.tags))
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view>
|
||||
<svg style="width:100%; height:100%;" xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" id="svgBox" viewBox="0 0 1280 1360">
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink" id="svgBox" ref="svgBox" viewBox="0 0 1280 1360">
|
||||
|
||||
<!-- 图片相关,不用管 -->
|
||||
<path
|
||||
@ -562,9 +562,8 @@
|
||||
<!-- <circle cx="573" cy="500" r="16" fill="#58D86B" /> -->
|
||||
<circle class="anim-topright anim-boxele" cx="573" cy="500" r="16" fill="#58D86B" />
|
||||
<!-- 动画元素 -->
|
||||
<circle id="myCircle" cx="280" cy="67" r="15" fill="#0DA17D">
|
||||
<animate attributeName="cx" from="280" to="1000" dur="3000ms" fill="freeze" repeatCount="indefinite" />
|
||||
</circle>
|
||||
<circle class="myCircle" cx="280" cy="67" r="15" fill="#0DA17D"/>
|
||||
|
||||
</svg>
|
||||
</view>
|
||||
|
||||
@ -664,7 +663,7 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
document.getElementById('svgBox')?.appendChild(this.createSvgText(this.tags))
|
||||
this.$refs.svgBox?.appendChild(this.createSvgText(this.tags))
|
||||
},
|
||||
}
|
||||
</script>
|
||||
@ -674,6 +673,24 @@
|
||||
font-family: Arial, sans-serif;
|
||||
font-size: 40px;
|
||||
fill: #7F7F7F;
|
||||
}
|
||||
.myCircle {
|
||||
r: 15;
|
||||
fill: #0DA17D;
|
||||
animation: moveRight 3s linear 0s infinite both;
|
||||
}
|
||||
/* 关键帧:定义运动轨迹(向右→向下→复位) */
|
||||
@keyframes moveRight {
|
||||
/* 0%:初始位置(cx=280, cy=67) */
|
||||
0% {
|
||||
cx: 280;
|
||||
cy: 67;
|
||||
}
|
||||
/* 100%:瞬间复位(避免卡顿) */
|
||||
100% {
|
||||
cx: 1000;
|
||||
cy: 67;
|
||||
}
|
||||
}
|
||||
/* 通用动画点样式 */
|
||||
.anim-pv1 {
|
||||
|
||||
1171
pages/tabbar/components/topology/pv2first.vue
Normal file
1171
pages/tabbar/components/topology/pv2first.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -34,42 +34,29 @@
|
||||
<view class="content-box">
|
||||
<view class="box">
|
||||
<Section :title="$t('homePage.home.stationTopo')" />
|
||||
<cixi v-if="topologyType === 0" ref="tuopu" />
|
||||
<kejiyuan v-else-if="topologyType === 2" ref="tuopu" />
|
||||
<lingchao v-else-if="topologyType === 3" ref="tuopu" />
|
||||
<jingke v-else-if="topologyType === 4" ref="tuopu" />
|
||||
<weishanhu v-else-if="topologyType === 5" ref="tuopu" />
|
||||
<zhongzihuanbao v-else-if="topologyType === 6" ref="tuopu" />
|
||||
<sanmenxia v-else-if="topologyType === 7" ref="tuopu" />
|
||||
<second v-else-if="topologyType === 8" ref="tuopu" />
|
||||
<fire v-else-if="topologyType === 9" ref="tuopu" />
|
||||
<runda100 v-else-if="topologyType === 10" ref="tuopu" />
|
||||
<runda230 v-else-if="topologyType === 11" ref="tuopu" />
|
||||
<runda215 v-else-if="topologyType === 12" ref="tuopu" />
|
||||
<third v-else-if="topologyType === 13" ref="tuopu" />
|
||||
<mdPviese v-else-if="topologyType === 14" ref="tuopu" />
|
||||
<ceshi-t v-else-if="topologyType === 1" />
|
||||
<standard v-else ref="tuopu" />
|
||||
</view>
|
||||
<view class="box">
|
||||
<Section title="测试01" />
|
||||
<view class="marginT20" >
|
||||
<web-view :src="src" :fullscreen="false"></web-view>
|
||||
<view v-if="componentsLoaded">
|
||||
<cixi v-if="topologyType === 0" ref="tuopu" />
|
||||
<kejiyuan v-else-if="topologyType === 2" ref="tuopu" />
|
||||
<lingchao v-else-if="topologyType === 3" ref="tuopu" />
|
||||
<jingke v-else-if="topologyType === 4" ref="tuopu" />
|
||||
<weishanhu v-else-if="topologyType === 5" ref="tuopu" />
|
||||
<zhongzihuanbao v-else-if="topologyType === 6" ref="tuopu" />
|
||||
<sanmenxia v-else-if="topologyType === 7" ref="tuopu" />
|
||||
<second v-else-if="topologyType === 8" ref="tuopu" />
|
||||
<fire v-else-if="topologyType === 9" ref="tuopu" />
|
||||
<runda100 v-else-if="topologyType === 10" ref="tuopu" />
|
||||
<runda230 v-else-if="topologyType === 11" ref="tuopu" />
|
||||
<runda215 v-else-if="topologyType === 12" ref="tuopu" />
|
||||
<third v-else-if="topologyType === 13" ref="tuopu" />
|
||||
<mdPviese v-else-if="topologyType === 14" ref="tuopu" />
|
||||
<pv2first v-else-if="topologyType === 1 && inverterFlag === 1 && pvTopologyType === 2" ref="tuopu" />
|
||||
<standard v-else ref="tuopu" />
|
||||
</view>
|
||||
<!-- 加载中占位(可选) -->
|
||||
<view v-else class="loading-tip">
|
||||
<zero-loading v-if="tuopoloading"></zero-loading>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="box">
|
||||
<Section title="测试02" />
|
||||
<view class="marginT20">
|
||||
<ceshi-l />
|
||||
</view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<Section title="测试03" />
|
||||
当前组件有数据处理示例
|
||||
<view class="marginT20">
|
||||
<ceshi-s />
|
||||
</view>
|
||||
</view> -->
|
||||
<view v-if="topologyType === 9" class="box">
|
||||
<Section :title="$t('homePage.home.deviceMonitor')" />
|
||||
<devicemonitoring ref="deviceFire" />
|
||||
@ -85,7 +72,7 @@
|
||||
<view slot="right" style="flex: 1">
|
||||
<view class="top-right-box">
|
||||
<view class="top-right-item" :class="{ active: activeTime === 'day' }"
|
||||
@click="changeTime('day')">{{this.$t('homePage.home.sevenDay')}}
|
||||
@click="changeTime('day')">{{this.$t('homePage.home.sevenDaycom')}}
|
||||
</view>
|
||||
<view class="top-right-item" :class="{ active: activeTime === 'month' }"
|
||||
@click="changeTime('month')">{{this.$t('homePage.home.monthDay')}}
|
||||
@ -100,15 +87,15 @@
|
||||
</view>
|
||||
|
||||
<view class="box">
|
||||
<Section :title="$t('homePage.home.stationData')" />
|
||||
<Section :title="$t('homePage.home.stationDatacom')" />
|
||||
<wshStationData v-if="topologyType === 5" />
|
||||
<zzhbStationData v-else-if="topologyType === 6" />
|
||||
<commonStationData v-else />
|
||||
</view>
|
||||
<view class="box" v-if="topologyType === 1">
|
||||
<view class="box" v-if="inverterFlag === 1">
|
||||
<Section :title="$t('homePage.home.pvKpi')" />
|
||||
<view class="">
|
||||
<my-grid imgHeight="40rpx" imgWidth="40rpx" :list="lightArr" />
|
||||
<my-grid :loading="loading" :col="language !== 'zh_CN'? 2:3" imgHeight="40rpx" imgWidth="40rpx" :list="lightArr"/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="box" v-if="topologyType === 1">
|
||||
@ -116,12 +103,12 @@
|
||||
<environmentalControlPosition v-if="rightCenter === 'dispositionRightCenter'" />
|
||||
<environmentalControl v-else />
|
||||
</view>
|
||||
<view class="box">
|
||||
<!-- <view class="box" v-if="inverterFlag === 1">
|
||||
<Section :title="$t('homePage.home.socialContribution')" />
|
||||
<view class="">
|
||||
<my-grid :col="3" imgHeight="72rpx" imgWidth="82rpx" :list="society" />
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
@ -138,6 +125,9 @@
|
||||
import ceshiT from './components/topology/ceshiT.vue'
|
||||
import ceshiL from './components/topology/ceshiL.vue'
|
||||
import ceshiS from './components/topology/ceshiS.vue'
|
||||
|
||||
import pv2first from './components/topology/pv2first.vue'
|
||||
|
||||
import weishanhu from './components/topology/weishanhu.vue'
|
||||
import sanmenxia from './components/topology/sanmenxia.vue'
|
||||
import lingchao from './components/topology/lingchao.vue'
|
||||
@ -166,6 +156,7 @@
|
||||
ceshiT,
|
||||
ceshiL,
|
||||
ceshiS,
|
||||
pv2first,
|
||||
myGrid,
|
||||
stationDropdow,
|
||||
Section,
|
||||
@ -212,6 +203,13 @@
|
||||
timer: null,
|
||||
tuopuTimer: null,
|
||||
rightCenter: null,
|
||||
componentsLoaded: false,
|
||||
tuopoloading:false,
|
||||
topCenterPvArr:[
|
||||
{name:'pv1AndStorage_261',value:1},
|
||||
{name:'pv2AndStorage_261',value:2}
|
||||
],
|
||||
pvTopologyType:0,
|
||||
society: [{
|
||||
label: this.$t('homePage.home.saveStandardCoal'),
|
||||
value: '15.00',
|
||||
@ -228,29 +226,14 @@
|
||||
image: require('@/static/aidex/images/ll03.png'),
|
||||
},
|
||||
],
|
||||
lightArr: [{
|
||||
label: this.$t('homePage.home.totalCapacity') + '(kW)',
|
||||
value: '100.00',
|
||||
image: require('@/static/aidex/images/ll05.png'),
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.currentPower') + '(kW)',
|
||||
value: '47.00',
|
||||
image: require('@/static/aidex/images/ll06.png'),
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.dailyPowerGeneration') + '(kWh)',
|
||||
value: '85.00',
|
||||
image: require('@/static/aidex/images/ll07.png'),
|
||||
showMark: true
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.cumulativePowerGeneration') + '(kWh)',
|
||||
value: '496.00',
|
||||
image: require('@/static/aidex/images/ll07.png'),
|
||||
showMark: true
|
||||
},
|
||||
]
|
||||
panelData: {
|
||||
pvCurrentPower: 0, // 对应 lightArr[0].value
|
||||
dailyReleaseElec: 0, // 对应 lightArr[1].value
|
||||
totalReleaseElec: 0, // 对应 lightArr[2].value
|
||||
todayIncone: 0, // 对应 lightArr[3].value
|
||||
totalIncome: 0, // 对应 lightArr[4].value
|
||||
pvPower: 0 // 对应 lightArr[5].value
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -262,7 +245,44 @@
|
||||
},
|
||||
language() {
|
||||
return this.vuex_language
|
||||
}
|
||||
},
|
||||
inverterFlag(){
|
||||
return this.vuex_inverterFlag;
|
||||
},
|
||||
lightArr() {
|
||||
return [
|
||||
{
|
||||
label: this.$t('homePage.home.currentPower') + '(kW)',
|
||||
value: this.panelData.pvCurrentPower,
|
||||
image: require('@/static/aidex/images/ll06.png')
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.dailyPowerGeneration') + '(kWh)',
|
||||
value: this.panelData.dailyReleaseElec,
|
||||
image: require('@/static/aidex/images/ll07.png')
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.cumulativePowerGeneration') + '(kWh)',
|
||||
value: this.panelData.totalReleaseElec,
|
||||
image: require('@/static/aidex/images/ll07.png')
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.todayEarning'),
|
||||
value: this.panelData.todayIncone,
|
||||
image: require('@/static/aidex/images/yxts.png')
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.totalRevenue'),
|
||||
value: this.panelData.totalIncome,
|
||||
image: require('@/static/aidex/images/yxts.png')
|
||||
},
|
||||
{
|
||||
label: this.$t('homePage.home.ratedPower'),
|
||||
value: this.panelData.pvPower,
|
||||
image: require('@/static/aidex/images/ll06.png')
|
||||
}
|
||||
];
|
||||
}
|
||||
},
|
||||
onHide() {
|
||||
if (this.timer) {
|
||||
@ -274,29 +294,30 @@
|
||||
},
|
||||
watch: {
|
||||
currentStation: {
|
||||
handler(val) {
|
||||
if (val && val.id) {
|
||||
|
||||
this.stationId = val.id
|
||||
this.userId = this.userData.userId
|
||||
console.log('拓扑图',val)
|
||||
this.topologyType = val.topologyType
|
||||
this.getComponents()
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tuopu) {
|
||||
this.$refs.tuopu.getData(val.id)
|
||||
}
|
||||
|
||||
if (this.$refs.deviceFire) {
|
||||
this.$refs.deviceFire.getData(this.stationId)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
|
||||
handler(val) {
|
||||
if (val && val.id) {
|
||||
this.stationId = val.id
|
||||
this.userId = this.userData.userId
|
||||
this.topologyType = val.topologyType
|
||||
// 重置加载状态,避免复用旧状态
|
||||
this.componentsLoaded = false
|
||||
this.tuopoloading = true
|
||||
this.getComponents().then(() => {
|
||||
this.GetPcsTotalData();
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tuopu) {
|
||||
this.$refs.tuopu.getData(val.id)
|
||||
}
|
||||
if (this.$refs.deviceFire) {
|
||||
this.$refs.deviceFire.getData(this.stationId)
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@ -317,25 +338,27 @@
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
this.getComponents()
|
||||
this.getMessage()
|
||||
if (this.$refs.runChart && this.stationId) {
|
||||
this.$refs.runChart.getData()
|
||||
}
|
||||
if (this.$refs.dischargeChart && this.stationId) {
|
||||
this.$refs.dischargeChart.getData()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
|
||||
if (this.$refs.tuopu) {
|
||||
// 重置加载状态
|
||||
this.componentsLoaded = false
|
||||
this.tuopoloading = true
|
||||
this.getComponents().then(() => {
|
||||
this.getMessage()
|
||||
if (this.$refs.runChart && this.stationId) {
|
||||
this.$refs.runChart.getData()
|
||||
}
|
||||
if (this.$refs.dischargeChart && this.stationId) {
|
||||
this.$refs.dischargeChart.getData()
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tuopu) {
|
||||
this.$refs.tuopu.changeEnglish()
|
||||
this.$refs.tuopu.getData(this.stationId)
|
||||
}
|
||||
|
||||
if (this.$refs.deviceFire) {
|
||||
}
|
||||
if (this.$refs.deviceFire) {
|
||||
this.$refs.deviceFire.getData(this.stationId)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
this.timer = setInterval(() => {
|
||||
this.getMessage()
|
||||
}, 5000)
|
||||
@ -352,13 +375,39 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
async GetPcsTotalData() {
|
||||
let self = this;
|
||||
return new Promise((resolve, reject) => {
|
||||
self.$u.api.homePageData
|
||||
.GetPcsTotalData({
|
||||
stationId: this.stationId,
|
||||
})
|
||||
.then((res) => {
|
||||
this.panelData = Object.assign(this.panelData, res.data);
|
||||
resolve(res);
|
||||
})
|
||||
.catch((err) => {
|
||||
reject("错误");
|
||||
});
|
||||
});
|
||||
},
|
||||
async getComponents() {
|
||||
const {
|
||||
data
|
||||
} = await this.$u.api.homePageData.GetHomePageComponents(this.stationId)
|
||||
if (data && data.length > 0) {
|
||||
this.rightCenter = data[0]?.rightCenter
|
||||
}
|
||||
try {
|
||||
const { data } = await this.$u.api.homePageData.GetHomePageComponents(this.stationId);
|
||||
if (data && data.length > 0) {
|
||||
this.rightCenter = data[0]?.rightCenter;
|
||||
const matchedItem = this.topCenterPvArr.find(item => item.name === data[0]?.topCenter);
|
||||
this.pvTopologyType = matchedItem ? matchedItem.value : this.pvTopologyType;
|
||||
}
|
||||
// 接口完成,标记加载状态为true
|
||||
this.componentsLoaded = true
|
||||
this.tuopoloading = false
|
||||
} catch (e) {
|
||||
console.error('获取组件配置失败:', e);
|
||||
// 即使接口失败,也标记完成,避免组件一直不渲染
|
||||
this.componentsLoaded = true
|
||||
this.tuopoloading = false
|
||||
}
|
||||
},
|
||||
openTimer() {
|
||||
|
||||
@ -524,7 +573,12 @@
|
||||
margin: 20rpx;
|
||||
margin-top: 30rpx;
|
||||
box-shadow: 0px 4rpx 16rpx rgba(0, 0, 0, 0.08);
|
||||
|
||||
|
||||
.loading-tip {
|
||||
width: 650rpx;
|
||||
height: 710rpx;
|
||||
position: relative;
|
||||
}
|
||||
.top-right-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
Reference in New Issue
Block a user