数据接受统计弹窗在等待接口数据的时候,弹窗内增加 loading...

This commit is contained in:
renpy 2023-08-29 16:32:39 +08:00
parent cf40e88018
commit 14eb95081c
2 changed files with 12 additions and 3 deletions

View File

@ -233,7 +233,7 @@
<!-- 右侧图表展示栏 --> <!-- 右侧图表展示栏 -->
<div class="data-receive-status-chart" :class="{ 'on-screen': !leftPaneShow }"> <div class="data-receive-status-chart" :class="{ 'on-screen': !leftPaneShow }">
<template v-if="showChart"> <template v-if="showChart">
<RealTimeDataChart ref="realtimeChartRef" :list="statusList" :scale-settings="initialDataRecieveSettings" /> <RealTimeDataChart ref="realtimeChartRef" :spinning="spinLoading" :list="statusList" :scale-settings="initialDataRecieveSettings" />
<resize-observer @notify="handleResize" /> <resize-observer @notify="handleResize" />
</template> </template>
</div> </div>
@ -419,7 +419,8 @@ export default {
markerList: [], // marker markerList: [], // marker
showPane: true showPane: true,
spinLoading: false
} }
}, },
created() { created() {
@ -720,6 +721,7 @@ export default {
// //
async getDataRecieveStatusList() { async getDataRecieveStatusList() {
this.spinLoading = true
try { try {
this.isGettingStatusList = true this.isGettingStatusList = true
const { success, result, message } = await getAction( const { success, result, message } = await getAction(
@ -728,6 +730,7 @@ export default {
userId: this.$store.getters.userInfo.id userId: this.$store.getters.userInfo.id
} }
) )
this.spinLoading = false
if (success) { if (success) {
const statusList = [] const statusList = []
result.forEach(item => { result.forEach(item => {
@ -746,6 +749,7 @@ export default {
this.$message.error(message) this.$message.error(message)
} }
} catch (error) { } catch (error) {
this.spinLoading = false
console.error(error) console.error(error)
} finally { } finally {
this.isGettingStatusList = false this.isGettingStatusList = false

View File

@ -14,7 +14,9 @@
</div> </div>
</div> </div>
<!-- 图例结束 --> <!-- 图例结束 -->
<custom-chart ref="customChartRef" :option="option" :height="list.length * 295"></custom-chart> <a-spin :spinning="spinning">
<custom-chart ref="customChartRef" :option="option" :height="list.length * 295"></custom-chart>
</a-spin>
</div> </div>
</template> </template>
@ -79,6 +81,9 @@ export default {
title: { title: {
type: String type: String
}, },
spinning: {
type: Boolean
},
list: { list: {
type: Array, type: Array,
default: () => [] default: () => []