图片显示

dev_aliyun2
杨树林 5 years ago committed by harry
parent 3201f44b74
commit a5ebf596e3

@ -18,6 +18,7 @@ import LoadingSpin from '../../../common/LoadingSpin';
import Contentquestionbank from "./Contentquestionbank";
import Listjihe from "./Listjihe";
import Certifiedprofessional from "../../modals/Certifiedprofessional";
import QuestionModalys from '../component/QuestionModalPicture.js'
const { TabPane } = Tabs;
const Search = Input.Search;
class Contentpart extends Component {
@ -28,12 +29,25 @@ class Contentpart extends Component {
chakanjiexibool:false,
mydisplay:false,
occupation:2,
url: ""
}
}
//初始化
componentDidMount() {
}
handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
// setUrl(url);
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
chakanjiexibool = (index) => {
@ -128,7 +142,7 @@ class Contentpart extends Component {
}
render() {
let {page,mydisplay}=this.state;
let {page,mydisplay,url}=this.state;
let {defaultActiveKey,item_type,booljupyterurls}=this.props;
const defaultActiveKeys=defaultActiveKey+'';
let isysladmins=false;
@ -184,6 +198,11 @@ class Contentpart extends Component {
return (
<div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s">
{url?
<QuestionModalys {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalys>
:
""
}
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
@ -386,6 +405,9 @@ class Contentpart extends Component {
showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
handleShowUploadImage={(e)=>this.handleShowUploadImage(e)}
handleClose={()=>this.handleClose()}
>
</Listjihe>

@ -2,7 +2,8 @@ import React, { Component } from "react";
import { markdownToHTML } from 'educoder';
import {
Radio,
Tooltip
Tooltip,
Icon
} from "antd";
import './../questioncss/questioncom.css';
import QuillForEditor from "../../../common/quillForEditor";
@ -25,6 +26,7 @@ class Listjihe extends Component {
page: 1,
name: "单选题",
nd: "简单",
url: ""
}
}
@ -33,7 +35,21 @@ class Listjihe extends Component {
}
handleShowUploadImage = (url) => {
try {
this.props.handleShowUploadImage(url);
}catch (e) {
}
}
handleClose=()=>{
try {
this.props.handleClose();
}catch (e) {
}
}
//选用
Selectingpracticaltraining = (id) => {
let data = {}
@ -57,9 +73,11 @@ class Listjihe extends Component {
}
render() {
let { page, name, nd } = this.state;
let { defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex } = this.props;
let {page, name, nd,url} = this.state;
let {defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex} = this.props;
// 编程答案
var rightkey = null
@ -185,11 +203,26 @@ class Listjihe extends Component {
}
return (
<div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}>
{/*顶部*/}
<style>
{
`
`
}
</style>
{/* 显示上传的图片信息 */}
{/*<div className="show_upload_image" style={{ display: url ? 'block' : 'none'}}>*/}
{/* <Icon type="close" className="image_close" onClick={()=>this.handleClose()}/>*/}
{/* <div className="image_info">*/}
{/* <img className="image" src={url} alt=""/>*/}
{/* </div>*/}
{/*</div>*/}
<style>
{
` .markdown-body .ql-editor{
@ -240,6 +273,7 @@ class Listjihe extends Component {
<QuillForEditor
readOnly={true}
value={itemssname}
showUploadImage={this.handleShowUploadImage}
/>
:""
}
@ -277,6 +311,7 @@ class Listjihe extends Component {
<QuillForEditor
readOnly={true}
value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/>
}
</p>
@ -310,6 +345,7 @@ class Listjihe extends Component {
<QuillForEditor
readOnly={true}
value={string}
showUploadImage={this.handleShowUploadImage}
/>
:""
@ -527,6 +563,7 @@ class Listjihe extends Component {
imgAttrs={{width: '60px', height: '30px'}}
readOnly={true}
value={analysisnames}
showUploadImage={this.handleShowUploadImage}
/>
:
"暂无解析"

@ -0,0 +1,44 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,Icon} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
import './../../../common/components/comment/index.scss';
//立即申请试用
class QuestionModalys extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title=""
centered={true}
visible={this.props.url?true:false}
width="442px"
>
{/* 显示上传的图片信息 */}
<div className="show_upload_image" style={{ display: this.props.url ? 'block' : 'none'}}>
<Icon type="close" className="image_close" onClick={this.props.handleClose}/>
<div className="image_info">
<img className="image" src={ this.props.url} alt=""/>
</div>
</div>
</Modal>
)
}
}
export default QuestionModalys;
Loading…
Cancel
Save