| | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import PasteForm from '@/templates/zshare/pasteform' |
| | | import ReplaceForm from '@/templates/zshare/replaceform' |
| | | import TransferForm from '@/templates/zshare/basetransferform' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | |
| | | thawVisible: false, |
| | | thawbtnlist: null, |
| | | pasteVisible: false, |
| | | replaceVisible: false |
| | | } |
| | | |
| | | handleMenuClick = e => { |
| | |
| | | this.handleThaw() |
| | | } else if (e.key === 'paste') { |
| | | this.setState({pasteVisible: true}) |
| | | } else if (e.key === 'replace') { |
| | | this.setState({replaceVisible: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | replaceSubmit = () => { |
| | | this.replaceFormRef.handleConfirm().then(res => { |
| | | this.props.refresh({ |
| | | type: 'replace', |
| | | ...res |
| | | }) |
| | | this.setState({ |
| | | replaceVisible: false |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { MenuID } = this.props |
| | | const { dict } = this.state |
| | |
| | | <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.Item key="replace"><Icon type="retweet" />替换</Menu.Item> */} |
| | | </Menu> |
| | | ) |
| | | |
| | |
| | | <PasteForm |
| | | dict={dict} |
| | | wrappedComponentRef={(inst) => this.pasteFormRef = inst} |
| | | /> |
| | | </Modal> |
| | | {/* 替换 */} |
| | | <Modal |
| | | title={'替换'} |
| | | visible={this.state.replaceVisible} |
| | | width={600} |
| | | maskClosable={false} |
| | | onOk={this.replaceSubmit} |
| | | onCancel={() => {this.setState({replaceVisible: false})}} |
| | | destroyOnClose |
| | | > |
| | | <ReplaceForm |
| | | dict={dict} |
| | | inputSubmit={this.replaceSubmit} |
| | | wrappedComponentRef={(inst) => this.replaceFormRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |