From dcd660c86dba586c1b78c0530ddee7c1dc093ee6 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 25 四月 2024 17:51:15 +0800
Subject: [PATCH] 2024-04-25

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

diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx
index d809808..a96fa09 100644
--- a/src/menu/components/share/pastecomponent/index.jsx
+++ b/src/menu/components/share/pastecomponent/index.jsx
@@ -114,6 +114,10 @@
         return
       }
 
+      if (res.copyType === 'editcols') {
+        res.copyType = 'cols'
+      }
+
       let type = res.copyType
       let config = fromJS(this.props.config).toJS()
 
@@ -168,24 +172,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' || config.subtype === 'editable') && 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