king
2021-12-21 2eaada6f6f71abfc90ccaeb6e3c471e42ae427da
src/tabviews/iframe/index.jsx
@@ -1,6 +1,5 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Button, message } from 'antd'
import MKEmitter from '@/utils/events.js'
class Iframe extends Component {
@@ -12,8 +11,7 @@
  }
  state = {
    visible: true,
    debug: sessionStorage.getItem('debug') === 'true'
    visible: true
  }
  componentDidMount () {
@@ -40,31 +38,11 @@
    })
  }
  copyMenuNo = (e) => {
    const { MenuNo } = this.props
    e.stopPropagation()
    let oInput = document.createElement('input')
    oInput.value = MenuNo || ''
    document.body.appendChild(oInput)
    oInput.select()
    document.execCommand('Copy')
    oInput.className = 'oInput'
    oInput.style.display = 'none'
    message.success('复制成功')
  }
  render () {
    const { visible, debug } = this.state
    const { visible } = this.state
    
    return (<div>
      {visible ? <iframe title={this.props.title} src={this.props.url} /> : null}
      {debug ? <Button
        icon="copy"
        shape="circle"
        className={'main-copy ifr-copy'}
        onClick={this.copyMenuNo}
      /> : null}
    </div>)
  }
}