|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { Link } from "react-router-dom";
|
|
|
|
|
import { markdownToHTML, configShareForCustom} from 'educoder'
|
|
|
|
|
import { markdownToHTML, configShareForCustom,getImageUrl} from 'educoder'
|
|
|
|
|
import { Divider, Tooltip } from 'antd';
|
|
|
|
|
import LoadingSpin from '../../../../common/LoadingSpin';
|
|
|
|
|
import 'antd/lib/pagination/style/index.css';
|
|
|
|
@ -23,7 +23,8 @@ class Challengesjupyter extends Component {
|
|
|
|
|
booljupyterurls:false,
|
|
|
|
|
loading:false,
|
|
|
|
|
boxoffsetHeigh:0,
|
|
|
|
|
opentitletype:true
|
|
|
|
|
opentitletype:true,
|
|
|
|
|
isopentitletype:"Less",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -41,6 +42,11 @@ class Challengesjupyter extends Component {
|
|
|
|
|
ChallengesDataList: response.data,
|
|
|
|
|
sumidtype: false,
|
|
|
|
|
});
|
|
|
|
|
if(response.data.description=== ""||response.data.description===null||response.data.description===undefined){
|
|
|
|
|
this.setState({
|
|
|
|
|
isopentitletype:"Less",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
@ -55,13 +61,15 @@ class Challengesjupyter extends Component {
|
|
|
|
|
let box=document.getElementById("shixunchallengesid");
|
|
|
|
|
if(box){
|
|
|
|
|
boxoffsetHeigh=box.offsetHeight
|
|
|
|
|
if(boxoffsetHeigh<260){
|
|
|
|
|
if(boxoffsetHeigh<300){
|
|
|
|
|
this.setState({
|
|
|
|
|
opentitletype:false,
|
|
|
|
|
isopentitletype:"Less",
|
|
|
|
|
boxoffsetHeigh:boxoffsetHeigh
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
isopentitletype:"greater",
|
|
|
|
|
opentitletype:true,
|
|
|
|
|
boxoffsetHeigh:boxoffsetHeigh
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
@ -229,7 +237,7 @@ class Challengesjupyter extends Component {
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
#shixunchallengesid{
|
|
|
|
|
max-height: 260px;
|
|
|
|
|
max-height: 300px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
@ -239,9 +247,22 @@ class Challengesjupyter extends Component {
|
|
|
|
|
|
|
|
|
|
<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>
|
|
|
|
|
}
|
|
|
|
|
{/*{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":*/}
|
|
|
|
|
{/* <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>*/}
|
|
|
|
|
{/*}*/}
|
|
|
|
|
|
|
|
|
|
{ChallengesDataList === undefined || ChallengesDataList&&ChallengesDataList.description=== ""||ChallengesDataList&&ChallengesDataList.description===null||ChallengesDataList&&ChallengesDataList.description===undefined?
|
|
|
|
|
<div className="edu-tab-con-box clearfix edu-txt-center">
|
|
|
|
|
{this.props.identity < 5?<img className="newedu-nodata-img mb20"
|
|
|
|
|
src={getImageUrl("images/educoder/shixunnodata.png")} />:<img className="edu-nodata-img mb20"
|
|
|
|
|
src={getImageUrl("images/educoder/nodata.png")} />}
|
|
|
|
|
<p className="edu-nodata-p mb80">暂时还没有相关数据哦!</p>
|
|
|
|
|
</div>
|
|
|
|
|
:<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>}
|
|
|
|
|
</p>
|
|
|
|
|
{
|
|
|
|
|
booljupyterurls===true?
|
|
|
|
@ -259,7 +280,7 @@ class Challengesjupyter extends Component {
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
|
|
|
|
|
{this.state.isopentitletype==="Less"?"":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>
|
|
|
|
|