From f128d679cacda2a6b5b730ad0368b5fe73f887f7 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 14 二月 2025 15:27:02 +0800
Subject: [PATCH] Merge branch 'master' into positec

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

diff --git a/src/menu/components/tree/antd-tree/index.jsx b/src/menu/components/tree/antd-tree/index.jsx
index c7afa92..8f2c11d 100644
--- a/src/menu/components/tree/antd-tree/index.jsx
+++ b/src/menu/components/tree/antd-tree/index.jsx
@@ -15,9 +15,9 @@
 
 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 UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
 const ClockComponent = asyncIconComponent(() => import('@/menu/components/share/clockcomponent'))
 const ActionComponent = asyncComponent(() => import('@/menu/components/share/actioncomponent'))
 
@@ -56,19 +56,6 @@
         scripts: [],
         action: [],
       }
-
-      if (card.config) {
-        let config = fromJS(card.config).toJS()
-
-        _card.wrap = config.wrap
-        _card.wrap.name = card.name
-        _card.style = config.style
-        _card.headerStyle = config.headerStyle
-
-        _card.setting = config.setting
-        _card.columns = config.columns
-        _card.scripts = config.scripts
-      }
       
       this.updateComponent(_card)
     } else {
@@ -102,12 +89,16 @@
     card.name = card.wrap.name
 
     card.$c_ds = true
+    card.$c_ac = true
       
     card.errors = checkComponent(card)
 
     if (card.errors.length === 0) {
       card.$tables = getTables(card)
     }
+
+    delete card.$c_ds
+    delete card.$c_ac
 
     if (!card.wrap.parentField || !card.wrap.valueField || !card.wrap.labelField) {
       card.errors.push({ level: 0, detail: '鏈缃熀鏈俊鎭紒'})
@@ -174,6 +165,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()
@@ -194,9 +199,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) => {
@@ -219,6 +224,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}>
@@ -231,9 +239,9 @@
               <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}/>
-            <UserComponent config={card}/>
             <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} />
             <SettingComponent config={card} updateConfig={this.updateComponent} />
           </div>

--
Gitblit v1.8.0