| | |
| | | |
| | | let eTDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | const EditableContext = React.createContext() |
| | | const { confirm } = Modal |
| | | let dragingIndex = -1 |
| | | const { Paragraph } = Typography |
| | | |
| | |
| | | operation = { |
| | | title: (<div> |
| | | {eTDict['model.operation']} |
| | | {actions.includes('copy') ? ( |
| | | <span className="copy-control"> |
| | | <Icon type="copy" onClick={() => this.copy()} /> |
| | | <Icon type="snippets" onClick={this.paste} /> |
| | | </span> |
| | | ) : null} |
| | | <span className="copy-control"> |
| | | {actions.includes('copy') ? <Icon type="copy" title="复制" onClick={() => this.copy()} /> : null} |
| | | {actions.includes('copy') ? <Icon type="snippets" title="粘贴" onClick={this.paste} /> : null} |
| | | {actions.includes('clear') ? <Icon type="delete" title="清空" onClick={this.clear} /> : null} |
| | | </span> |
| | | </div>), |
| | | dataIndex: 'operation', |
| | | width: '140px', |
| | |
| | | this.setState({ editingKey: '' }) |
| | | } |
| | | |
| | | clear = () => { |
| | | const _this = this |
| | | |
| | | confirm({ |
| | | title: '确定清空列表吗?', |
| | | content: '', |
| | | onOk() { |
| | | _this.setState({ data: [], editingKey: '' }, () => { |
| | | _this.props.onChange([]) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | copy = (item) => { |
| | | const { type } = this.props |
| | | const { data } = this.state |