fix: chart 编辑时 保存提示优化有时不生效的问题

This commit is contained in:
zhangyu
2023-01-09 16:39:58 +08:00
parent 2d9b85523c
commit 3c2ce736a4
4 changed files with 20 additions and 4 deletions

View File

@@ -74,8 +74,10 @@ export const clickoutside = {
},
update (el, binding, vnode) {
if (binding.arg && binding.arg != 'stable') {
if (binding.value.obj.datasource !== '0') {
el.__oldValue__ = JSON.parse(JSON.stringify(binding.value.obj))
}
}
el.__newValue__ = binding.value.obj
},
unbind (el, binding) {

View File

@@ -111,7 +111,11 @@ export default {
if (this.$refs.menuTree && this.selectedIds && this.selectedIds.length > 0) {
this.$refs.menuTree.setCheckedKeys(this.selectedIds, true)
this.editRole.menuIds = this.$refs.menuTree.getCheckedKeys(true)
setTimeout(() => {
if (this.stableTime) {
clearTimeout(this.stableTime)
this.stableTime = null
}
this.stableTime = setTimeout(() => {
this.isStable = 'stable'
}, 100)
} else {

View File

@@ -116,6 +116,11 @@ export default {
handler (n) {
if (!n) {
this.$refs.roleBox.isStable = 'instability'
clearTimeout(this.$refs.roleBox.stableTime)
if (this.$refs.roleBox.stableTime) {
clearTimeout(this.$refs.roleBox.stableTime)
this.$refs.roleBox.stableTime = null
}
}
}
}

View File

@@ -330,7 +330,8 @@ export default {
mode: '',
variables: [],
variablesInit: false, // 判断variables 是否加载完成
snapshotVisible: false
snapshotVisible: false,
stableTime: null
}
},
components: {
@@ -614,7 +615,7 @@ export default {
}
})
}
this.$nextTick(() => {
setTimeout(() => {
this.$refs.addChartModal.isStable = 'stable'
})
} else {
@@ -1196,6 +1197,10 @@ export default {
this.disposeChart()
} else {
this.$refs.addChartModal.isStable = 'instability'
if (this.stableTime) {
clearTimeout(this.stableTime)
this.stableTime = null
}
}
}
},