|
|
|
@ -1,25 +1,11 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
|
|
|
|
|
|
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
|
|
|
|
|
import { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
|
|
|
|
|
|
|
|
|
|
import { CircularProgress } from 'material-ui/Progress';
|
|
|
|
|
|
|
|
|
|
import { Modal, Spin, Tooltip ,message,Icon} from 'antd';
|
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import { markdownToHTML, configShareForCustom} from 'educoder'
|
|
|
|
|
import { Divider, Tooltip } from 'antd';
|
|
|
|
|
import LoadingSpin from '../../../../common/LoadingSpin';
|
|
|
|
|
import 'antd/lib/pagination/style/index.css';
|
|
|
|
|
|
|
|
|
|
import '../shixunchildCss/Challenges.css'
|
|
|
|
|
import ReactDOM from 'react-dom';
|
|
|
|
|
import '../shixunchildCss/Challenges.css';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import AccountProfile from"../../../user/AccountProfile";
|
|
|
|
|
const $ = window.$;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -36,6 +22,8 @@ class Challengesjupyter extends Component {
|
|
|
|
|
username:"",
|
|
|
|
|
booljupyterurls:false,
|
|
|
|
|
loading:false,
|
|
|
|
|
boxoffsetHeigh:0,
|
|
|
|
|
opentitletype:true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -59,7 +47,29 @@ class Challengesjupyter extends Component {
|
|
|
|
|
//console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
componentDidUpdate = (prevProps,prevState) => {
|
|
|
|
|
|
|
|
|
|
//防止陷入无限循环
|
|
|
|
|
if(prevState.ChallengesDataList!=this.state.ChallengesDataList){
|
|
|
|
|
let boxoffsetHeigh;
|
|
|
|
|
let box=document.getElementById("shixunchallengesid");
|
|
|
|
|
if(box){
|
|
|
|
|
boxoffsetHeigh=box.offsetHeight
|
|
|
|
|
if(boxoffsetHeigh<260){
|
|
|
|
|
this.setState({
|
|
|
|
|
opentitletype:false,
|
|
|
|
|
boxoffsetHeigh:boxoffsetHeigh
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
boxoffsetHeigh:boxoffsetHeigh
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
setTimeout(this.ChallengesList(), 1000);
|
|
|
|
|
let id = this.props.match.params.shixunId;
|
|
|
|
@ -178,6 +188,11 @@ class Challengesjupyter extends Component {
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
opentitle=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
opentitletype:!this.state.opentitletype
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
@ -204,33 +219,53 @@ class Challengesjupyter extends Component {
|
|
|
|
|
<div className={"shixunjianjie"}>
|
|
|
|
|
<span className="font-16 fl">简介</span>
|
|
|
|
|
<Tooltip placement="bottom" title={"编辑"}>
|
|
|
|
|
<a style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
|
|
|
|
|
href={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14">
|
|
|
|
|
<Link style={{ display: this.props.identity < 5 && ChallengesDataList&&ChallengesDataList.shixun_status < 3 ? "block" : 'none' }}
|
|
|
|
|
to={"/shixuns/" + id + "/settings?edit=1"} className="fr color-blue font-14">
|
|
|
|
|
编辑
|
|
|
|
|
</a>
|
|
|
|
|
</Link>
|
|
|
|
|
</Tooltip>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={"pd20"}>
|
|
|
|
|
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
|
|
|
|
|
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
|
|
|
|
|
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
|
|
|
|
|
}
|
|
|
|
|
</p>
|
|
|
|
|
{this.state.opentitletype===true?<style>
|
|
|
|
|
{
|
|
|
|
|
booljupyterurls===true?
|
|
|
|
|
(
|
|
|
|
|
this.state.jupyter_url === null?
|
|
|
|
|
<div className="mt50 intermediatecenter juplbool">
|
|
|
|
|
<span className="icon iconfontysl icon-jiazaishibai1"></span>
|
|
|
|
|
<p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训失败,</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}>重新加载</p></p>
|
|
|
|
|
`
|
|
|
|
|
#shixunchallengesid{
|
|
|
|
|
max-height: 260px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>:""}
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div className={"pd20"} id={"shixunchallengesid"}>
|
|
|
|
|
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
|
|
|
|
|
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
|
|
|
|
|
<div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
|
|
|
|
|
}
|
|
|
|
|
</p>
|
|
|
|
|
{
|
|
|
|
|
booljupyterurls===true?
|
|
|
|
|
(
|
|
|
|
|
this.state.jupyter_url === null?
|
|
|
|
|
<div className="mt50 intermediatecenter juplbool">
|
|
|
|
|
<span className="icon iconfontysl icon-jiazaishibai1"></span>
|
|
|
|
|
<p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训失败,</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}>重新加载</p></p>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
)
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
:""
|
|
|
|
|
)
|
|
|
|
|
:""
|
|
|
|
|
}
|
|
|
|
|
{this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
|
|
|
|
|
<a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
|
|
|
|
|
</Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
|
|
|
|
|
<a className={"font-14 color-grey-9"}>收起全文 <i className={"iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-14"}></i></a>
|
|
|
|
|
</Divider>}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<div className="justify break_full_word new_li edu-back-white"
|
|
|
|
|