Merge pull request #1212 from dataease/pr@dev@refactor_panel-loading

refactor:仪表板刷新时,不显示视图的动画效果;仪表板初始化时显示loading框
This commit is contained in:
王嘉豪 2021-11-16 15:07:09 +08:00 committed by GitHub
commit 29b8628c7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 15 deletions

View File

@ -1,6 +1,6 @@
<template>
<div
v-loading="canvasStyleData.refreshViewLoading&&requestStatus==='waiting'"
v-loading="loadingFlag"
:class="[
{
['active']: active
@ -16,8 +16,8 @@
{{ $t('chart.chart_error_tips') }}
</div>
</div>
<chart-component v-if="httpRequest.status &&chart.type && !chart.type.includes('table') && !chart.type.includes('text') && renderComponent() === 'echarts'" :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" @onChartClick="chartClick" @onJumpClick="jumpClick" />
<chart-component-g2 v-if="httpRequest.status &&chart.type && !chart.type.includes('table') && !chart.type.includes('text') && renderComponent() === 'antv'" :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" @onChartClick="chartClick" @onJumpClick="jumpClick" />
<chart-component v-if="httpRequest.status &&chart.type && !chart.type.includes('table') && !chart.type.includes('text') && renderComponent() === 'echarts'" :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" :search-count="searchCount" @onChartClick="chartClick" @onJumpClick="jumpClick" />
<chart-component-g2 v-if="httpRequest.status &&chart.type && !chart.type.includes('table') && !chart.type.includes('text') && renderComponent() === 'antv'" :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" :search-count="searchCount" @onChartClick="chartClick" @onJumpClick="jumpClick" />
<!-- <chart-component :ref="element.propValue.id" class="chart-class" :chart="chart" :track-menu="trackMenu" @onChartClick="chartClick" />-->
<table-normal v-if="httpRequest.status &&chart.type && chart.type.includes('table')" :ref="element.propValue.id" :show-summary="chart.type === 'table-normal'" :chart="chart" class="table-class" />
<label-normal v-if="httpRequest.status && chart.type && chart.type.includes('text')" :ref="element.propValue.id" :chart="chart" class="table-class" />
@ -54,11 +54,6 @@ export default {
type: Object,
default: null
},
// filters: {
// type: Array,
// required: false,
// default: null
// },
outStyle: {
type: Object,
required: false,
@ -100,6 +95,9 @@ export default {
}
},
computed: {
loadingFlag() {
return (this.canvasStyleData.refreshViewLoading || this.searchCount === 0) && this.requestStatus === 'waiting'
},
panelInfo() {
return this.$store.state.panel.panelInfo
},
@ -167,9 +165,6 @@ export default {
handler(newVal, oldVal) {
// isChange(newVal, oldVal) && this.getData(this.element.propValue.viewId)
if (isChange(newVal, oldVal)) {
// if (this.chart.type === 'map') {
// this.doMapLink(newVal)
// }
this.getData(this.element.propValue.viewId)
}
},
@ -202,10 +197,6 @@ export default {
//
outStyle: {
handler(newVal, oldVla) {
//
// if (this.$refs[this.element.propValue.id]) {
// this.$refs[this.element.propValue.id].chartResize()
// }
},
deep: true
},

View File

@ -55,6 +55,11 @@ export default {
default: function() {
return ['drill']
}
},
searchCount: {
type: Number,
required: false,
default: 0
}
},
data() {
@ -156,6 +161,9 @@ export default {
chart_option = baseMixOption(JSON.parse(JSON.stringify(BASE_MIX)), chart)
}
// console.log(JSON.stringify(chart_option))
if (this.myChart && this.searchCount > 0) {
chart_option.animation = false
}
if (chart.type === 'map') {
const customAttr = JSON.parse(chart.customAttr)

View File

@ -46,6 +46,11 @@ export default {
default: function() {
return ['drill']
}
},
searchCount: {
type: Number,
required: false,
default: 0
}
},
data() {
@ -171,6 +176,10 @@ export default {
}
}
if (this.myChart && this.searchCount > 0) {
this.myChart.options.animation = false
}
if (this.antVRenderStatus) {
this.myChart.render()
}