From 3011b9800d6c5bee031d87bc4e225b5b1fb52571 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期六, 23 十一月 2024 09:19:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/2.0.1' into 2.0.1

---
 company/src/utils/resetMessage.js |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/company/src/utils/resetMessage.js b/company/src/utils/resetMessage.js
new file mode 100644
index 0000000..4fca990
--- /dev/null
+++ b/company/src/utils/resetMessage.js
@@ -0,0 +1,18 @@
+import { Message } from 'element-ui';
+
+let messageInstance = null;
+
+export const showMessage = (message) => {
+  if (messageInstance) {
+    // 濡傛灉宸茬粡瀛樺湪涓�涓秷鎭彁绀哄疄渚嬶紝鍒欏厛鍏抽棴瀹�
+    Message.closeAll();
+  }
+
+  // 鏄剧ず鏂扮殑娑堟伅鎻愮ず锛屽苟淇濆瓨璇ュ疄渚�
+  messageInstance = Message({
+    message: message,
+    onClose: () => {
+      messageInstance = null; // 褰撴秷鎭彁绀哄叧闂椂锛屽皢瀹炰緥缃负null
+    }
+  });
+}

--
Gitblit v1.9.3