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

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

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