From f6626b05f1275cc2f8ca77f773d4f6a6af1b0a89 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 21 十一月 2022 16:11:55 +0800
Subject: [PATCH] 2022-11-21

---
 src/menu/components/card/cardsimplecomponent/index.jsx |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/src/menu/components/card/cardsimplecomponent/index.jsx b/src/menu/components/card/cardsimplecomponent/index.jsx
index 67e71fb..e46f414 100644
--- a/src/menu/components/card/cardsimplecomponent/index.jsx
+++ b/src/menu/components/card/cardsimplecomponent/index.jsx
@@ -16,6 +16,7 @@
 const NodesWrap = asyncComponent(() => import('./node-wrap'))
 const CardCellComponent = asyncComponent(() => import('../cardcellcomponent'))
 const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
+const PasteController = asyncIconComponent(() => import('@/components/paste'))
 
 class CardBoxComponent extends Component {
   static propTpyes = {
@@ -186,6 +187,24 @@
     this.props.updateElement(_card)
   }
 
+  paste = (element, resolve) => {
+    const { card } = this.state
+
+    let _uuid = Utils.getuuid()
+    
+    if (element.copyType === 'action') {
+      element.eleType = 'button'
+    }
+
+    element.uuid = _uuid
+    element.focus = true
+
+    resolve({status: true})
+
+    // 娉ㄥ唽浜嬩欢-娣诲姞鍏冪礌
+    MKEmitter.emit('cardAddElement', card.uuid, element)
+  }
+
   render() {
     const { cards } = this.props
     const { card } = this.state
@@ -216,6 +235,7 @@
                   <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
                 </NormalForm> : <NodesWrap card={card} updateMenus={this.updateNodes}/>}
                 {cards.type !== 'timeline' ? <CopyComponent type="cardcell" card={card}/> : null}
+                <PasteController options={['action', 'customCardElement']} updateConfig={this.paste} />
                 <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/>
                 {control ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
                   <div className="mk-popover-control">

--
Gitblit v1.8.0