CN-128 perf: 优化图表加载动画

This commit is contained in:
chenjinsong
2021-09-07 15:24:57 +08:00
parent 3c47b8d613
commit 36a1f08963
2 changed files with 2 additions and 8 deletions

View File

@@ -15,7 +15,7 @@
<div class="cn-chart__body chart__loading" v-show="loading">
<i class="el-icon-loading"></i>
</div>
<div class="cn-chart__footer" v-if="layout.indexOf(layoutConstant.FOOTER) > -1 && !noData" :class="{'pie-with-table': isPieWithTable}" v-loading="loading">
<div class="cn-chart__footer" v-if="layout.indexOf(layoutConstant.FOOTER) > -1 && !noData" :class="{'pie-with-table': isPieWithTable}" v-show="!loading">
<slot name="footer"></slot>
</div>
</div>

View File

@@ -1,6 +1,5 @@
<template>
<el-table
v-loading="loading"
ref="table"
class="pie-table"
:data="pieTableData"
@@ -21,7 +20,6 @@
style="width: 100%;"
:show-header="false"
:size="'mini'"
v-loading="subLoading"
:height="'100%'">
<el-table-column
width="48">
@@ -111,7 +109,6 @@ export default {
},
data () {
return {
loading: false,
nameColumn: '',
pieTableData: [],
childrenTableData: [],
@@ -169,13 +166,11 @@ export default {
prop: 'bytes',
width: '18%'
}
],
subLoading: true
]
}
},
methods: {
currentChange (row, expandedRows) {
this.subLoading = true
this.childrenTableData = []
if (this.expandRowKeys[0] && (row.domain === this.expandRowKeys[0])) {
this.expandRowKeys = []
@@ -196,7 +191,6 @@ export default {
this.childrenTableData = response2.data.result
}
}).finally(() => {
this.subLoading = false
})
}, 500)
},