From c1d885f9eac0619663901b88d12acee7b6bca72f Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 03 七月 2024 17:54:58 +0800
Subject: [PATCH] 2024-07-03

---
 src/tabviews/custom/components/tabs/antv-tabs/index.jsx  |    2 +-
 src/menu/components/tabs/antv-tabs/index.jsx             |    6 ++++++
 src/tabviews/custom/components/tabs/antv-tabs/index.scss |    4 ++++
 3 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/src/menu/components/tabs/antv-tabs/index.jsx b/src/menu/components/tabs/antv-tabs/index.jsx
index eaa3206..1aa31f6 100644
--- a/src/menu/components/tabs/antv-tabs/index.jsx
+++ b/src/menu/components/tabs/antv-tabs/index.jsx
@@ -223,6 +223,12 @@
     // editab.selectVal = res.selectVal || ''
     editab.blacklist = res.blacklist
 
+    if (/^\s+$/.test(editab.label) && editab.icon) {
+      editab.taType = 'only-icon'
+    } else {
+      delete editab.taType
+    }
+
     if (editab.uuid) {
       tabs.subtabs = tabs.subtabs.map(t => {
         if (t.uuid === editab.uuid) {
diff --git a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx
index 154f5a6..ea63ca4 100644
--- a/src/tabviews/custom/components/tabs/antv-tabs/index.jsx
+++ b/src/tabviews/custom/components/tabs/antv-tabs/index.jsx
@@ -149,7 +149,7 @@
       <div className={`menu-antv-tabs-wrap ${tabs.setting.tabLabel || ''} ${tabs.setting.cusClass || ''} align-${tabs.setting.tabAlign || ''}`} id={'anchor' + tabs.uuid} style={tabs.style}>
         <Tabs defaultActiveKey="1" tabBarStyle={{background: tabs.setting.backgroundColor || 'transparent'}} tabPosition={tabs.setting.position} type={tabs.setting.tabStyle}>
           {tabs.subtabs.map(tab => (
-            <TabPane tab={<span id={'tab' + tab.uuid}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>} style={{backgroundColor: tab.backgroundColor || 'transparent'}} key={tab.uuid}>
+            <TabPane tab={<span className={tab.taType || ''} id={'tab' + tab.uuid}>{tab.icon ? <MkIcon type={tab.icon} /> : null}{tab.label}</span>} style={{backgroundColor: tab.backgroundColor || 'transparent'}} key={tab.uuid}>
               <TabTransfer config={tab}/>
             </TabPane>
           ))}
diff --git a/src/tabviews/custom/components/tabs/antv-tabs/index.scss b/src/tabviews/custom/components/tabs/antv-tabs/index.scss
index 9093f26..21a134e 100644
--- a/src/tabviews/custom/components/tabs/antv-tabs/index.scss
+++ b/src/tabviews/custom/components/tabs/antv-tabs/index.scss
@@ -23,6 +23,10 @@
   .ant-tabs-bottom-bar {
     margin-top: 0;
   }
+
+  .ant-tabs-tab .only-icon .anticon {
+    margin-right: 0px;
+  }
 }
 
 .menu-antv-tabs-wrap.hide >.ant-tabs >.ant-tabs-bar{

--
Gitblit v1.8.0