From 50b49c1b760489c3430fc382656d57c5fbbab07c Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 29 四月 2024 16:07:24 +0800
Subject: [PATCH] 2024-04-29

---
 src/menu/components/tree/antd-tree/index.jsx |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/menu/components/tree/antd-tree/index.jsx b/src/menu/components/tree/antd-tree/index.jsx
index b093ad7..515d1d0 100644
--- a/src/menu/components/tree/antd-tree/index.jsx
+++ b/src/menu/components/tree/antd-tree/index.jsx
@@ -15,6 +15,7 @@
 
 const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
 const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
+const PasteComponent = asyncIconComponent(() => import('@/components/paste'))
 const NormalHeader = asyncComponent(() => import('@/menu/components/share/normalheader'))
 const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
 const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
@@ -88,6 +89,7 @@
     card.name = card.wrap.name
 
     card.$c_ds = true
+    card.$c_ac = true
       
     card.errors = checkComponent(card)
 
@@ -160,6 +162,20 @@
     MKEmitter.emit('addButton', card.uuid, newcard)
   }
 
+  pasteComponent = (res, resolve) => {
+    if (res.style) {
+      delete res.style.width
+      delete res.style.float
+    }
+
+    res.Ot = res.Ot === 'requiredSgl' ? 'requiredSgl' : 'notRequired'
+
+    resolve({status: true})
+
+    res.uuid = Utils.getuuid()
+    this.addButton(res)
+  }
+
   setSubConfig = (item) => {
     const { card, appType } = this.state
     let btn = fromJS(item).toJS()
@@ -180,9 +196,9 @@
   }
 
   getWrapForms = () => {
-    const { wrap, columns } = this.state.card
+    const { wrap, columns, action } = this.state.card
 
-    return getWrapForm(wrap, columns)
+    return getWrapForm(wrap, columns, action.findIndex(item => item.Ot === 'requiredSgl') > -1)
   }
 
   updateWrap = (res) => {
@@ -205,6 +221,9 @@
   render() {
     const { card } = this.state
     let _style = resetStyle(card.style)
+    if (card.wrap.lineHeight) {
+      _style['--mk-tree-line-height'] = card.wrap.lineHeight + 'px'
+    }
 
     return (
       <div className="menu-tree-box" style={_style} onClick={this.clickComponent} id={card.uuid}>
@@ -217,6 +236,7 @@
               <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
             </NormalForm>
             <CopyComponent type="tree" card={card}/>
+            <PasteComponent options={['action']} updateConfig={this.pasteComponent} />
             <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/>
             <ClockComponent config={card} updateConfig={this.updateComponent}/>
             <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} />

--
Gitblit v1.8.0