fix: 防止新建视图一直loading

This commit is contained in:
wangjiahao 2022-01-18 16:52:28 +08:00
parent aa2a44da0e
commit c0f0a6fa3d

View File

@ -118,9 +118,10 @@ export default {
},
data() {
return {
filterInit: false, // watch.filters filterInit=true create
refId: null,
chart: BASE_CHART_STRING,
requestStatus: 'waiting',
requestStatus: 'success',
message: null,
drillClickDimensionList: [],
drillFilters: [],
@ -242,7 +243,10 @@ export default {
watch: {
'filters': function(val1, val2) {
isChange(val1, val2) && this.getData(this.element.propValue.viewId)
if (isChange(val1, val2)) {
this.filterInit = true
this.getData(this.element.propValue.viewId)
}
},
linkageFilters: {
handler(newVal, oldVal) {
@ -313,8 +317,8 @@ export default {
created() {
this.refId = uuid.v1
if (this.element && this.element.propValue && this.element.propValue.viewId) {
const hasFilter = this.componentData.filter(item => item.type === 'custom').some(item => item.options.value && !(item.options.value instanceof Object) || (item.options.attrs && item.options.attrs.default && item.options.attrs.default.isDynamic))
if (!hasFilter || this.filters.length > 0) { this.getData(this.element.propValue.viewId, false) }
// watch.filters
!this.filterInit && this.getData(this.element.propValue.viewId, false)
}
},
methods: {