From 43008f1240d6568a3364721bb01fc7e31b33d147 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 24 十二月 2023 23:39:51 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/menu/components/tabs/antv-tabs/index.jsx |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx
index 002bc4b..eaa3206 100644
--- a/src/menu/components/tabs/antv-tabs/index.jsx
+++ b/src/menu/components/tabs/antv-tabs/index.jsx
@@ -16,7 +16,7 @@
 
 const NormalForm = asyncIconComponent(() => import('@/components/normalform'))
 const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
-const PasteComponent = asyncIconComponent(() => import('../paste'))
+const PasteController = asyncIconComponent(() => import('@/menu/pastecontroller'))
 const TabComponents = asyncComponent(() => import('../tabcomponents'))
 
 const { TabPane } = Tabs
@@ -181,11 +181,11 @@
     this.props.updateConfig(tabs)
   }
 
-  insert = (item, tab) => {
+  insert = (item, tabId) => {
     let tabs = fromJS(this.state.tabs).toJS()
 
     tabs.subtabs.forEach(stab => {
-      if (stab.uuid === tab.uuid) {
+      if (stab.uuid === tabId) {
         stab.components.push(item)
       }
     })
@@ -220,7 +220,7 @@
     editab.hide = res.hide || 'false'
     editab.backgroundColor = res.backgroundColor
     // editab.controlVal = res.controlVal || ''
-    editab.selectVal = res.selectVal || ''
+    // editab.selectVal = res.selectVal || ''
     editab.blacklist = res.blacklist
 
     if (editab.uuid) {
@@ -264,6 +264,17 @@
 
       delete res.controlVals
     }
+    if (res.selectVals) {
+      let values = {}
+      res.selectVals.forEach(item => {
+        values[item.uuid] = item.value
+      })
+      tabs.subtabs.forEach(tab => {
+        tab.selectVal = values[tab.uuid]
+      })
+
+      delete res.selectVals
+    }
 
     res.tabStyle = res.tabStyle || 'line'
     res.cusClass = ''
@@ -297,7 +308,7 @@
                   <NormalForm title="鏍囩缂栬緫" width={800} update={this.updateTab} getForms={() => this.getTabForms(tab)}>
                     <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/>
                   </NormalForm>
-                  <PasteComponent Tab={tab} insert={this.insert} />
+                  <PasteController type="tabs" tab={tab} insert={(item) => this.insert(item, tab.uuid)} />
                   <CloseOutlined className="close" onClick={() => this.delTab(tab)} />
                 </div>
               } trigger="hover">

--
Gitblit v1.8.0