From ccef2b613fe21a6be5f2096f88a2de5eb301adde Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期四, 10 七月 2025 17:01:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev

---
 src/views/basicData/product/index.vue |   56 ++++++++++++--------------------------------------------
 1 files changed, 12 insertions(+), 44 deletions(-)

diff --git a/src/views/basicData/product/index.vue b/src/views/basicData/product/index.vue
index 3aa263e..b88d678 100644
--- a/src/views/basicData/product/index.vue
+++ b/src/views/basicData/product/index.vue
@@ -319,53 +319,17 @@
   proxy.$refs.formRef.resetFields();
   productDia.value = false;
 };
-// 灏佽涓�涓畨鍏ㄧ殑纭妗嗭紝褰诲簳闃绘Enter閿Е鍙�
-const safeConfirm = (message, title) => {
-  // 鏍囪鏄惁鏄紶鏍囩偣鍑伙紙鐐瑰嚮鎸夐挳浼氳Е鍙慺ocus浜嬩欢锛�
-  let isMouseClick = false;
 
-  return new Promise((resolve, reject) => {
-    const box = ElMessageBox.confirm(message, title, {
-      confirmButtonText: "纭",
-      cancelButtonText: "鍙栨秷",
-      type: "warning",
-      beforeClose: (action, instance, done) => {
-        if (action === "confirm") {
-          // 鍙湁榧犳爣鐐瑰嚮鏃舵墠鍏佽纭
-          if (isMouseClick) {
-            done();
-            resolve();
-          } else {
-            // Enter閿Е鍙戞椂闃绘
-            done(false);
-          }
-        } else {
-          // 鍙栨秷鎿嶄綔鐩存帴鍏佽
-          done();
-          reject();
-        }
-      }
-    });
-
-    // 鐩戝惉纭鎸夐挳鐨刦ocus浜嬩欢锛堥紶鏍囩偣鍑讳細瑙﹀彂锛孍nter閿笉浼氾級
-    setTimeout(() => {
-      const confirmBtn = document.querySelector('.el-message-box__btns .el-button--primary');
-      if (confirmBtn) {
-        confirmBtn.addEventListener('focus', () => {
-          isMouseClick = true;
-        });
-      }
-    }, 0); // 寤惰繜鑾峰彇锛岀‘淇滵OM宸叉覆鏌�
-  });
-};
-// 鍒犻櫎浜у搧
 // 鍒犻櫎浜у搧
 const remove = (node, data) => {
-  let ids = [data.id];
-  // 浣跨敤灏佽鐨剆afeConfirm
-  safeConfirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず")
+  let ids = [];
+  ids.push(data.id);
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
     .then(() => {
-      // 纭鍒犻櫎閫昏緫
       tableLoading.value = true;
       delProduct(ids)
         .then((res) => {
@@ -441,7 +405,11 @@
     proxy.$modal.msgWarning("璇烽�夋嫨鏁版嵁");
     return;
   }
-  safeConfirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず")
+  ElMessageBox.confirm("閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�", "鍒犻櫎鎻愮ず", {
+    confirmButtonText: "纭",
+    cancelButtonText: "鍙栨秷",
+    type: "warning",
+  })
     .then(() => {
       tableLoading.value = true;
       delProductModel(ids)

--
Gitblit v1.9.3