Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

PCqiandao
cxt 5 years ago
commit 687c6a24fd

@ -16,7 +16,7 @@ function ImageLayer2(props) {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href') const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片 // 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim() const fileName = event.target.innerHTML.trim()
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG' || imageSrc.indexOf('base64,') != -1) { if (isImageExtension((imageSrc && imageSrc.trim())) || isImageExtension(fileName) || event.target.tagName == 'IMG' || (imageSrc && imageSrc.indexOf('base64,')) != -1) {
// 非回复里的头像图片; 非emoticons // 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 && if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {

@ -19,7 +19,7 @@ class ImageLayer extends Component {
{showImage ? {showImage ?
<div className="taskResultLayer" onClick={onImageLayerClose} style={{overflow: 'auto'}}> <div className="taskResultLayer" onClick={onImageLayerClose} style={{overflow: 'auto'}}>
<div className="passContent"> <div className="passContent">
<div><img src={ imageSrc } className="passImg" unselectable="on"/></div> <img src={ imageSrc } className="passImg" unselectable="on" alt=""/>
</div> </div>
</div> </div>
: :

@ -22,6 +22,7 @@ import JudquestionEditor from "./component/JudquestionEditor";
import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import actions from "../../redux/actions"; import actions from "../../redux/actions";
import QuestionModalPicture from "./component/QuestionModalPicture";
var restricte=false; var restricte=false;
class Questionitem_banks extends Component { class Questionitem_banks extends Component {
constructor(props) { constructor(props) {
@ -38,6 +39,7 @@ class Questionitem_banks extends Component {
knowledgepoints: [], knowledgepoints: [],
disciplmy:[], disciplmy:[],
pages:1, pages:1,
url:''
} }
@ -526,14 +528,32 @@ class Questionitem_banks extends Component {
this.scrollToAnchor("Itembankstopid"); this.scrollToAnchor("Itembankstopid");
} }
handleShowUploadImage=(url)=>{
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
render() { render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,restricte} = this.state; let {page, limit, count, Headertop, visible, placement, modalsType, item_type,restricte,url} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params); // ////console.log(params);
return ( return (
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
> >
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}
{ {
restricte===false? restricte===false?
<Prompt <Prompt
@ -584,6 +604,7 @@ class Questionitem_banks extends Component {
{...this.state} {...this.state}
{...this.props} {...this.props}
getanswerMdRef={(ref) => this.getanswerMdRef(ref)} getanswerMdRef={(ref) => this.getanswerMdRef(ref)}
handleShowUploadImage={(url)=>this.handleShowUploadImage(url)}
> >
</SingleEditor> </SingleEditor>
@ -594,6 +615,7 @@ class Questionitem_banks extends Component {
{...this.state} {...this.state}
{...this.props} {...this.props}
getanswerMdRef={(ref) => this.getChoquesEditor(ref)} getanswerMdRef={(ref) => this.getChoquesEditor(ref)}
handleShowUploadImage={(url)=>this.handleShowUploadImage(url)}
> >
</ChoquesEditor> </ChoquesEditor>

@ -184,6 +184,12 @@ class ChoquesEditor extends Component{
bindinginputs:i bindinginputs:i
}) })
try {
this.props.handleShowUploadImage(url)
}catch (e) {
}
} }
componentDidMount = () => { componentDidMount = () => {

@ -258,7 +258,11 @@ class SingleEditor extends Component{
url:url, url:url,
bindinginputs:i bindinginputs:i
}) })
try {
this.props.handleShowUploadImage(url)
}catch (e) {
}
} }
bindinginputs=(i)=>{ bindinginputs=(i)=>{
this.setState({ this.setState({

Loading…
Cancel
Save