parent
824d6cdca9
commit
e4c3050827
@ -1,209 +1,209 @@
|
|||||||
import React, { Component } from "react";
|
import React, { Component } from "react";
|
||||||
import { Modal, Checkbox, Input, Spin} from "antd";
|
import { Modal, Checkbox, Input, Spin} from "antd";
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import ModalWrapper from "../../common/ModalWrapper"
|
import ModalWrapper from "../../common/ModalWrapper"
|
||||||
import InfiniteScroll from 'react-infinite-scroller';
|
import InfiniteScroll from 'react-infinite-scroller';
|
||||||
|
|
||||||
const Search = Input.Search
|
const Search = Input.Search
|
||||||
const pageCount = 15;
|
const pageCount = 15;
|
||||||
class SendToCourseModal extends Component{
|
class SendToCourseModal extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
this.state={
|
this.state={
|
||||||
checkBoxValues: [],
|
checkBoxValues: [],
|
||||||
course_lists: [],
|
course_lists: [],
|
||||||
course_lists_after_filter: [],
|
course_lists_after_filter: [],
|
||||||
searchValue: '',
|
searchValue: '',
|
||||||
hasMore: true,
|
hasMore: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
page: 1
|
page: 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fetchCourseList = (arg_page) => {
|
fetchCourseList = (arg_page) => {
|
||||||
const page = arg_page || this.state.page;
|
const page = arg_page || this.state.page;
|
||||||
// search=''&
|
// search=''&
|
||||||
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
|
let url = `/courses/mine.json?page=${page}&page_size=${pageCount}`
|
||||||
const searchValue = this.state.searchValue.trim()
|
const searchValue = this.state.searchValue.trim()
|
||||||
if (searchValue) {
|
if (searchValue) {
|
||||||
url += `&search=${searchValue}`
|
url += `&search=${searchValue}`
|
||||||
}
|
}
|
||||||
this.setState({ loading: true })
|
this.setState({ loading: true })
|
||||||
axios.get(url, {
|
axios.get(url, {
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (!response.data.data || response.data.data.length == 0) {
|
if (!response.data.data || response.data.data.length == 0) {
|
||||||
this.setState({
|
this.setState({
|
||||||
course_lists: page == 1 ? [] : this.state.course_lists,
|
course_lists: page == 1 ? [] : this.state.course_lists,
|
||||||
page,
|
page,
|
||||||
loading: false,
|
loading: false,
|
||||||
hasMore: false,
|
hasMore: false,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
|
course_lists: page == 1 ? response.data.data : this.state.course_lists.concat(response.data.data),
|
||||||
course_lists_after_filter: response.data.data,
|
course_lists_after_filter: response.data.data,
|
||||||
page,
|
page,
|
||||||
loading: false,
|
loading: false,
|
||||||
hasMore: response.data.data.length == pageCount
|
hasMore: response.data.data.length == pageCount
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.fetchCourseList()
|
this.fetchCourseList()
|
||||||
}, 500)
|
}, 500)
|
||||||
|
|
||||||
}
|
}
|
||||||
setVisible = (visible) => {
|
setVisible = (visible) => {
|
||||||
this.refs.modalWrapper.setVisible(visible)
|
this.refs.modalWrapper.setVisible(visible)
|
||||||
if (visible == false) {
|
if (visible == false) {
|
||||||
this.setState({
|
this.setState({
|
||||||
checkBoxValues: []
|
checkBoxValues: []
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSendOk = () => {
|
onSendOk = () => {
|
||||||
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
|
if (!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
|
||||||
this.props.showNotification('请先选择要发送至的课堂')
|
this.props.showNotification('请先选择要发送至的课堂')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this.props.url==="/files/bulk_send.json"){
|
if(this.props.url==="/files/bulk_send.json"){
|
||||||
axios.post("/files/bulk_send.json", {
|
axios.post("/files/bulk_send.json", {
|
||||||
course_id:this.props.match.params.coursesId,
|
course_id:this.props.match.params.coursesId,
|
||||||
ids: this.props.selectedMessageIds,
|
ids: this.props.selectedMessageIds,
|
||||||
to_course_ids: this.state.checkBoxValues
|
to_course_ids: this.state.checkBoxValues
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data.status == 0) {
|
if (response.data.status == 0) {
|
||||||
this.setVisible(false)
|
this.setVisible(false)
|
||||||
this.props.gobackonSend(response.data.message)
|
this.props.gobackonSend(response.data.message)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
const bid = this.props.match.params.boardId
|
const bid = this.props.match.params.boardId
|
||||||
const url = `/boards/${bid}/messages/bulk_send.json`
|
const url = `/boards/${bid}/messages/bulk_send.json`
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
ids: this.props.selectedMessageIds,
|
ids: this.props.selectedMessageIds,
|
||||||
to_course_ids: this.state.checkBoxValues
|
to_course_ids: this.state.checkBoxValues
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.data.status == 0) {
|
if (response.data.status == 0) {
|
||||||
this.setVisible(false)
|
this.setVisible(false)
|
||||||
this.props.showNotification('发送成功')
|
this.props.showNotification('发送成功')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onOk = () => {
|
onOk = () => {
|
||||||
const { course_lists, checkBoxValues } = this.state
|
const { course_lists, checkBoxValues } = this.state
|
||||||
this.onSendOk()
|
this.onSendOk()
|
||||||
// this.props.onOk && this.props.onOk(checkBoxValues)
|
// this.props.onOk && this.props.onOk(checkBoxValues)
|
||||||
|
|
||||||
// this.refs.modalWrapper.setVisible(false)
|
// this.refs.modalWrapper.setVisible(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
onCheckBoxChange = (checkBoxValues) => {
|
onCheckBoxChange = (checkBoxValues) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
checkBoxValues: checkBoxValues
|
checkBoxValues: checkBoxValues
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onSearchChange = (e) => {
|
onSearchChange = (e) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
searchValue: e.target.value
|
searchValue: e.target.value
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
handleInfiniteOnLoad = () => {
|
handleInfiniteOnLoad = () => {
|
||||||
console.log('loadmore...')
|
console.log('loadmore...')
|
||||||
this.fetchCourseList(this.state.page + 1)
|
this.fetchCourseList(this.state.page + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
onSearch = () => {
|
onSearch = () => {
|
||||||
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
|
// const course_lists_after_filter = this.state.course_lists.filter( item => item.name.indexOf(this.state.searchValue) != -1 )
|
||||||
// this.setState({ course_lists_after_filter })
|
// this.setState({ course_lists_after_filter })
|
||||||
this.fetchCourseList(1)
|
this.fetchCourseList(1)
|
||||||
}
|
}
|
||||||
render(){
|
render(){
|
||||||
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
|
const { course_lists, checkBoxValues, searchValue, loading, hasMore } = this.state
|
||||||
const { moduleName } = this.props
|
const { moduleName } = this.props
|
||||||
return(
|
return(
|
||||||
<ModalWrapper
|
<ModalWrapper
|
||||||
ref="modalWrapper"
|
ref="modalWrapper"
|
||||||
title={`发送${moduleName}`}
|
title={`发送${moduleName}`}
|
||||||
{...this.props }
|
{...this.props }
|
||||||
onOk={this.onOk}
|
onOk={this.onOk}
|
||||||
>
|
>
|
||||||
<style>
|
<style>
|
||||||
{`
|
{`
|
||||||
.demo-loading-container {
|
.demo-loading-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 93px;
|
bottom: 93px;
|
||||||
width: 82%;
|
width: 82%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}`}
|
}`}
|
||||||
</style>
|
</style>
|
||||||
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
|
<p className="color-grey-6 mb20 edu-txt-center" style={{ fontWeight: "bold" }} >选择的{moduleName}发送到<span className="color-orange-tip">指定课堂</span></p>
|
||||||
|
|
||||||
<Search
|
<Search
|
||||||
className="mb14"
|
className="mb14"
|
||||||
value={searchValue}
|
value={searchValue}
|
||||||
placeholder="请输入课堂名称进行搜索"
|
placeholder="请输入课堂名称进行搜索"
|
||||||
onChange={this.onSearchChange}
|
onChange={this.onSearchChange}
|
||||||
onSearch={this.onSearch}
|
onSearch={this.onSearch}
|
||||||
></Search>
|
></Search>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
|
{/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
|
||||||
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
|
<div className="edu-back-skyblue padding15" style={{"height":"300px", overflowY: "scroll", overflowAnchor: 'none' }}>
|
||||||
<InfiniteScroll
|
<InfiniteScroll
|
||||||
threshold={10}
|
threshold={10}
|
||||||
initialLoad={false}
|
initialLoad={false}
|
||||||
pageStart={0}
|
pageStart={0}
|
||||||
loadMore={this.handleInfiniteOnLoad}
|
loadMore={this.handleInfiniteOnLoad}
|
||||||
hasMore={!loading && hasMore}
|
hasMore={!loading && hasMore}
|
||||||
useWindow={false}
|
useWindow={false}
|
||||||
>
|
>
|
||||||
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
|
||||||
|
|
||||||
{ course_lists && course_lists.map( course => {
|
{ course_lists && course_lists.map( course => {
|
||||||
return (
|
return (
|
||||||
<p className="clearfix mb7" key={course.id}>
|
<p className="clearfix mb7" key={course.id}>
|
||||||
<Checkbox className="fl" value={course.id} ></Checkbox>
|
<Checkbox className="fl" value={course.id} key={course.id}></Checkbox>
|
||||||
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
|
<span className="fl with45"><label className="task-hide fl" style={{"maxWidth":"208px;"}}>{course.name}</label></span>
|
||||||
</p>
|
</p>
|
||||||
)
|
)
|
||||||
}) }
|
}) }
|
||||||
</Checkbox.Group>
|
</Checkbox.Group>
|
||||||
{loading && hasMore && (
|
{loading && hasMore && (
|
||||||
<div className="demo-loading-container">
|
<div className="demo-loading-container">
|
||||||
<Spin />
|
<Spin />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{/* TODO */}
|
{/* TODO */}
|
||||||
{/* {
|
{/* {
|
||||||
!hasMore && <div>没有更多了。。</div>
|
!hasMore && <div>没有更多了。。</div>
|
||||||
} */}
|
} */}
|
||||||
</InfiniteScroll>
|
</InfiniteScroll>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ModalWrapper>
|
</ModalWrapper>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default SendToCourseModal;
|
export default SendToCourseModal;
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,249 +1,249 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import {Pagination,Spin,Checkbox,Modal} from 'antd';
|
import {Pagination,Spin,Checkbox,Modal} from 'antd';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import NoneData from '../../courses/coursesPublic/NoneData'
|
import NoneData from '../../courses/coursesPublic/NoneData'
|
||||||
import {getImageUrl} from 'educoder';
|
import {getImageUrl} from 'educoder';
|
||||||
import "./usersInfo.css"
|
import "./usersInfo.css"
|
||||||
import Modals from '../../modals/Modals'
|
import Modals from '../../modals/Modals'
|
||||||
|
|
||||||
const dateFormat ="YYYY-MM-DD HH:mm"
|
const dateFormat ="YYYY-MM-DD HH:mm"
|
||||||
class InfosBank extends Component{
|
class InfosBank extends Component{
|
||||||
constructor(props){
|
constructor(props){
|
||||||
super(props);
|
super(props);
|
||||||
this.state={
|
this.state={
|
||||||
category:"common",
|
category:"common",
|
||||||
type:"publicly",
|
type:"publicly",
|
||||||
page:1,
|
page:1,
|
||||||
per_page:16,
|
per_page:16,
|
||||||
sort_by:"updated_at",
|
sort_by:"updated_at",
|
||||||
CoursesId:undefined,
|
CoursesId:undefined,
|
||||||
|
|
||||||
totalCount:undefined,
|
totalCount:undefined,
|
||||||
data:undefined,
|
data:undefined,
|
||||||
isSpin:false,
|
isSpin:false,
|
||||||
|
|
||||||
dialogOpen:false,
|
dialogOpen:false,
|
||||||
modalsTopval:undefined,
|
modalsTopval:undefined,
|
||||||
modalsBottomval:undefined,
|
modalsBottomval:undefined,
|
||||||
modalSave:undefined
|
modalSave:undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount=()=>{
|
componentDidMount=()=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,page,sort_by,CoursesId}=this.state;
|
let{category,type,page,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
getCourses=(category,type,page,sort_by,CoursesId)=>{
|
getCourses=(category,type,page,sort_by,CoursesId)=>{
|
||||||
let url=`/users/${this.props.match.params.username}/question_banks.json`;
|
let url=`/users/${this.props.match.params.username}/question_banks.json`;
|
||||||
axios.get((url),{params:{
|
axios.get((url),{params:{
|
||||||
category,
|
category,
|
||||||
type,
|
type,
|
||||||
page,
|
page,
|
||||||
sort_by,
|
sort_by,
|
||||||
per_page:category && page ==1?17:16,
|
per_page:category && page ==1?17:16,
|
||||||
course_list_id:CoursesId
|
course_list_id:CoursesId
|
||||||
}}).then((result)=>{
|
}}).then((result)=>{
|
||||||
if(result){
|
if(result){
|
||||||
this.setState({
|
this.setState({
|
||||||
totalCount:result.data.count,
|
totalCount:result.data.count,
|
||||||
data:result.data,
|
data:result.data,
|
||||||
isSpin:false
|
isSpin:false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}).catch((error)=>{
|
}).catch((error)=>{
|
||||||
console.log(error);
|
console.log(error);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//切换种类
|
//切换种类
|
||||||
changeCategory=(cate)=>{
|
changeCategory=(cate)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
category:cate,
|
category:cate,
|
||||||
page:1,
|
page:1,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{type,sort_by,CoursesId}=this.state;
|
let{type,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(cate,type,1,sort_by,CoursesId);
|
this.getCourses(cate,type,1,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
//切换状态
|
//切换状态
|
||||||
changeType=(type)=>{
|
changeType=(type)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
type:type,
|
type:type,
|
||||||
page:1,
|
page:1,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,sort_by,CoursesId}=this.state;
|
let{category,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,1,sort_by,CoursesId);
|
this.getCourses(category,type,1,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
//切换页数
|
//切换页数
|
||||||
changePage=(page)=>{
|
changePage=(page)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
page,
|
page,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,sort_by,CoursesId}=this.state;
|
let{category,type,sort_by,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,page,sort_by,CoursesId);
|
this.getCourses(category,type,page,sort_by,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进入课堂
|
// 进入课堂
|
||||||
turnToCourses=(url)=>{
|
turnToCourses=(url)=>{
|
||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换排序方式
|
// 切换排序方式
|
||||||
changeOrder= (sort)=>{
|
changeOrder= (sort)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
sort_by:sort,
|
sort_by:sort,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,page,CoursesId}=this.state;
|
let{category,type,page,CoursesId}=this.state;
|
||||||
this.getCourses(category,type,page,sort,CoursesId);
|
this.getCourses(category,type,page,sort,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeCourseListId =(CoursesId)=>{
|
changeCourseListId =(CoursesId)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
CoursesId,
|
CoursesId,
|
||||||
isSpin:true
|
isSpin:true
|
||||||
})
|
})
|
||||||
let{category,type,sort,page}=this.state;
|
let{category,type,sort,page}=this.state;
|
||||||
this.getCourses(category,type,page,sort,CoursesId);
|
this.getCourses(category,type,page,sort,CoursesId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//设为公开/删除
|
//设为公开/删除
|
||||||
setPublic=(index)=>{
|
setPublic=(index)=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
dialogOpen:true,
|
dialogOpen:true,
|
||||||
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
|
modalsTopval:index==1?"您确定要公开吗?":"确定要删除该题吗?",
|
||||||
modalsBottomval:index==1?"公开后不能重设为私有":"",
|
modalsBottomval:index==1?"公开后不能重设为私有":"",
|
||||||
modalSave:()=>this.sureOperation(index)
|
modalSave:()=>this.sureOperation(index)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 确定--设为公开/删除
|
// 确定--设为公开/删除
|
||||||
sureOperation=()=>{
|
sureOperation=()=>{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//弹框隐藏
|
//弹框隐藏
|
||||||
handleDialogClose=()=>{
|
handleDialogClose=()=>{
|
||||||
this.setState({
|
this.setState({
|
||||||
dialogOpen:false
|
dialogOpen:false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
let{
|
let{
|
||||||
category,
|
category,
|
||||||
type,
|
type,
|
||||||
page,
|
page,
|
||||||
data,
|
data,
|
||||||
totalCount,
|
totalCount,
|
||||||
sort_by,
|
sort_by,
|
||||||
isSpin,
|
isSpin,
|
||||||
CoursesId,
|
CoursesId,
|
||||||
dialogOpen,
|
dialogOpen,
|
||||||
modalsTopval,
|
modalsTopval,
|
||||||
modalsBottomval,modalSave
|
modalsBottomval,modalSave
|
||||||
} = this.state;
|
} = this.state;
|
||||||
let isStudent = this.props.isStudent();
|
let isStudent = this.props.isStudent();
|
||||||
let is_current=this.props.is_current;
|
let is_current=this.props.is_current;
|
||||||
return(
|
return(
|
||||||
<div className="educontent">
|
<div className="educontent">
|
||||||
<Modals
|
<Modals
|
||||||
modalsType={dialogOpen}
|
modalsType={dialogOpen}
|
||||||
modalsTopval={modalsTopval}
|
modalsTopval={modalsTopval}
|
||||||
modalsBottomval={modalsBottomval}
|
modalsBottomval={modalsBottomval}
|
||||||
modalCancel={this.handleDialogClose}
|
modalCancel={this.handleDialogClose}
|
||||||
modalSave={modalSave}
|
modalSave={modalSave}
|
||||||
></Modals>
|
></Modals>
|
||||||
<Spin size="large" spinning={isSpin}>
|
<Spin size="large" spinning={isSpin}>
|
||||||
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
|
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
|
||||||
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
|
<li className={type=="publicly" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("publicly")}>{is_current ? "我":"TA"}的题库</a></li>
|
||||||
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
|
<li className={type=="personal" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeType("personal")}>公共题库</a></li>
|
||||||
</div>
|
</div>
|
||||||
<div className="edu-back-white padding20-30 bor-top-greyE">
|
<div className="edu-back-white padding20-30 bor-top-greyE">
|
||||||
<ul className="clearfix secondNav">
|
<ul className="clearfix secondNav">
|
||||||
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
|
<li className={category=="common" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("common")}>普通作业</a></li>
|
||||||
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
|
<li className={category=="group" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("group")}>分组作业</a></li>
|
||||||
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
|
<li className={category=="exercise" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("exercise")}>试卷</a></li>
|
||||||
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
|
<li className={category=="poll" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("poll")}>问卷</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div className="edu-txt-left mt10 bankTag">
|
<div className="edu-txt-left mt10 bankTag">
|
||||||
<ul className="inline" id="sourceTag">
|
<ul className="inline" id="sourceTag">
|
||||||
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
|
<li className={ CoursesId ? "" : "active" } onClick={()=>this.changeCourseListId()}>
|
||||||
<a href="javascript:void(0)">全部</a>
|
<a href="javascript:void(0)">全部</a>
|
||||||
</li>
|
</li>
|
||||||
{
|
{
|
||||||
data && data.course_list && data.course_list.map((item,key)=>{
|
data && data.course_list && data.course_list.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
|
<li className={CoursesId==item.id?"active":""} key={key} onClick={()=>this.changeCourseListId(`${item.id}`)}>
|
||||||
<a href="javascript:void(0)">{item.name}</a>
|
<a href="javascript:void(0)">{item.name}</a>
|
||||||
</li>
|
</li>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
|
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
|
||||||
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
|
<span className="fl color-grey-9">共参与{totalCount}个题库</span>
|
||||||
<div className="fr">
|
<div className="fr">
|
||||||
<li className="drop_down">
|
<li className="drop_down">
|
||||||
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
|
<span className="color-grey-9 font-12">{sort_by=="updated_at"?"时间最新":sort_by=="name"?"作业名称":"贡献者"}</span><i className="iconfont icon-xiajiantou font-12 ml2 color-grey-6"></i>
|
||||||
<ul className="drop_down_normal">
|
<ul className="drop_down_normal">
|
||||||
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
|
<li onClick={()=>this.changeOrder("updated_at")}>时间最新</li>
|
||||||
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
|
<li onClick={()=>this.changeOrder("name")}>作业名称</li>
|
||||||
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
|
<li onClick={()=>this.changeOrder("contributor")}>贡献者</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<div className="dataBank_list edu-back-white educontent">
|
<div className="dataBank_list edu-back-white educontent">
|
||||||
{
|
{
|
||||||
!data || data.question_banks.length==0 && <NoneData></NoneData>
|
!data || data.question_banks.length==0 && <NoneData></NoneData>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
data && data.question_banks && data.question_banks.map((item,key)=>{
|
data && data.question_banks && data.question_banks.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<div className="dataBank_Item clearfix" key={key}>
|
<div className="dataBank_Item clearfix" key={key}>
|
||||||
<div className="fl dataItemLeft">
|
<div className="fl dataItemLeft">
|
||||||
<Checkbox value={item.id}></Checkbox>
|
<Checkbox value={item.id} key={item.id}></Checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div className="fr dataItemRight bank_item">
|
<div className="fr dataItemRight bank_item">
|
||||||
<p className="mb10 clearfix">
|
<p className="mb10 clearfix">
|
||||||
<span className="dataTitle fl mr80">{item.name}</span>
|
<span className="dataTitle fl mr80">{item.name}</span>
|
||||||
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
|
<a href="javascript:void(0)" data-object="2599" className="bank_send fr">发送</a>
|
||||||
{
|
{
|
||||||
item.is_public ==false ?
|
item.is_public ==false ?
|
||||||
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
|
<a href="javascript:void(0)" onClick={()=>this.setPublic(1)} className="bank_public color-blue_4C fr mr60">设为公开</a>:""
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
<p className="itembottom clearfix">
|
<p className="itembottom clearfix">
|
||||||
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
|
<span className="fl bottomspan color-grey-9">{item.quotes_count}次引用</span>
|
||||||
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
|
<span className="fl bottomspan color-grey-9">{item.solve_count}次答题</span>
|
||||||
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
|
<span className="fl bottomspan color-grey-9">{moment(item.updated_at).format('YYYY-MM-DD HH:mm')}</span>
|
||||||
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
|
<span className="fr"><a href="javascript:void(0)" className="bank_delete color-grey-9" onClick={()=>this.setPublic(2)}>删除</a></span>
|
||||||
<span className="bank_list_Tag">{item.course_list_name}</span>
|
<span className="bank_list_Tag">{item.course_list_name}</span>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
totalCount > 15 &&
|
totalCount > 15 &&
|
||||||
<div className="mt30 mb50 edu-txt-center">
|
<div className="mt30 mb50 edu-txt-center">
|
||||||
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
|
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</Spin>
|
</Spin>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default InfosBank;
|
export default InfosBank;
|
Loading…
Reference in new issue