邓洁: echarts的loading
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user