|
|
@ -1,18 +1,12 @@
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';;
|
|
|
|
|
|
|
|
|
|
|
|
import { Redirect } from 'react-router';
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
|
|
|
|
|
|
|
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 { getImageUrl ,markdownToHTML, configShareForCustom} from 'educoder'
|
|
|
|
|
|
|
|
|
|
|
|
import { CircularProgress } from 'material-ui/Progress';
|
|
|
|
import { CircularProgress } from 'material-ui/Progress';
|
|
|
|
|
|
|
|
|
|
|
|
import { Modal, Spin, Tooltip ,message,Icon,Button} from 'antd';
|
|
|
|
import { Modal, Spin, Tooltip ,message,Icon,Button,Divider} from 'antd';
|
|
|
|
|
|
|
|
|
|
|
|
import 'antd/lib/pagination/style/index.css';
|
|
|
|
import 'antd/lib/pagination/style/index.css';
|
|
|
|
|
|
|
|
|
|
|
@ -39,6 +33,8 @@ class Challenges extends Component {
|
|
|
|
hidestartshixunsreplacevalue:"",
|
|
|
|
hidestartshixunsreplacevalue:"",
|
|
|
|
operationstrue:false,
|
|
|
|
operationstrue:false,
|
|
|
|
isSpin:false,
|
|
|
|
isSpin:false,
|
|
|
|
|
|
|
|
boxoffsetHeigh:0,
|
|
|
|
|
|
|
|
opentitletype:true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -64,9 +60,32 @@ class Challenges extends Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
setTimeout(this.ChallengesList(), 1000);
|
|
|
|
this.ChallengesList()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
updatamakedown = (id) => {
|
|
|
|
updatamakedown = (id) => {
|
|
|
|
setTimeout(() => {
|
|
|
|
setTimeout(() => {
|
|
|
|
var shixunDescr = window.editormd.markdownToHTML(id, {
|
|
|
|
var shixunDescr = window.editormd.markdownToHTML(id, {
|
|
|
@ -301,6 +320,12 @@ class Challenges extends Component {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
opentitle=()=>{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
opentitletype:!this.state.opentitletype
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state;
|
|
|
|
let { ChallengesDataList, startbtns, sumidtype ,startshixunCombattype,shixunsreplace,shixunsmessage,hidestartshixunsreplacevalue,operationstrue,AccountProfiletype} = this.state;
|
|
|
|
let { loadingContent } = this.props;
|
|
|
|
let { loadingContent } = this.props;
|
|
|
@ -378,8 +403,18 @@ class Challenges extends Component {
|
|
|
|
this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943"
|
|
|
|
this.props.identity < 5?<a className="fr font-14 color-blue mr20" href="/forums/2943"
|
|
|
|
target="_blank">实训制作指南</a> : "":""}
|
|
|
|
target="_blank">实训制作指南</a> : "":""}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{this.state.opentitletype===true?<style>
|
|
|
|
<div className={"pd20"}>
|
|
|
|
{
|
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
#shixunchallengesid{
|
|
|
|
|
|
|
|
max-height: 260px;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>:""}
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<div className={"pd20"} id={"shixunchallengesid"}>
|
|
|
|
<style>
|
|
|
|
<style>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
`
|
|
|
|
`
|
|
|
@ -389,6 +424,7 @@ class Challenges extends Component {
|
|
|
|
`
|
|
|
|
`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="justify break_full_word new_li "
|
|
|
|
<div className="justify break_full_word new_li "
|
|
|
|
id="challenge_editorMd_description">
|
|
|
|
id="challenge_editorMd_description">
|
|
|
|
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
|
|
|
|
<p id="ReactMarkdown" style={{overflow:'hidden'}}>
|
|
|
@ -398,6 +434,13 @@ class Challenges extends Component {
|
|
|
|
</p>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</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>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
|
|
<div className={"shixunjianjiecballenges edu-back-white"}>
|
|
|
|
<div className={"shixunjianjiecballenges edu-back-white"}>
|
|
|
|