From 12d76349b6f87aee18785abaabcae35bd4a4efaf Mon Sep 17 00:00:00 2001 From: liulujian Date: Thu, 4 Jun 2026 19:30:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E2=80=9C=E6=95=AC?= =?UTF-8?q?=E8=AF=B7=E6=9C=9F=E5=BE=85=E2=80=9D=E5=B1=95=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/settings.local.json | 5 ++- .gitignore | 1 + .../pages/index/utils/coming-soon-mixin.js | 34 ++++++++++++++----- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 1f72ebb..18c87cc 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -35,7 +35,10 @@ "mcp__code-review-graph__build_or_update_graph_tool", "mcp__code-review-graph__semantic_search_nodes_tool", "mcp__code-review-graph__query_graph_tool", - "mcp__code-review-graph__detect_changes_tool" + "mcp__code-review-graph__detect_changes_tool", + "Bash(cd \"/e/00项目/T_碳信网/code/txw/txw-mhzc-web\" && grep -nE \"closeAll|^\\\\s*close|export\\\\s+\\(function|const\\)\\\\s+close\" node_modules/tdesign-vue/es/message/index.js node_modules/tdesign-vue/es/message/plugin.js 2>/dev/null | head -30)", + "Read(//e/e/00项目/T_碳信网/code/txw/txw-mhzc-web/node_modules/tdesign-vue/es/message/**)", + "Bash(cd \"/e/00项目/T_碳信网/code/txw/txw-mhzc-web\" && cat node_modules/tdesign-vue/es/message/index.d.ts 2>/dev/null)" ] }, "enableAllProjectMcpServers": true, diff --git a/.gitignore b/.gitignore index a26dc47..7743ed9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Compiled class file +.claude *.class target classes diff --git a/txw-mhzc-web/src/pages/index/utils/coming-soon-mixin.js b/txw-mhzc-web/src/pages/index/utils/coming-soon-mixin.js index c0a17a8..b5c905e 100644 --- a/txw-mhzc-web/src/pages/index/utils/coming-soon-mixin.js +++ b/txw-mhzc-web/src/pages/index/utils/coming-soon-mixin.js @@ -1,13 +1,31 @@ +// 用 Symbol 存"敬请期待"当前实例引用,避免被 Vue 响应式系统代理,也避免污染可枚举属性 +const COMING_SOON_INSTANCE = Symbol('comingSoonInstance') + export default { methods: { + /** + * 显示"敬请期待"提示,做组件级单例: + * 屏幕上同一时刻最多只有一个;连点时关掉旧的再开新的,旧的自动消失。 + * @message 是 TDesign 的 MessagePlugin(main.js 里挂到 Vue.prototype.$message), + * info() 返回 Promise,实例有 close()。 + */ showComingSoon() { - if (this._comingSoonLock) return - this._comingSoonLock = true - this.$message.info(String.fromCharCode(25964,35831,26399,24453)) - setTimeout(function() { this._comingSoonLock = false }, 2000) - } + const prev = this[COMING_SOON_INSTANCE] + if (prev) { + prev.close() + this[COMING_SOON_INSTANCE] = null + } + this.$message.info('敬请期待').then((instance) => { + this[COMING_SOON_INSTANCE] = instance + }) + }, }, beforeDestroy() { - this._comingSoonLock = false - } -}; + // 离页前关掉,避免跳页后残留 + const instance = this[COMING_SOON_INSTANCE] + if (instance) { + instance.close() + this[COMING_SOON_INSTANCE] = null + } + }, +}