Merge pull request #2953 from xinnan-tech/fix-modal-flicker

Fix modal flicker
This commit is contained in:
wengzh
2026-02-06 16:40:56 +08:00
committed by GitHub
3 changed files with 10 additions and 5 deletions
@@ -210,6 +210,7 @@ export default {
paramDropdownVisible: false,
voiceCloneDropdownVisible: false,
userMenuVisible: false, // 添加用户菜单可见状态
menuVisibleTimer: null, // 菜单显示定时器,防止够快触发
isSmallScreen: false,
// 搜索历史相关
searchHistory: [],
@@ -631,7 +632,12 @@ export default {
// 处理用户菜单可见性变化
handleUserMenuVisibleChange(visible) {
this.userMenuVisible = visible;
if (this.menuVisibleTimer) return;
this.menuVisibleTimer = setTimeout(() => {
this.userMenuVisible = visible;
clearTimeout(this.menuVisibleTimer);
this.menuVisibleTimer = null;
}, 100);
// 如果菜单关闭了,也要清空选择值
if (!visible) {
@@ -105,6 +105,7 @@ export default {
},
cancel() {
this.saving = false; // 取消时重置状态
this.dialogKey = Date.now();
this.$emit('cancel');
},
@@ -115,9 +116,7 @@ export default {
},
watch: {
visible(newVal) {
if (newVal) {
this.dialogKey = Date.now();
} else {
if (!newVal) {
// 当对话框关闭时,重置saving状态
this.saving = false;
}
@@ -153,13 +153,13 @@ export default {
},
cancel() {
this.saving = false; // 取消时重置状态
this.dialogKey = Date.now();
this.$emit('cancel');
}
},
watch: {
visible(newVal) {
if (newVal) {
this.dialogKey = Date.now();
api.agent.getRecentlyFiftyByAgentId(this.agentId, ((data) => {
this.valueTypeOptions = data.data.data.map(item => ({
...item