提交 21134b76 authored 作者: wangjiahao's avatar wangjiahao

fix:【仪表板】跳转至系统内仪表板时,出现先提示空白仪表板,再加载仪表板的情况

上级 93eb5931
<template> <template>
<div class="bg"> <div v-loading="dataLoading" class="bg">
<Preview /> <Preview v-show="!dataLoading" />
</div> </div>
</template> </template>
<script> <script>
...@@ -12,14 +12,21 @@ import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJu ...@@ -12,14 +12,21 @@ import { queryPanelJumpInfo, queryTargetPanelJumpInfo } from '@/api/panel/linkJu
export default { export default {
components: { Preview }, components: { Preview },
data() {
return {
dataLoading: false
}
},
mounted() { mounted() {
this.restore() this.restore()
}, },
methods: { methods: {
restore() { restore() {
this.dataLoading = true
this.panelId = this.$route.path.split('/')[2] this.panelId = this.$route.path.split('/')[2]
// 加载视图数据 // 加载视图数据
findOne(this.panelId).then(response => { findOne(this.panelId).then(response => {
this.dataLoading = false
this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData))) this.$store.commit('setComponentData', this.resetID(JSON.parse(response.data.panelData)))
this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle)) this.$store.commit('setCanvasStyle', JSON.parse(response.data.panelStyle))
const data = { const data = {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论