|
|
@ -42,11 +42,11 @@ class Boards extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const _serachText = searchText || this.state.searchValue
|
|
|
|
const _serachText = searchText || this.state.searchValue
|
|
|
|
const _page = page || this.state.pagination.page
|
|
|
|
const _page = page || this.state.pagination.page
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const cid = this.props.match.params.coursesId
|
|
|
|
const cid = this.props.match.params.coursesId
|
|
|
|
const bid = this.props.match.params.boardId
|
|
|
|
const bid = this.props.match.params.boardId
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// hot
|
|
|
|
// hot
|
|
|
|
const sort_type = this.state.sort_type
|
|
|
|
const sort_type = this.state.sort_type
|
|
|
|
// page_size
|
|
|
|
// page_size
|
|
|
@ -131,7 +131,7 @@ class Boards extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
const checkBoxValues = this.state.checkBoxValues
|
|
|
|
const checkBoxValues = this.state.checkBoxValues
|
|
|
|
const url = `/boards/${bid}/messages/bulk_move.json`
|
|
|
|
const url = `/boards/${bid}/messages/bulk_move.json`
|
|
|
|
axios.put(url, {
|
|
|
|
axios.put(url, {
|
|
|
|
ids: checkBoxValues,
|
|
|
|
ids: checkBoxValues,
|
|
|
|
to_board_id: board.id
|
|
|
|
to_board_id: board.id
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -147,7 +147,7 @@ class Boards extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(function (error) {
|
|
|
|
.catch(function (error) {
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onDelete = () => {
|
|
|
|
onDelete = () => {
|
|
|
|
const len = this.state.checkBoxValues.length
|
|
|
|
const len = this.state.checkBoxValues.length
|
|
|
@ -179,16 +179,16 @@ class Boards extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(function (error) {
|
|
|
|
.catch(function (error) {
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onSticky = (message) => {
|
|
|
|
onSticky = (message) => {
|
|
|
|
const cid = this.props.match.params.coursesId
|
|
|
|
const cid = this.props.match.params.coursesId
|
|
|
|
const url = `/messages/${message.id}/sticky_top.json`
|
|
|
|
const url = `/messages/${message.id}/sticky_top.json`
|
|
|
|
axios.put(url, {
|
|
|
|
axios.put(url, {
|
|
|
|
course_id: cid,
|
|
|
|
course_id: cid,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
@ -203,7 +203,7 @@ class Boards extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(function (error) {
|
|
|
|
.catch(function (error) {
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onItemClick = (item) => {
|
|
|
|
onItemClick = (item) => {
|
|
|
|
const checkBoxValues = this.state.checkBoxValues.slice(0);
|
|
|
|
const checkBoxValues = this.state.checkBoxValues.slice(0);
|
|
|
@ -219,7 +219,7 @@ class Boards extends Component{
|
|
|
|
onPressEnter = (e) => {
|
|
|
|
onPressEnter = (e) => {
|
|
|
|
clearTimeout(this.timeoutHandler)
|
|
|
|
clearTimeout(this.timeoutHandler)
|
|
|
|
this.timeoutHandler = null;
|
|
|
|
this.timeoutHandler = null;
|
|
|
|
|
|
|
|
|
|
|
|
this.fetchAll(this.state.searchValue, 1)
|
|
|
|
this.fetchAll(this.state.searchValue, 1)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onInputSearchChange = (e) => {
|
|
|
|
onInputSearchChange = (e) => {
|
|
|
@ -240,12 +240,12 @@ class Boards extends Component{
|
|
|
|
trigger('boardAdd', parseInt(boardid))
|
|
|
|
trigger('boardAdd', parseInt(boardid))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
renameDir = () => {
|
|
|
|
renameDir = () => {
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
trigger('boardRename', { category_id: parseInt(boardId), category_name: this.state.boardName})
|
|
|
|
trigger('boardRename', { category_id: parseInt(boardId), category_name: this.state.boardName})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onToBoardsNew = () => {
|
|
|
|
onToBoardsNew = () => {
|
|
|
|
const courseId = this.state.course_id
|
|
|
|
const courseId = this.state.course_id
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
|
|
|
|
|
|
|
|
this.props.toNewPage(courseId, boardId)
|
|
|
|
this.props.toNewPage(courseId, boardId)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -282,9 +282,18 @@ class Boards extends Component{
|
|
|
|
console.log('checked = ', checkedValues);
|
|
|
|
console.log('checked = ', checkedValues);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onPageChange = (pageNumber) => {
|
|
|
|
onPageChange = (pageNumber) => {
|
|
|
|
this.setState({
|
|
|
|
let {checkAllValue}=this.state;
|
|
|
|
checkBoxValues:[]
|
|
|
|
if(checkAllValue===true){
|
|
|
|
})
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
checkBoxValues:[],
|
|
|
|
|
|
|
|
checkAllValue:false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
checkBoxValues:[]
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.fetchAll(null, pageNumber)
|
|
|
|
this.fetchAll(null, pageNumber)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -304,25 +313,25 @@ class Boards extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
const boardId = this.props.match.params.boardId
|
|
|
|
const url = `/boards/${boardId}/messages/bulk_public.json`
|
|
|
|
const url = `/boards/${boardId}/messages/bulk_public.json`
|
|
|
|
axios.put(url, {
|
|
|
|
axios.put(url, {
|
|
|
|
ids: checkBoxValues
|
|
|
|
ids: checkBoxValues
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((response) => {
|
|
|
|
.then((response) => {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
if (response.data.status == 0) {
|
|
|
|
this.props.showNotification('操作成功')
|
|
|
|
this.props.showNotification('操作成功')
|
|
|
|
this.fetchAll()
|
|
|
|
this.fetchAll()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.catch(function (error) {
|
|
|
|
.catch(function (error) {
|
|
|
|
console.log(error);
|
|
|
|
console.log(error);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onSortTypeChange = (sort_type) => {
|
|
|
|
onSortTypeChange = (sort_type) => {
|
|
|
|
this.setState({ sort_type }, () => {
|
|
|
|
this.setState({ sort_type }, () => {
|
|
|
|
this.fetchAll()
|
|
|
|
this.fetchAll()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
render(){
|
|
|
|
render(){
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
|
const isAdmin = this.props.isAdmin()
|
|
|
@ -362,7 +371,7 @@ class Boards extends Component{
|
|
|
|
onPressEnter={this.onPressEnter}
|
|
|
|
onPressEnter={this.onPressEnter}
|
|
|
|
></Titlesearchsection>
|
|
|
|
></Titlesearchsection>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* <BoardsListItem></BoardsListItem>
|
|
|
|
{/* <BoardsListItem></BoardsListItem>
|
|
|
|
|
|
|
|
|
|
|
|
<FilesListItem></FilesListItem> */}
|
|
|
|
<FilesListItem></FilesListItem> */}
|
|
|
@ -371,7 +380,7 @@ class Boards extends Component{
|
|
|
|
<div className="clearfix">
|
|
|
|
<div className="clearfix">
|
|
|
|
{isAdmin&&<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} 个 (不支持跨页勾选)</Checkbox>}
|
|
|
|
{isAdmin&&<Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue}>已选 {checkBoxValues.length} 个 (不支持跨页勾选)</Checkbox>}
|
|
|
|
<div className="studentList_operation_ul">
|
|
|
|
<div className="studentList_operation_ul">
|
|
|
|
{ !!isAdmin &&
|
|
|
|
{ !!isAdmin &&
|
|
|
|
<React.Fragment>
|
|
|
|
<React.Fragment>
|
|
|
|
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>
|
|
|
|
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>
|
|
|
|
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onSendToOtherCourse}>发送</a></li>
|
|
|
|
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onSendToOtherCourse}>发送</a></li>
|
|
|
@ -379,7 +388,7 @@ class Boards extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
<li className="li_line drop_down">
|
|
|
|
<li className="li_line drop_down">
|
|
|
|
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
移动到...<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
<ul className="drop_down_menu"
|
|
|
|
<ul className="drop_down_menu"
|
|
|
|
style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}>
|
|
|
|
style={{"right":"0px","left":"unset", maxHeight: '318px', overflowY: 'auto', minWidth: '200px'}}>
|
|
|
|
{ boards && boards.length > 10 && <p className="drop_down_search">
|
|
|
|
{ boards && boards.length > 10 && <p className="drop_down_search">
|
|
|
|
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
|
|
|
|
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
|
|
|
@ -429,7 +438,7 @@ class Boards extends Component{
|
|
|
|
{ messages.map((item, index) => {
|
|
|
|
{ messages.map((item, index) => {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="mt20 edu-back-white padding02010" key={`d_${index}`}>
|
|
|
|
<div className="mt20 edu-back-white padding02010" key={`d_${index}`}>
|
|
|
|
<BoardsListItem
|
|
|
|
<BoardsListItem
|
|
|
|
{...this.props}
|
|
|
|
{...this.props}
|
|
|
|
discussMessage={item}
|
|
|
|
discussMessage={item}
|
|
|
|
checkBox={ isAdmin ? <Checkbox value={item.id} key={item.id}></Checkbox> : ''}
|
|
|
|
checkBox={ isAdmin ? <Checkbox value={item.id} key={item.id}></Checkbox> : ''}
|
|
|
@ -455,10 +464,10 @@ class Boards extends Component{
|
|
|
|
</Tooltip>
|
|
|
|
</Tooltip>
|
|
|
|
</a>
|
|
|
|
</a>
|
|
|
|
</p> } */}
|
|
|
|
</p> } */}
|
|
|
|
{pagination.total_count > 15 && <Pagination className="coursePagination"
|
|
|
|
{pagination.total_count > 15 && <Pagination className="coursePagination"
|
|
|
|
current={pagination.page}
|
|
|
|
current={pagination.page}
|
|
|
|
showQuickJumper pageSize={15} total={pagination.total_count} onChange={this.onPageChange} />}
|
|
|
|
showQuickJumper pageSize={15} total={pagination.total_count} onChange={this.onPageChange} />}
|
|
|
|
|
|
|
|
|
|
|
|
</React.Fragment>
|
|
|
|
</React.Fragment>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|