fix: panel 以及下弹窗panel 同步时添加loading

This commit is contained in:
zhangyu
2021-11-27 12:07:25 +08:00
parent dc638be860
commit 5078715039
2 changed files with 8 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="full-width-height chart-list asset-detail"> <div class="full-width-height chart-list asset-detail" v-loading="panelTabLoading">
<nz-bottom-data-list <nz-bottom-data-list
:showTitle='showTitle' :showTitle='showTitle'
:obj='obj' :obj='obj'
@@ -144,6 +144,7 @@ export default {
data () { data () {
return { return {
fromRoute, fromRoute,
panelTabLoading: false,
panelLock: true, panelLock: true,
showTopBtn: false, // top按钮 showTopBtn: false, // top按钮
visible: false, visible: false,
@@ -560,7 +561,9 @@ export default {
this.panelLock = boolean this.panelLock = boolean
}, },
chartBySync () { chartBySync () {
this.panelTabLoading = true
this.$post('visual/panel/chart/syncTmpl', { panelId: this.showPanel.id }).then(res => { this.$post('visual/panel/chart/syncTmpl', { panelId: this.showPanel.id }).then(res => {
this.panelTabLoading = false
if (res.code === 200) { if (res.code === 200) {
this.getTableData(this.obj.id) this.getTableData(this.obj.id)
this.$message.success(this.$t('tip.syncSuccess')) this.$message.success(this.$t('tip.syncSuccess'))

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="panel list-page"> <div class="panel list-page" v-loading="panelTabLoading">
<div class="main-list"> <div class="main-list">
<div> <div>
<transition name="el-zoom-in-center"> <transition name="el-zoom-in-center">
@@ -120,6 +120,7 @@ export default {
data () { data () {
return { return {
fromRoute, fromRoute,
panelTabLoading: false,
overScroll10: false, overScroll10: false,
isLoading: true, isLoading: true,
panelLock: true, panelLock: true,
@@ -320,7 +321,9 @@ export default {
this.rightBox.chartTemp.show = true this.rightBox.chartTemp.show = true
}, },
chartBySync () { chartBySync () {
this.panelTabLoading = true
this.$post('visual/panel/chart/syncTmpl', { panelId: this.showPanel.id }).then(res => { this.$post('visual/panel/chart/syncTmpl', { panelId: this.showPanel.id }).then(res => {
this.panelTabLoading = false
if (res.code === 200) { if (res.code === 200) {
this.getData(this.filter) this.getData(this.filter)
this.$message.success(this.$t('tip.syncSuccess')) this.$message.success(this.$t('tip.syncSuccess'))