From f38b3321250222b81a797a538d9c3efa9f8a0ecb Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 29 五月 2022 03:54:05 +0800
Subject: [PATCH] 2022-05-29

---
 src/tabviews/zshare/actionList/popupbutton/index.jsx |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx
index 9eb203b..5cbcba9 100644
--- a/src/tabviews/zshare/actionList/popupbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -15,7 +15,6 @@
 
 class PopupButton extends Component {
   static propTpyes = {
-    show: PropTypes.any,              // 鎸夐挳鏄剧ず鏍峰紡鎺у埗
     BID: PropTypes.string,            // 涓昏〃ID
     BData: PropTypes.any,             // 涓昏〃鏁版嵁
     selectedData: PropTypes.any,      // 瀛愯〃涓�夋嫨鏁版嵁
@@ -316,45 +315,47 @@
   }
 
   render() {
-    const { btn, show } = this.props
+    const { btn } = this.props
     const { loading, disabled, hidden } = this.state
 
     if (hidden) return null
 
     let label = ''
     let icon = ''
+    let type = 'link'
+    let className = ''
 
-    if (show === 'button') {
+    if (btn.show === 'button') {
       label = btn.label
       icon = btn.icon || ''
-    } else if (show === 'link') {
+    } else if (btn.show === 'link') {
       label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span>
       icon = ''
-    } else if (show === 'icon') {
+    } else if (btn.show === 'icon') {
       icon = btn.icon || ''
-    } else {
+    } else if (!btn.$toolbtn) {
+      icon = btn.icon || ''
       label = btn.label
+      className = 'mk-btn mk-' + btn.class
+    } else {
+      type = ''
+      icon = btn.icon || ''
+      label = btn.label
+      className = 'mk-btn mk-' + btn.class
     }
 
     return (
       <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
-        {show === 'actionList' ? <Button
-          className={'mk-btn mk-' + btn.class}
-          icon={btn.icon}
-          disabled={disabled}
-          title={disabled ? (btn.reason || '') : ''}
-          onClick={() => {this.actionTrigger()}}
-          loading={loading}
-        >{btn.label}</Button> : null}
-        {show !== 'actionList' ? <Button
-          type="link"
-          title={disabled ? (btn.reason || '') : (show === 'icon' ? btn.label : '')}
+        <Button
+          type={type}
+          title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')}
           loading={loading}
           disabled={disabled}
           style={btn.style}
           icon={icon}
+          className={className}
           onClick={() => {this.actionTrigger()}}
-        >{label}</Button> : null}
+        >{label}</Button>
         {this.getPop()}
       </div>
     )

--
Gitblit v1.8.0