Merge pull request #5030 from dataease/pr@dev_memory_component

Pr@dev memory component
This commit is contained in:
dataeaseShu 2023-04-13 18:51:23 +08:00 committed by GitHub
commit ee566d33d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -322,6 +322,7 @@ export default {
curFields: [],
isFirstLoad: true, //
refId: null,
getDataLoading: false,
chart: BASE_CHART_STRING,
requestStatus: 'success',
message: null,
@ -491,6 +492,7 @@ export default {
handler: function(val1, val2) {
if (isChange(val1, val2) && !this.isFirstLoad) {
this.getData(this.element.propValue.viewId)
this.getDataLoading = true
}
},
deep: true
@ -747,6 +749,7 @@ export default {
},
getData(id, cache = true, dataBroadcast = false) {
if (id) {
if (this.getDataLoading) return
this.requestStatus = 'waiting'
this.message = null
@ -845,6 +848,8 @@ export default {
}
this.isFirstLoad = false
return true
}).finally(() => {
this.getDataLoading = false
})
}
},

View File

@ -423,7 +423,7 @@ export default {
try {
const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName]
if (targetRef) {
targetRef[0].restore()
targetRef[0]?.restore()
}
_this.$refs[this.activeTabName][0].resizeChart()
} catch (e) {
@ -528,7 +528,7 @@ export default {
_this.activeTabName = _this.element.options.tabList[nowIndex].name
const targetRef = _this.$refs['canvasTabRef-' + _this.activeTabName]
if (targetRef) {
targetRef[0].restore()
targetRef[0]?.restore()
}
});
}, switchTime)