dev_aliyun_beta
杨树明 5 years ago
parent f72e3fecf8
commit 713e2a3229

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch,Link} from 'react-router-dom';
import {Tooltip,Menu,Pagination,Spin, Dropdown} from 'antd';
import {Tooltip,Menu,Pagination,Spin, Dropdown,Checkbox} from 'antd';
import axios from 'axios';
import {getImageUrl,WordsBtn} from 'educoder';
import moment from 'moment';
@ -21,7 +21,8 @@ class InfosTopics extends Component{
sort_by:"updated_at",
sort_direction:"desc",
page:1,
data:undefined
data:undefined,
checkBoxValues:[]
}
}
@ -112,13 +113,20 @@ class InfosTopics extends Component{
)
}
onCheckBoxChange=(checkedValues)=>{
debugger
this.setState({
checkBoxValues:checkedValues
})
}
render(){
let{
category,
course_list_id,
isSpin,
data,
page
page,
sort_direction
} = this.state;
let categorylist=[
@ -140,20 +148,14 @@ class InfosTopics extends Component{
const menu = (
<Menu>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">
1st menu item
</a>
<span>最近更新</span>
</Menu.Item>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">
2nd menu item
</a>
</Menu.Item>
<Menu.Item>
<a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">
3rd menu item
</a>
<span>题目更新</span>
</Menu.Item>
{types==="publicly"?<Menu.Item>
<span>贡献者</span>
</Menu.Item>:""}
</Menu>
);
return(
@ -206,8 +208,10 @@ class InfosTopics extends Component{
<div className="clearfix topicsbox">
<div className={"topcschild"}>
<a className={types==="personal"?"topicstopfont fl topcsactive":"topicstopfont fl"}
href={`/users/innov/topics/publicly`}>我的题库</a>
<a className={types==="publicly"?"topicstopfont fr topcsactive":"topicstopfont fr"}>公共题库</a>
href={`/users/innov/topics/personal`}>我的题库</a>
<a className={types==="publicly"?"topicstopfont fr topcsactive":"topicstopfont fr"}
href={`/users/innov/topics/publicly`}
>公共题库</a>
</div>
@ -233,14 +237,22 @@ class InfosTopics extends Component{
</div>
<div className="clearfix font-12 mb20 mt20">
<div className="clearfix font-12 mt20">
<p className="font-12 alltopisc ml25 fl">
<span className="fl color-grey-9"> <span className={"color-orange"}>{data&&data.count}</span> </span>
<span className="fr color-grey-9">已选择 <span className={"color-orange"}>{data&&data.count}</span> </span>
<span className="fr color-grey-9">已选择 <span className={"color-orange"}>{this.state.checkBoxValues.length}</span> </span>
</p>
<p className="font-12 alltopiscright ml25 fr">
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer">最近更新</span>
<span className="fr color-grey-9 mr10 pointer">
最近更新
<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>
<i className={sort_direction==="desc"?
"iconfont icon-sanjiaoxing-down font-12 bottomsj color-blue":"iconfont icon-sanjiaoxing-down font-12 bottomsj"}></i>
</sapn>
</span>
</Dropdown>
<span className="fr mr30 topcsactive pointer">发送</span>
{types==="personal"?<span className="fr mr30 topcsactive pointer">删除</span>:""}
@ -248,21 +260,21 @@ class InfosTopics extends Component{
</div>
{data===undefined?<NoneData></NoneData>:data.question_banks===undefined||data.question_banks.length===0?<NoneData></NoneData>:data.question_banks.map((item,key)=>{
return(
{data===undefined?<NoneData></NoneData>:data.question_banks===undefined||data.question_banks.length===0?<NoneData></NoneData>:
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={this.state.checkBoxValues}>
{data.question_banks.map((item,key)=>{
return(
<div className="mt20 edu-back-white pd1323 relativef" key={key} >
<div className="clearfix">
{/*id: 4269*/}
<div className="item-body">
<div className="clearfix ds pr pt5 contentSection" >
<a title={item.name} className="fl mt3 font-16 color-dark maxwidth580">
<Checkbox value={item.id} className={"fl mt5"}></Checkbox>
<a title={item.name} className="ml10 fl mt3 font-16 color-dark maxwidth900">
{item.name}
</a>
{item.is_public===false?<span className="edu-filter-btn ml15 fl typestyle mt7 topiscfilterbtn">公开</span>:""}
{item.is_public===false?<span className="edu-filter-btn ml15 fl typestyle mt3 topiscfilterbtn">公开</span>:""}
{types==="personal"&&item.is_public===false?<a className="btn colorblue mr25 fr font-16">设为公开</a>:""}
@ -270,7 +282,7 @@ class InfosTopics extends Component{
<p className="color-grey panel-lightgrey mt16 fl">
<span className={types==="personal"?"topicswidth300":"topicswidth400"}>
{types==="publicly"?<span className="topsics125 color-grey9">{item.creator_name}</span>:""}
{types==="publicly"?<span className="topsics100 color-grey9">{item.creator_name}</span>:""}
<span className="mr50 color-grey9">{item.quotes_count} 次引用</span>
<span className="mr50 color-grey9">{item.solve_count} 次答题</span>
<span className="mr50 color-grey9">{moment(item.updated_at).fromNow()}</span>
@ -287,6 +299,8 @@ class InfosTopics extends Component{
</div>
</div>
)})}
</Checkbox.Group>
}
{
data&&data.count >15 &&

@ -281,7 +281,7 @@
}
.topcsactive{
color: #4CACFF;
color: #4CACFF !important;
}
.topicsmidfont{
@ -325,7 +325,7 @@
}
.pd1323{
padding: 10px 30px 25px 30px;
padding: 10px 6px 25px 40px;
cursor: pointer;
}
.pd1323:hover {
@ -350,13 +350,13 @@
}
.topscisright{
right: -2px;
right: 0px;
top: 50px;
display: block;
position: absolute;
}
.topsics125{
width: 125px;
.topsics100{
width: 100px;
display: inline-block;
}
Loading…
Cancel
Save