From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 27 八月 2023 18:37:36 +0800
Subject: [PATCH] 2023-08-27

---
 src/mob/components/tabs/antv-tabs/index.jsx |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/src/mob/components/tabs/antv-tabs/index.jsx b/src/mob/components/tabs/antv-tabs/index.jsx
index 45181e1..fdd6b21 100644
--- a/src/mob/components/tabs/antv-tabs/index.jsx
+++ b/src/mob/components/tabs/antv-tabs/index.jsx
@@ -226,8 +226,6 @@
   }
 
   getTabForms = (tab) => {
-    const { tabs } = this.state
-
     if (!tab) {
       tab = {
         uuid: '',
@@ -241,7 +239,7 @@
       editab: tab
     })
 
-    return getTabForm(tab, tabs.setting)
+    return getTabForm(tab)
   }
 
   updateTab = (res) => {
@@ -252,7 +250,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
 
@@ -280,11 +278,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