CN-240 feat: 实体列表loading优化

This commit is contained in:
chenjinsong
2022-01-06 16:28:16 +08:00
parent 332509d41f
commit 35c3552605
3 changed files with 9 additions and 21 deletions

View File

@@ -1139,7 +1139,6 @@ export default {
}
})
console.info(this.entity)
this.showMapBackButton = !!country
const chartParams = this.chartInfo.params
const queryParams = { ...this.queryTimeRange, country: country || '', region: '', ...this.entity } // 统计数据的查询参数
@@ -2517,8 +2516,6 @@ export default {
}
},
mounted () {
console.info(this.chart)
console.info(this.entity)
this.initChart()
this.throttle = this.$_.throttle(this.echartsResize, 500)
window.addEventListener('resize', this.throttle)

View File

@@ -526,10 +526,7 @@ export default {
})
},
queryList (params) {
this.timeout = setTimeout(() => {
this.listLoading = true
}, 500)
this.listData = []
const queryParams = {
...params,
startTime: parseInt(params.startTime / 1000),
@@ -537,10 +534,12 @@ export default {
}
get(api.entityList, queryParams).then(response => {
if (response.code === 200) {
this.listData = []
this.$nextTick(() => {
this.listData = response.data.result
})
}
}).finally(() => {
clearTimeout(this.timeout)
this.listLoading = false
})
},

View File

@@ -1,6 +1,6 @@
<template>
<div class="entity-list" id="entityList">
<div class="entity__loading" v-show="loading">
<div class="entity__loading" style="background: #eff2f5;opacity: .6;" v-show="loading">
<i class="el-icon-loading"></i>
</div>
<div class="entity-list__content">
@@ -40,14 +40,6 @@
<script>
import Card from '@/views/entityExplorer/entityList/Card'
import Row from '@/views/entityExplorer/entityList/Row'
import pagination from '@/components/common/Pagination'
import { get } from '@/utils/http'
import { api } from '@/utils/api'
import * as echarts from 'echarts'
import { getChartColor, entityListLineOption } from '@/components/charts/chart-options'
import { legendMapping } from '@/components/charts/chart-table-title'
import unitConvert from '@/utils/unit-convert'
import { unitTypes } from '@/utils/constants'
export default {
name: 'EntityList',
@@ -61,8 +53,7 @@ export default {
},
components: {
'entity-card': Card,
'entity-row': Row,
pagination: pagination
'entity-row': Row
},
data () {
return {
@@ -71,7 +62,8 @@ export default {
entityList: [],
isCollapse: true,
collapseIndex: 0,
tableId: 'entityList'
tableId: 'entityList',
listDataCopy: []
}
},
methods: {