|
|
@ -1,22 +1,18 @@
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import ReactDOM from 'react-dom'
|
|
|
|
import ReactDOM from 'react-dom'
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
import Rate from 'rc-rate';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import './TaskResultLayer.css'
|
|
|
|
import './TaskResultLayer.css'
|
|
|
|
|
|
|
|
|
|
|
|
class ImageLayer extends Component {
|
|
|
|
class ImageLayer extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let { showImage, imageSrc, onImageLayerClose } = this.props;
|
|
|
|
let { showImage, imageSrc, onImageLayerClose } = this.props;
|
|
|
|
|
|
|
|
|
|
|
|
// 语法介绍 https://reactjs.org/docs/portals.html
|
|
|
|
// 语法介绍 https://reactjs.org/docs/portals.html
|
|
|
|
// 将html渲染都指定的element下
|
|
|
|
// 将html渲染都指定的element下
|
|
|
|
return ReactDOM.createPortal(
|
|
|
|
return ReactDOM.createPortal(
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
{showImage ?
|
|
|
|
{showImage ?
|
|
|
|
<div className="taskResultLayer" onClick={onImageLayerClose} style={{overflow: 'auto'}}>
|
|
|
|
<div className="taskResultLayer" onClick={onImageLayerClose} style={{overflow: 'auto'}}>
|
|
|
|
<div className="passContent">
|
|
|
|
<div className="passContent">
|
|
|
|
<img src={ imageSrc } className="passImg" unselectable="on" alt=""/>
|
|
|
|
<img src={ imageSrc } className="passImg" unselectable="on" alt=""/>
|
|
|
|