From d1cd5af5adb53e91efdd278328e1b6f8ad834fb5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 06 二月 2025 21:11:56 +0800
Subject: [PATCH] Merge branch 'positec' into dms

---
 src/menu/components/share/pastecomponent/index.jsx |   88 ++++++++++++++++++++++++++++++--------------
 1 files changed, 60 insertions(+), 28 deletions(-)

diff --git a/src/menu/components/share/pastecomponent/index.jsx b/src/menu/components/share/pastecomponent/index.jsx
index d809808..90944e9 100644
--- a/src/menu/components/share/pastecomponent/index.jsx
+++ b/src/menu/components/share/pastecomponent/index.jsx
@@ -6,9 +6,11 @@
 
 import Utils from '@/utils/utils.js'
 import MKEmitter from '@/utils/events.js'
+import MenuUtils from '@/utils/utils-custom.js'
 import asyncComponent from '@/utils/asyncComponent'
 // import './index.scss'
 
+const { confirm } = Modal
 const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
 
 class PasteController extends Component {
@@ -28,7 +30,9 @@
       item.uuid = _uuid
     }
 
-    if (item.copyType === 'cardcell' && config.subtype === 'datacard') {
+    if (item.copyType === 'action') {
+      MenuUtils.resetBtn(item, _uuid)
+    } else if (item.copyType === 'cardcell' && config.subtype === 'datacard') {
       item.setting = item.setting || {}
       item.$cardType = 'extendCard'
       item.setting.width = item.setting.width || 6
@@ -39,6 +43,10 @@
             cell.datatype = 'static'
           }
           cell.uuid = Utils.getuuid()
+
+          if (cell.eleType === 'button') {
+            MenuUtils.resetBtn(cell, _uuid)
+          }
           return cell
         })
       }
@@ -48,6 +56,10 @@
             cell.datatype = 'static'
           }
           cell.uuid = Utils.getuuid()
+
+          if (cell.eleType === 'button') {
+            MenuUtils.resetBtn(cell, _uuid)
+          }
           return cell
         })
       }
@@ -64,12 +76,18 @@
       if (item.elements) {
         item.elements = item.elements.map(cell => {
           cell.uuid = Utils.getuuid()
+          if (cell.eleType === 'button') {
+            MenuUtils.resetBtn(cell, _uuid)
+          }
           return cell
         })
       }
       if (item.backElements) {
         item.backElements = item.backElements.map(cell => {
           cell.uuid = Utils.getuuid()
+          if (cell.eleType === 'button') {
+            MenuUtils.resetBtn(cell, _uuid)
+          }
           return cell
         })
       }
@@ -87,6 +105,9 @@
           } else if (col.type === 'custom' && col.elements) {
             col.elements = col.elements.map(cell => {
               cell.uuid = Utils.getuuid()
+              if (cell.eleType === 'button') {
+                MenuUtils.resetBtn(cell, _uuid)
+              }
               return cell
             })
           }
@@ -112,6 +133,10 @@
         this.props.updateConfig(res)
         this.setState({visible: false})
         return
+      }
+
+      if (res.copyType === 'editcols') {
+        res.copyType = 'cols'
       }
 
       let type = res.copyType
@@ -149,17 +174,20 @@
           }
         }
 
-        if (res.field && keys.includes(res.field.toLowerCase())) {
-          notification.warning({
-            top: 92,
-            message: '鎼滅储瀛楁宸插瓨鍦紒',
-            duration: 5
-          })
-          return
-        }
-
-        MKEmitter.emit('plusSearch', config.uuid, res, 'simple')
         this.setState({visible: false})
+        if (res.field && keys.includes(res.field.toLowerCase())) {
+          confirm({
+            title: '鎼滅储瀛楁宸插瓨鍦紒',
+            okText: '鐭ラ亾浜�',
+            cancelText: '鏇挎崲',
+            onOk() {},
+            onCancel() {
+              MKEmitter.emit('plusSearch', config.uuid, res, 'replace')
+            }
+          })
+        } else {
+          MKEmitter.emit('plusSearch', config.uuid, res, 'simple')
+        }
         return
       } else if (type === 'cardcell') {
         config.subcards.push(res)
@@ -168,24 +196,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