Merge pull request #5514 from dataease/pr@dev_st_fix

Pr@dev st fix
This commit is contained in:
dataeaseShu 2023-06-26 11:10:56 +08:00 committed by GitHub
commit 52ba678707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -190,7 +190,6 @@
</template>
<script>
import { viewData } from '@/api/panel/panel'
import { viewInfo } from '@/api/link'
import ChartComponent from '@/views/chart/components/ChartComponent.vue'
@ -353,7 +352,8 @@ export default {
pageSize: 20,
show: 0
},
view: {}
view: {},
cancelTime: null
}
},
@ -749,10 +749,20 @@ export default {
},
getData(id, cache = true, dataBroadcast = false) {
if (id) {
if (this.getDataLoading) return
if (this.getDataLoading || Vue.prototype.$currentHttpRequestList.get(`/chart/view/getData/${id}/${this.panelInfo.id}`)) {
const url = `/chart/view/getData/${id}/${this.panelInfo.id}`
Vue.prototype.$cancelRequest(url)
Vue.prototype.$currentHttpRequestList.delete(url)
this.getDataLoading = false
this.getData(id, cache, dataBroadcast)
clearTimeout(this.cancelTime)
this.cancelTime = setTimeout(() => {
this.requestStatus = 'waiting'
}, 0)
return
}
this.requestStatus = 'waiting'
this.message = null
// 使viewInfo 使viewData
let method = viewData
const token = this.$store.getters.token || getToken()