邓洁: 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

@@ -13,7 +13,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="container"></div>
<div style="width: 1px;"></div>
</div>
@@ -45,9 +49,9 @@ const windSort = ref(1)
const timeList = ref(["年", "月", "日"]);
const selectTimeButton = ref(2);
const isVisited = ref(false);
const showLoading = ref(false)
let myEcharts = reactive({});
const wpList = ref([]);
const chartData = ref()
watch(() => props.list, (now) => {
wpList.value.forEach(item => {
now.forEach(newItem => {
@@ -63,9 +67,11 @@ watch(() => props.winData, (now) => {
}, {deep: true});
const getWindInfo = (equipmentId) => {
isVisited.value = true
showLoading.value=true
getEchartsInfo(equipmentId).then(res => {
if (res?.code === 1000) {
isVisited.value = true
showLoading.value=false
nextTick(() => {
initChart(res.data.dates, res.data.values)
})