From 9784e282d14f9a0438dd1f052e06dfb6552d02cc Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 04 七月 2023 00:13:51 +0800
Subject: [PATCH] 2023-07-04

---
 src/menu/components/tabs/antv-tabs/index.jsx |   22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx
index 523c8b2..a43f81f 100644
--- a/src/menu/components/tabs/antv-tabs/index.jsx
+++ b/src/menu/components/tabs/antv-tabs/index.jsx
@@ -221,7 +221,7 @@
     editab.icon = res.icon
     editab.hide = res.hide || 'false'
     editab.backgroundColor = res.backgroundColor
-    editab.controlVal = res.controlVal || ''
+    // editab.controlVal = res.controlVal || ''
     editab.selectVal = res.selectVal || ''
     editab.blacklist = res.blacklist
 
@@ -249,11 +249,27 @@
   getTabsForms = () => {
     const { tabs } = this.state
 
-    return getTabsSetForm(tabs.setting, tabs.uuid)
+    return getTabsSetForm(tabs.setting, tabs.uuid, tabs.subtabs)
   }
 
   updateTabs = (res) => {
-    this.updateComponent({...this.state.tabs, setting: res})
+    let tabs = fromJS(this.state.tabs).toJS()
+
+    if (res.controlVals) {
+      let values = {}
+      res.controlVals.forEach(item => {
+        values[item.uuid] = item.value
+      })
+      tabs.subtabs.forEach(tab => {
+        tab.controlVal = values[tab.uuid]
+      })
+
+      delete res.controlVals
+    }
+
+    tabs.setting = res
+
+    this.updateComponent(tabs)
   }
 
   onChange = (key) => {

--
Gitblit v1.8.0