From 176c6e1da22e96a1110fa91f8fc8eb8ad2881e08 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 08 八月 2022 18:13:37 +0800
Subject: [PATCH] 2022-08-08

---
 src/tabviews/custom/components/tabs/antv-tabs/index.jsx |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx
index 064a1d0..a5159a1 100644
--- a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx
+++ b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx
@@ -52,8 +52,13 @@
     if (config.setting.autoSwitch === 'true' && config.subtabs.length > 1 && config.setting.interval) {
       this.autoSwitch(config.setting.interval)
     }
-    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
 
+    if (config.activeKey) {
+      let node = document.getElementById('tab' + config.activeKey)
+      node && node.click()
+    }
+
+    MKEmitter.addListener('resetSelectLine', this.resetParentParam)
   }
 
   /**
@@ -81,13 +86,18 @@
           tabs: {...tabs, subtabs: []}
         })
       } else {
-        let val = data[tabs.setting.controlField] === undefined ? '' : data[tabs.setting.controlField] + ''
+        let val = ''
+        Object.keys(data).forEach(key => {
+          if (key.toLowerCase() === tabs.setting.controlField) {
+            val = data[key]
+          }
+        })
         this.setState({
           tabs: {...tabs, subtabs: this.props.config.subtabs.filter(tab => {
             if (tab.controlVal === val) {
               return false
             } else if (/,/ig.test(tab.controlVal)) {
-              return tab.controlVal.split(',').includes(val)
+              return !tab.controlVal.split(',').includes(val)
             }
             return true
           })}

--
Gitblit v1.8.0