king
2022-06-18 fe21d23b147ed5cec22b4f76a88840b05495d4ad
src/menu/components/share/sourcecomponent/index.jsx
@@ -1,7 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Radio, Icon, Modal } from 'antd'
import { Radio, Modal } from 'antd'
import { PaperClipOutlined, DeleteOutlined } from '@ant-design/icons'
import InputForm from './inputform'
import './index.scss'
@@ -60,6 +61,7 @@
    const { url, visible } = this.state
    const { type } = this.props
    let name = url ? url.slice(url.lastIndexOf('/') + 1) : ''
    // url !== '@icon@'
    return (
      <div className="mk-source-wrap">
@@ -68,10 +70,19 @@
          <Radio.Button value="upload" size="small" onClick={() => this.handleChange('upload')}>上传</Radio.Button>
          <Radio.Button value="system" size="small" onClick={() => this.handleChange('system')}>系统</Radio.Button>
        </Radio.Group> : null}
        {url ? <div className={'mk-source-item-info' + (type !== 'video' ? ' picture' : '')}>
          {type === 'video' ? <Icon type="paper-clip" /> : <img src={url} alt="" />}
        {url && type === 'video' ? <div className="mk-source-item-info">
          <PaperClipOutlined />
          <a target="_blank" rel="noopener noreferrer" href={url}>{name}</a>
          <Icon title="删除文件" type="delete" onClick={this.deleteUrl}/>
          <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/>
        </div> : null}
        {url && type !== 'video' && url !== '@icon@' ? <div className="mk-source-item-info picture">
          <img src={url} alt="" />
          <a target="_blank" rel="noopener noreferrer" href={url}>{name}</a>
          <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/>
        </div> : null}
        {url && type !== 'video' && url === '@icon@' ? <div className="mk-source-item-info avatar">
          <span className="mk-avatar">{name}</span>
          <DeleteOutlined title="删除文件" onClick={this.deleteUrl}/>
        </div> : null}
        <Modal
          visible={!!visible}