| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Radio, Modal } from 'antd' |
| | | import { PaperClipOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import { Radio, Modal, message } from 'antd' |
| | | import { PaperClipOutlined, DeleteOutlined, CopyOutlined } from '@ant-design/icons' |
| | | |
| | | import InputForm from './inputform' |
| | | import './index.scss' |
| | |
| | | this.props.onChange('') |
| | | } |
| | | |
| | | copyUrl = () => { |
| | | const { url } = this.state |
| | | |
| | | let oInput = document.createElement('input') |
| | | oInput.value = url |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | document.body.removeChild(oInput) |
| | | message.success('复制成功。') |
| | | } |
| | | |
| | | handleChange = (key) => { |
| | | this.setState({visible: key}) |
| | | } |
| | |
| | | {url && type === 'video' ? <div className="mk-source-item-info"> |
| | | <PaperClipOutlined /> |
| | | <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> |
| | | <CopyOutlined title="复制链接" onClick={this.copyUrl}/> |
| | | <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | | {url && type !== 'video' && url !== '@icon@' ? <div className="mk-source-item-info picture"> |
| | | <img src={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)} alt="" /> |
| | | <a target="_blank" rel="noopener noreferrer" href={url.replace(/@mywebsite@\//ig, window.GLOB.baseurl)}>{name}</a> |
| | | <CopyOutlined title="复制链接" onClick={this.copyUrl}/> |
| | | <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/> |
| | | </div> : null} |
| | | {url && type !== 'video' && url === '@icon@' ? <div className="mk-source-item-info avatar"> |
| | |
| | | </div> : null} |
| | | <Modal |
| | | visible={!!visible} |
| | | width={visible !== 'system' ? 650 : 1000} |
| | | width={visible !== 'system' ? 650 : 1200} |
| | | closable={false} |
| | | maskClosable={false} |
| | | centered={visible === 'system'} |
| | | okText="确定" |
| | | cancelText="取消" |
| | | onOk={this.popSubmit} |