| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Button, notification, Modal } from 'antd' |
| | | import { Button, notification, Modal, Icon } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | |
| | | localStorage.setItem('localDataM', res.dataM ? 'true' : '') |
| | | localStorage.setItem('debug', res.debug || '') |
| | | localStorage.setItem('role_id', res.role_id || '') |
| | | localStorage.setItem('departmentcode', res.departmentcode || '') |
| | | localStorage.setItem('organization', res.organization || '') |
| | | localStorage.setItem('localRole_id', res.role_id || '') |
| | | |
| | | sessionStorage.removeItem('CloudAvatar') |
| | |
| | | >{btn.label}</Button> |
| | | ) |
| | | } else { // icon、text、 all 卡片 |
| | | let label = '' |
| | | let icon = '' |
| | | |
| | | if (show === 'button') { |
| | | label = btn.label |
| | | icon = btn.icon || '' |
| | | } else if (show === 'link') { |
| | | label = <span>{btn.label}{btn.icon ? <Icon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | icon = '' |
| | | } else if (show === 'icon') { |
| | | icon = btn.icon || '' |
| | | // } else if (show === 'text') { |
| | | } else { |
| | | label = btn.label |
| | | } |
| | | |
| | | return ( |
| | | <Button |
| | | type="link" |
| | |
| | | loading={loading} |
| | | disabled={disabled} |
| | | style={btn.style} |
| | | icon={show === 'text' ? '' : (btn.icon || '')} |
| | | icon={icon} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{show === 'icon' && btn.icon ? '' : btn.label}</Button> |
| | | >{label}</Button> |
| | | ) |
| | | } |
| | | } |