| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Menu, Dropdown, Icon, Modal, Spin, notification } from 'antd' |
| | | import { Modal, Spin, notification, Button } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | thawVisible: false, |
| | | thawbtnlist: null, |
| | | pasteVisible: false, |
| | | } |
| | | |
| | | handleMenuClick = e => { |
| | | if (e.key === 'thaw') { |
| | | this.handleThaw() |
| | | } else if (e.key === 'paste') { |
| | | this.setState({pasteVisible: true}) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | } |
| | | |
| | | handleMenuClick = e => { |
| | | if (e.key === 'thaw') { |
| | | this.handleThaw() |
| | | } else if (e.key === 'paste') { |
| | | this.setState({pasteVisible: true}) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { MenuID } = this.props |
| | | const { dict } = this.state |
| | | const menu = ( |
| | | <Menu onClick={this.handleMenuClick}> |
| | | {MenuID ? <Menu.Item key="thaw"><Icon type="unlock" />{dict['header.form.thawbutton']}</Menu.Item> : null} |
| | | <Menu.Item key="paste"><Icon type="snippets" />{dict['header.form.paste']}</Menu.Item> |
| | | </Menu> |
| | | ) |
| | | |
| | | return ( |
| | | <div style={{display: 'inline-block'}}> |
| | | <Dropdown overlay={menu} overlayClassName="edit-component-box"> |
| | | <span style={{color: '#1890ff', display: 'inline-block', height: 25}}> |
| | | {dict['model.edit']} <Icon type="down" /> |
| | | </span> |
| | | </Dropdown> |
| | | {MenuID ? <Button className="mk-border-green" onClick={this.handleThaw} icon="unlock">{dict['header.form.thawbutton']}</Button> : null} |
| | | <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => this.setState({pasteVisible: true})} icon="snippets">{dict['header.form.paste']}</Button> |
| | | {/* 解冻按钮模态框 */} |
| | | <Modal |
| | | title={dict['header.form.thawbutton']} |