From 9e39c53e5cec0f5a98a2d805aeda7c2d87060633 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 29 七月 2021 15:18:12 +0800
Subject: [PATCH] 2021-07-29

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

diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx
index c519a94..8b5b86b 100644
--- a/src/tabviews/zshare/actionList/popupbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx
@@ -2,7 +2,7 @@
 import PropTypes from 'prop-types'
 import {connect} from 'react-redux'
 import { is, fromJS } from 'immutable'
-import { Button, Modal, notification } from 'antd'
+import { Button, Modal, notification, Icon } from 'antd'
 
 import asyncSpinComponent from '@/utils/asyncSpinComponent'
 import zhCN from '@/locales/zh-CN/main.js'
@@ -196,6 +196,21 @@
     const { btn, show } = this.props
     const { loading, popData, primaryId, disabled } = this.state
 
+    let label = ''
+    let icon = ''
+
+    if (show === 'button') {
+      label = btn.label
+      icon = btn.icon || ''
+    } else if (show === 'link') {
+      label = <span>{btn.label}{btn.icon ? <Icon type={btn.icon}/> : ''}</span>
+      icon = ''
+    } else if (show === 'icon') {
+      icon = btn.icon || ''
+    } else if (show === 'text') {
+      label = btn.label
+    }
+
     return (
       <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}>
         {show === 'actionList' ? <Button
@@ -211,9 +226,9 @@
           loading={loading}
           disabled={disabled}
           style={btn.style}
-          icon={show === 'text' ? '' : (btn.icon || '')}
+          icon={icon}
           onClick={() => {this.actionTrigger()}}
-        >{show === 'icon' && btn.icon ? '' : btn.label}</Button> : null}
+        >{label}</Button> : null}
         <Modal
           className={'popview-modal ' + (btn.$view === 'CustomPage' ? 'custom-popview' : '')}
           title={btn.label}

--
Gitblit v1.8.0