fix : 修复数据loading加载

This commit is contained in:
2024-03-05 21:47:53 +08:00
parent c242691a65
commit 204d687336
8 changed files with 109 additions and 47 deletions

View File

@@ -1,6 +1,10 @@
<template>
<div id="used-ele" :style="{ backgroundColor: bgImage }" @click="handleOpenChart">
<div class="content">
<div v-if="electricityConsumptionMonthly===0||monthlySavings===0" class="showNull ">
<div class="loading" v-if="loading===0"></div>
{{ loading === 0 ? '加载中...' : '暂无数据~' }}
</div>
<div v-else class="content">
<div class="item">
<div class="container" ref="length">
<div class="value" ref="valueA"></div>
@@ -23,6 +27,7 @@
<div class="ele-right-bottom-icon"></div>
</div>
</div>
<div class="digital-tunnel">
<el-dialog :close-on-click-modal="false" v-model="isVisited" width="2175px" :modal="false">
<div class="left-top-icon"></div>
@@ -88,7 +93,8 @@ import {getEleEchartsInfo} from "@/api/largeScreen";
const props = defineProps({
list: Array,
eleData: Array
eleData: Array,
loading: Number
});
const loadingText = ref('加载中...')
@@ -114,6 +120,9 @@ const bgImage = computed(() =>
? "#2E5589"
: "rgba(6,34,71,0.78)"
);
watch(() => props.loading, (now) => {
props.loading = now
}, {deep: true});
watch(() => props.eleData, (now) => {
if (now) {
let fanObj = {}
@@ -128,8 +137,10 @@ watch(() => props.eleData, (now) => {
})
getBasicData(now.largeScreenElectricity)
}
setValueA()
setValueB()
nextTick(() => {
setValueA()
setValueB()
})
}, {deep: true});
// watch(() => props.list, (now) => {
// console.log(now,props.eleData,'大V大V')