提交 fcb5d1ce authored 作者: wangjiahao's avatar wangjiahao

refactor:仪表板刷新时,不显示视图的动画效果;仪表板初始化时显示loading框

上级 a2b319cd
<template> <template>
<div <div
v-loading="canvasStyleData.refreshViewLoading&&requestStatus==='waiting'" v-loading="loadingFlag"
:class="[ :class="[
{ {
['active']: active ['active']: active
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
{{ $t('chart.chart_error_tips') }} {{ $t('chart.chart_error_tips') }}
</div> </div>
</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 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" @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" />--> <!-- <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" /> <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" /> <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 { ...@@ -54,11 +54,6 @@ export default {
type: Object, type: Object,
default: null default: null
}, },
// filters: {
// type: Array,
// required: false,
// default: null
// },
outStyle: { outStyle: {
type: Object, type: Object,
required: false, required: false,
...@@ -100,6 +95,9 @@ export default { ...@@ -100,6 +95,9 @@ export default {
} }
}, },
computed: { computed: {
loadingFlag() {
return (this.canvasStyleData.refreshViewLoading || this.searchCount === 0) && this.requestStatus === 'waiting'
},
panelInfo() { panelInfo() {
return this.$store.state.panel.panelInfo return this.$store.state.panel.panelInfo
}, },
...@@ -167,9 +165,6 @@ export default { ...@@ -167,9 +165,6 @@ export default {
handler(newVal, oldVal) { handler(newVal, oldVal) {
// isChange(newVal, oldVal) && this.getData(this.element.propValue.viewId) // isChange(newVal, oldVal) && this.getData(this.element.propValue.viewId)
if (isChange(newVal, oldVal)) { if (isChange(newVal, oldVal)) {
// if (this.chart.type === 'map') {
// this.doMapLink(newVal)
// }
this.getData(this.element.propValue.viewId) this.getData(this.element.propValue.viewId)
} }
}, },
...@@ -202,10 +197,6 @@ export default { ...@@ -202,10 +197,6 @@ export default {
// 监听外部的样式变化 (非实时性要求) // 监听外部的样式变化 (非实时性要求)
outStyle: { outStyle: {
handler(newVal, oldVla) { handler(newVal, oldVla) {
//
// if (this.$refs[this.element.propValue.id]) {
// this.$refs[this.element.propValue.id].chartResize()
// }
}, },
deep: true deep: true
}, },
......
...@@ -55,6 +55,11 @@ export default { ...@@ -55,6 +55,11 @@ export default {
default: function() { default: function() {
return ['drill'] return ['drill']
} }
},
searchCount: {
type: Number,
required: false,
default: 0
} }
}, },
data() { data() {
...@@ -156,6 +161,9 @@ export default { ...@@ -156,6 +161,9 @@ export default {
chart_option = baseMixOption(JSON.parse(JSON.stringify(BASE_MIX)), chart) chart_option = baseMixOption(JSON.parse(JSON.stringify(BASE_MIX)), chart)
} }
// console.log(JSON.stringify(chart_option)) // console.log(JSON.stringify(chart_option))
if (this.myChart && this.searchCount > 0) {
chart_option.animation = false
}
if (chart.type === 'map') { if (chart.type === 'map') {
const customAttr = JSON.parse(chart.customAttr) const customAttr = JSON.parse(chart.customAttr)
......
...@@ -46,6 +46,11 @@ export default { ...@@ -46,6 +46,11 @@ export default {
default: function() { default: function() {
return ['drill'] return ['drill']
} }
},
searchCount: {
type: Number,
required: false,
default: 0
} }
}, },
data() { data() {
...@@ -171,6 +176,10 @@ export default { ...@@ -171,6 +176,10 @@ export default {
} }
} }
if (this.myChart && this.searchCount > 0) {
this.myChart.options.animation = false
}
if (this.antVRenderStatus) { if (this.antVRenderStatus) {
this.myChart.render() this.myChart.render()
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论