邓洁: echarts的loading

This commit is contained in:
邓洁
2024-01-03 14:50:59 +08:00
parent 073ec5c570
commit 2d1d42f83a
6 changed files with 88 additions and 14 deletions

View File

@@ -77,7 +77,11 @@
:modal="false">
<div class="left-top-icon"></div>
<div class="right-top-icon"></div>
<div class="chat-dialog">
<div class="loading-block" v-if="showLoading">
<div class="loading" ></div>
<span>加载中...</span>
</div>
<div class="chat-dialog" v-else>
<div id="containerFan"></div>
<div style="width: 1px;"></div>
</div>
@@ -114,6 +118,7 @@ const stateA = ref(false)
const stateB = ref(false)
const stateC = ref(false)
const isVisited = ref(false)
const showLoading = ref(false)
const fanIndex = ref(0)
let myEcharts = reactive({});
@@ -151,9 +156,11 @@ watch(() => props.list, (now) => {
handleOnMounted()
}, {deep: true});
const getFanInfo = (equipmentId) => {
isVisited.value = true
showLoading.value=true
getFanEchartsInfo(equipmentId).then(res => {
if (res?.code === 1000) {
isVisited.value = true
showLoading.value=false
nextTick(() => {
initChart(res.data.dates, res.data.currentsA,res.data.currentsB,res.data.currentsC)
})
@@ -161,6 +168,7 @@ const getFanInfo = (equipmentId) => {
})
}
const handleOpenChart = (item,index) => {
getFanInfo(item.equipmentId)
fanIndex.value=index+1
}