From dbf2f8a85f8218e9e570aa1d91bf4f17ac120353 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 18 十二月 2023 14:54:20 +0800
Subject: [PATCH] 2023-12-18

---
 src/menu/components/share/pastecomponent/index.jsx |   38 +++++++++++++++++++++-----------------
 1 files changed, 21 insertions(+), 17 deletions(-)

diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx
index d809808..7f0b88c 100644
--- a/src/menu/components/share/pastecomponent/index.jsx
+++ b/src/menu/components/share/pastecomponent/index.jsx
@@ -168,24 +168,28 @@
       } else if (type === 'cols') {
         config.cols = config.cols.filter(col => !col.origin)
 
-        let keys = config.cols.map(col => (col.field || '$empty'))
-
-        let cols = []
-        res.cols.forEach(col => {
-          if (!col.field || !keys.includes(col.field)) {
-            cols.push(col)
-          }
-        })
-
-        if (cols.length === 0) {
-          notification.warning({
-            top: 92,
-            message: '鏄剧ず鍒楀凡瀛樺湪锛�',
-            duration: 5
-          })
-          return
+        if (config.subtype === 'normaltable' && res.cols.length === 1) {
+          config.cols.push(...res.cols)
         } else {
-          config.cols.push(...cols)
+          let keys = config.cols.map(col => (col.field || '$empty'))
+  
+          let cols = []
+          res.cols.forEach(col => {
+            if (!col.field || !keys.includes(col.field)) {
+              cols.push(col)
+            }
+          })
+  
+          if (cols.length === 0) {
+            notification.warning({
+              top: 92,
+              message: '鏄剧ず鍒楀凡瀛樺湪锛�',
+              duration: 5
+            })
+            return
+          } else {
+            config.cols.push(...cols)
+          }
         }
       }
 

--
Gitblit v1.8.0