增加加载状态

main
Lufaneng 8 months ago
parent fc09028b21
commit a659ba0f65

@ -20,7 +20,7 @@
<!-- 左侧电力参数区域 -->
<div class="power-section">
<!-- ABC三相电力参数 -->
<div class="power-params">
<div class="power-params" v-loading="phaseLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<div v-for="phase in powerPhases" :key="phase.name" class="phase-card">
<div class="phase-name"><span>{{ phase.name }}</span></div>
<div class="param-list">
@ -68,7 +68,7 @@
</div>
<!-- 回路控制区域 -->
<div class="circuit-section">
<div class="circuit-section" v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<!-- 上排回路 -->
<div class="circuit-row">
<div v-for="(circuit, index) in info.loops.slice(0, 5)" :key="circuit.name" class="circuit-item">
@ -99,7 +99,7 @@
</div>
<!-- 调光通道区域 -->
<div class="dimming-section">
<div class="dimming-section" v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<!-- 上排调光通道 -->
<div class="dimming-row">
<div v-for="(channel, index) in info.loops.slice(0, 5)" :key="channel.name" class="dimming-item">
@ -123,7 +123,7 @@
</div>
<!-- 右侧控制面板 -->
<div class="control-panel">
<div class="control-panel" v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<!-- 切换模式 -->
<div class="control-group">
<div class="control-title">
@ -251,7 +251,7 @@ const setDeviceTime = () => {
const week = ref('')
const weekDays = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'];
const phaseLoading = ref(true)
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage + 'V'
powerPhases.value[0].current = res.aElectricCurrent + 'A'
@ -271,6 +271,8 @@ RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
energyParams.value.activeEnergy = res.activeEnergy + 'kW·h'
energyParams.value.activePower = res.activePower + 'kW'
energyParams.value.powerFactor = res.powerFactor
}).finally(() => {
phaseLoading.value = false
})
//
@ -404,7 +406,9 @@ const info = ref({
})
const isSync = ref(true)
const infoLoading = ref(false)
const getInfo = () => {
infoLoading.value = true
isSync.value = true
RPC.post('/m9z/getDeviceManualInfo', { comm_uid: commit_uid }).then(res => {
info.value = res
@ -413,12 +417,14 @@ const getInfo = () => {
}, 1000);
}).finally(() => {
isInitData.value = false
infoLoading.value = false
})
}
getInfo()
const refresh = () => {
getInfo()
phaseLoading.value = true
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage + 'V'
powerPhases.value[0].current = res.aElectricCurrent + 'A'
@ -438,6 +444,8 @@ const refresh = () => {
energyParams.value.activeEnergy = res.activeEnergy + 'kW·h'
energyParams.value.activePower = res.activePower + 'kW'
energyParams.value.powerFactor = res.powerFactor
}).finally(() => {
phaseLoading.value = false
})
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''

@ -20,7 +20,7 @@
<!-- 左侧电力参数区域 -->
<div class="power-section">
<!-- ABC三相电力参数 -->
<div class="power-params">
<div class="power-params" v-loading="phaseLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<div v-for="phase in powerPhases" :key="phase.name" class="phase-card">
<div class="phase-name"><span>{{ phase.name }}</span></div>
<div class="param-list">
@ -76,6 +76,7 @@
<el-button class="mode-button active">{{ info.Mode ? '手动' : '自动' }}</el-button>
</div>
</div>
<div v-loading="infoLoading" element-loading-background="rgba(122, 122, 122, 0.8)">
<div class="circuit-section">
<!-- 上排回路 -->
<div class="circuit-row">
@ -144,6 +145,7 @@
</div>
</div>
</div>
</div>
<div class="chartBox">
<div class="search">
<el-date-picker value-format="YYYY-MM-DD" v-model="recdDate" type="date" placeholder="请选择时间" />
@ -423,10 +425,14 @@ const info = ref({
"backup_byte4": 0
})
const infoLoading = ref(false)
const phaseLoading = ref(false)
const getInfo = () => {
// RPC.post('/m9z/getDeviceManualInfo', { comm_uid: commit_uid }).then(res => {
// info.value = res
// })
infoLoading.value = true
phaseLoading.value = true
RPC.post('/adl400/readPhaseData', { comm_uid: commit_uid }).then(res => {
powerPhases.value[0].voltage = res.aVoltage + 'V'
powerPhases.value[0].current = res.aElectricCurrent + 'A'
@ -446,12 +452,16 @@ const getInfo = () => {
energyParams.value.activeEnergy = res.activeEnergy + 'kW·h'
energyParams.value.activePower = res.activePower + 'kW'
energyParams.value.powerFactor = res.powerFactor
}).finally(() => {
phaseLoading.value = false
})
RPC.post('/m9z/getDeviceStatus2', { comm_uid: commit_uid }).then((res) => {
//
if (res.Loops?.length === 10) {
info.value = res
}
}).finally(() => {
infoLoading.value = false
})
getLineData()

Loading…
Cancel
Save