高亮联调

dev_cs
杨树明 5 years ago
parent 41e1d59378
commit f98f112701

@ -15,31 +15,31 @@ class NewShixunModel extends Component{
page:1, page:1,
type:'all', type:'all',
status:'all', status:'all',
search:undefined, keyword:undefined,
order:'desc', order:'desc',
diff:0, diff:0,
limit:15, limit:15,
} }
} }
componentDidMount() { componentDidMount() {
let{page,type,search,order,diff,limit}=this.state; let{page,type,keyword,order,diff,limit}=this.state;
let status=this.props.statustype===undefined?'all':'published'; let status=this.props.statustype===undefined?'all':'published';
this.setState({ this.setState({
status:status status:status
}) })
this.getdatalist(page,type,status,search,order,diff,limit) this.getdatalist(page,type,status,keyword,order,diff,limit)
} }
getdatalist=(page,type,status,search,order,diff,limit,pagetype)=>{ getdatalist=(page,type,status,keyword,order,diff,limit,pagetype)=>{
this.setState({ this.setState({
isspinning:true isspinning:true
}) })
let url="/shixuns/shixun_list.json" let url="/shixun_lists.json"
axios.get(url,{params:{ axios.get(url,{params:{
page, page,
type, type,
status, status,
search, keyword,
order, order,
diff, diff,
limit limit
@ -72,8 +72,8 @@ class NewShixunModel extends Component{
this.setState({ this.setState({
diff:diff diff:diff
}) })
let{page,type,status,search,order,limit}=this.state; let{page,type,status,keyword,order,limit}=this.state;
this.getdatalist(page,type,status,search,order,diff,limit) this.getdatalist(page,type,status,keyword,order,diff,limit)
} }
ItsCourse=(item)=>{ ItsCourse=(item)=>{
@ -130,8 +130,8 @@ class NewShixunModel extends Component{
newallGrouplist.push({page:pageNumber,list:[]}) newallGrouplist.push({page:pageNumber,list:[]})
} }
let{type,status,search,order,diff,limit}=this.state; let{type,status,keyword,order,diff,limit}=this.state;
this.getdatalist(pageNumber,type,status,search,order,diff,limit,"pagetype") this.getdatalist(pageNumber,type,status,keyword,order,diff,limit,"pagetype")
this.setState({ this.setState({
page:pageNumber, page:pageNumber,
allGrouplist:newallGrouplist allGrouplist:newallGrouplist
@ -143,8 +143,8 @@ class NewShixunModel extends Component{
this.setState({ this.setState({
type:value type:value
}) })
let{page,status,search,order,diff,limit}=this.state; let{page,status,keyword,order,diff,limit}=this.state;
this.getdatalist(page,value,status,search,order,diff,limit) this.getdatalist(page,value,status,keyword,order,diff,limit)
} }
updatedlist=(order)=>{ updatedlist=(order)=>{
@ -153,28 +153,28 @@ class NewShixunModel extends Component{
this.setState({ this.setState({
order:"asc" order:"asc"
}) })
let{type,page,status,search,diff,limit}=this.state; let{type,page,status,keyword,diff,limit}=this.state;
this.getdatalist(page,type,status,search,"asc",diff,limit) this.getdatalist(page,type,status,keyword,"asc",diff,limit)
}else{ }else{
this.setState({ this.setState({
order:"desc" order:"desc"
}) })
let{type,page,status,search,diff,limit}=this.state; let{type,page,status,keyword,diff,limit}=this.state;
this.getdatalist(page,type,status,search,"desc",diff,limit) this.getdatalist(page,type,status,keyword,"desc",diff,limit)
} }
} }
setdatafunsval=(e)=>{ setdatafunsval=(e)=>{
this.setState({ this.setState({
search:e.target.value keyword:e.target.value
}) })
} }
setdatafuns=(value)=>{ setdatafuns=(value)=>{
this.setState({ this.setState({
search:value, keyword:value,
type:undefined, type:undefined,
page:1, page:1,
status:'all', status:'all',
@ -265,8 +265,8 @@ class NewShixunModel extends Component{
this.setState({ this.setState({
status:status status:status
}) })
let{page,type,search,order,diff,limit}=this.state; let{page,type,keyword,order,diff,limit}=this.state;
this.getdatalist(page,type,status,search,order,diff,limit) this.getdatalist(page,type,status,keyword,order,diff,limit)
} }
render() { render() {
@ -363,7 +363,7 @@ class NewShixunModel extends Component{
style={{ width: "800px"}} style={{ width: "800px"}}
className="packinput" className="packinput"
placeholder="实训信息 / 院校名称 / 创建者" placeholder="实训信息 / 院校名称 / 创建者"
value={this.state.search} value={this.state.keyword}
enterButton={<span>搜索</span>} enterButton={<span>搜索</span>}
onInput={(e)=>this.setdatafunsval(e)} onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} /> onSearch={ (value)=>this.setdatafuns(value)} />
@ -420,13 +420,13 @@ class NewShixunModel extends Component{
className="fl task-hide edu-txt-left mt3" className="fl task-hide edu-txt-left mt3"
name="shixun_homework[]" name="shixun_homework[]"
></Checkbox> ></Checkbox>
<a target="_blank" href={`/shixuns/${item.identifier}/challenges`} title={item.title} className="ml15 fl font-16 color-dark maxwidth1100"> <a target="_blank" href={`/shixuns/${item.identifier}/challenges`} title={item.title} className="ml15 fl font-16 color-dark maxwidth1100"
{item.title} dangerouslySetInnerHTML={{__html: item.title}}
>
</a> </a>
<div className="cl"></div> <div className="cl"></div>
{JSON.stringify(item.content) == "{}"?"":<div className="newshixunmodelmidfont"> {JSON.stringify(item.description) == "{}"?"":<div className="newshixunmodelmidfont" dangerouslySetInnerHTML={{__html: item.description}}>
{/*{item.description}*/}
</div>} </div>}
{item.challenge_names.length===0?"":<div className="newshixunmodelbotfont"> {item.challenge_names.length===0?"":<div className="newshixunmodelbotfont">

@ -149,6 +149,14 @@
color: #999999; color: #999999;
margin-top: 15px; margin-top: 15px;
margin-left: 30px; margin-left: 30px;
overflow: hidden;
-o-text-overflow: ellipsis;
text-overflow: ellipsis;
max-width: 1100px;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
} }
.newshixunmodelbotfont{ .newshixunmodelbotfont{
@ -237,3 +245,8 @@
.mt3 { .mt3 {
margin-top: 3px !important; margin-top: 3px !important;
} }
.highlight{
color: #4CACFF;
}

Loading…
Cancel
Save