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,7 +74,9 @@ export const clickoutside = {
}, },
update (el, binding, vnode) { update (el, binding, vnode) {
if (binding.arg && binding.arg != 'stable') { if (binding.arg && binding.arg != 'stable') {
el.__oldValue__ = JSON.parse(JSON.stringify(binding.value.obj)) if (binding.value.obj.datasource !== '0') {
el.__oldValue__ = JSON.parse(JSON.stringify(binding.value.obj))
}
} }
el.__newValue__ = binding.value.obj el.__newValue__ = binding.value.obj
}, },

View File

@@ -111,7 +111,11 @@ export default {
if (this.$refs.menuTree && this.selectedIds && this.selectedIds.length > 0) { if (this.$refs.menuTree && this.selectedIds && this.selectedIds.length > 0) {
this.$refs.menuTree.setCheckedKeys(this.selectedIds, true) this.$refs.menuTree.setCheckedKeys(this.selectedIds, true)
this.editRole.menuIds = this.$refs.menuTree.getCheckedKeys(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' this.isStable = 'stable'
}, 100) }, 100)
} else { } else {

View File

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