|
|
|
@ -119,6 +119,30 @@ class InfosTopics extends Component{
|
|
|
|
|
checkBoxValues:checkedValues
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updatedlist=(updatedtype)=>{
|
|
|
|
|
let {sort_by,sort_direction}=this.state;
|
|
|
|
|
if(updatedtype===sort_by){
|
|
|
|
|
if(sort_direction==="desc"){
|
|
|
|
|
this.setState({
|
|
|
|
|
sort_direction:"asc",
|
|
|
|
|
sort_by:updatedtype
|
|
|
|
|
})
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
sort_direction:"desc",
|
|
|
|
|
sort_by:updatedtype
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
sort_direction:"desc",
|
|
|
|
|
sort_by:updatedtype
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
render(){
|
|
|
|
|
let{
|
|
|
|
|
category,
|
|
|
|
@ -126,7 +150,8 @@ class InfosTopics extends Component{
|
|
|
|
|
isSpin,
|
|
|
|
|
data,
|
|
|
|
|
page,
|
|
|
|
|
sort_direction
|
|
|
|
|
sort_direction,
|
|
|
|
|
sort_by
|
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
let categorylist=[
|
|
|
|
@ -140,21 +165,21 @@ class InfosTopics extends Component{
|
|
|
|
|
|
|
|
|
|
let types=this.props.match.params.topicstype;
|
|
|
|
|
|
|
|
|
|
console.log(types)
|
|
|
|
|
console.log(sort_by)
|
|
|
|
|
|
|
|
|
|
//types===publicly 公共
|
|
|
|
|
//types===personal 私有
|
|
|
|
|
|
|
|
|
|
const menu = (
|
|
|
|
|
<Menu>
|
|
|
|
|
<Menu.Item>
|
|
|
|
|
<span>最近更新</span>
|
|
|
|
|
<Menu.Item onClick={()=>this.updatedlist("updated_at")}>
|
|
|
|
|
最近更新
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
<Menu.Item>
|
|
|
|
|
<span>题目更新</span>
|
|
|
|
|
<Menu.Item onClick={()=>this.updatedlist("name")}>
|
|
|
|
|
题目更新
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
{types==="publicly"?<Menu.Item>
|
|
|
|
|
<span>贡献者</span>
|
|
|
|
|
{types==="publicly"?<Menu.Item onClick={()=>this.updatedlist("contributor")}>
|
|
|
|
|
贡献者
|
|
|
|
|
</Menu.Item>:""}
|
|
|
|
|
</Menu>
|
|
|
|
|
);
|
|
|
|
@ -245,7 +270,7 @@ class InfosTopics extends Component{
|
|
|
|
|
<p className="font-12 alltopiscright ml25 fr">
|
|
|
|
|
<Dropdown overlay={menu}>
|
|
|
|
|
<span className="fr color-grey-9 mr10 pointer">
|
|
|
|
|
最近更新
|
|
|
|
|
{sort_by==="updated_at"?'最近更新':sort_by==="name"?'题目更新':sort_by==="contributor"?"贡献者":""}
|
|
|
|
|
<sapn className="relativef ml20">
|
|
|
|
|
<i className={sort_direction==="asc"?
|
|
|
|
|
"iconfont icon-sanjiaoxing-up font-12 topsj color-blue" :"iconfont icon-sanjiaoxing-up font-12 topsj"}></i>
|
|
|
|
|