| | |
| | | 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' |
| | |
| | | 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 |
| | |
| | | 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} |