From 80deba0c2dcffd9e6b6f07815c7c52199309ce42 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 23 六月 2025 17:36:03 +0800
Subject: [PATCH] 2025-06-23

---
 src/components/paste/index.jsx |   62 +++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/src/components/paste/index.jsx b/src/components/paste/index.jsx
index 5efc6b6..fd88a46 100644
--- a/src/components/paste/index.jsx
+++ b/src/components/paste/index.jsx
@@ -1,7 +1,10 @@
-import React, {Component} from 'react'
+import React, { Component } from 'react'
 import PropTypes from 'prop-types'
-import { Icon, Modal, notification } from 'antd'
+import { Modal, notification } from 'antd'
+import { SnippetsOutlined } from '@ant-design/icons'
 
+import Utils from '@/utils/utils.js'
+import MenuUtils from '@/utils/utils-custom.js'
 import asyncComponent from '@/utils/asyncComponent'
 
 const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
@@ -16,8 +19,47 @@
     visible: false
   }
 
-  handleMenuClick = () => {
-    this.setState({visible: true})
+  resetconfig = (item, appType) => {
+    if (item.copyType === 'action') {
+      MenuUtils.resetBtn(item, item.uuid)
+    } else if (item.copyType === 'cardcell') {
+      item.setting = item.setting || {}
+      item.setting.width = item.setting.width || 6
+      delete item.$cardType
+
+      if (item.elements) {
+        item.elements = item.elements.map(cell => {
+          cell.uuid = Utils.getuuid()
+
+          if (cell.eleType === 'button') {
+            MenuUtils.resetBtn(cell, item.uuid)
+          }
+          return cell
+        })
+        if (appType === 'mob') {
+          item.elements = item.elements.filter(cell => {
+            if (cell.eleType === 'button' && ['excelIn', 'tab'].includes(cell.OpenType)) {
+              return false
+            }
+            return true
+          })
+        }
+      }
+      if (appType === 'mob') {
+        item.backElements = []
+      } else if (item.backElements) {
+        item.backElements = item.backElements.map(cell => {
+          cell.uuid = Utils.getuuid()
+
+          if (cell.eleType === 'button') {
+            MenuUtils.resetBtn(cell, item.uuid)
+          }
+          return cell
+        })
+      }
+    }
+
+    return item
   }
 
   pasteSubmit = () => {
@@ -27,6 +69,12 @@
         notification.warning({ top: 92, message: '閰嶇疆淇℃伅鏍煎紡閿欒锛�', duration: 5 })
         return
       }
+
+      let appType = sessionStorage.getItem('appType')
+      res.uuid = Utils.getuuid()
+
+      res = this.resetconfig(res, appType)
+
       this.props.updateConfig(res, (result) => {
         if (result.status) {
           notification.success({
@@ -36,10 +84,10 @@
           })
           this.setState({visible: false})
         } else {
-          notification.success({
+          notification.warning({
             top: 92,
             message: result.message,
-            duration: 2
+            duration: 5
           })
         }
       })
@@ -51,7 +99,7 @@
 
     return (
       <div style={{display: 'inline-block'}}>
-        <Icon type="snippets" style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />
+        <SnippetsOutlined style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} />
         <Modal
           title="绮樿创"
           visible={visible}

--
Gitblit v1.8.0