调整课堂模块列表筛选

courseware
杨树明 5 years ago
parent 0ee1d9a9f4
commit d3885bfd95

@ -567,7 +567,7 @@ class Fileslists extends Component{
let {search,order,selectpage,checkAllValue,checkBoxValues}=this.state;
let selectpagetype=selectpage===page&&checkBoxValues.length===15?true:false
console.log(selectpagetype)
this.setState({
page:page,
@ -1054,18 +1054,18 @@ class Fileslists extends Component{
{/* <div onClick={() => this.moveTos(itm.value )} style={{marginLeft:15,width:itm.title.length>13?200:undefined,color:'#000000',overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}}>{itm.title}</div> */}
{itm.children.length===0?'':<i style={{marginLeft:15,marginRight:15}} onClick={() => this.istowshow(itm,filesId)} className="iconfont icon-xiajiantou font-12 ml2"></i>}
</div>
{ this.state.istowshowid===itm.value?
itm.children.map((tt,ti) => {
return(
filesId&&filesId===itm.id?"":
<div style={{marginTop:10,height:20,display:this.state.isToggleOn?'block':'none'}}>
<div style={{display:ti===0?'block':'none',marginLeft:15,width:235,marginRight:15,height:1,background:'#EEEEEE'}}></div>
<li style={{marginTop:5,paddingTop:5,marginBottom:5,paddingLeft:30,width:tt.title.length>13?200:undefined,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.title}>{tt.title}</li>
<li style={{marginTop:5,paddingTop:5,marginBottom:5,paddingLeft:30,width:tt.title.length>13?200:undefined,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.title}>{tt.title}</li>
</div>
)
})
:''}

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

@ -73,6 +73,9 @@ class commonWork extends Component{
componentDidUpdate(prevProps, prevState) {
if (prevProps.coursesidtype != this.props.coursesidtype||prevProps.match.params.category_id!=this.props.match.params.category_id) {
this.setState({
page:1
})
if (this.props.match.path === "/classrooms/:coursesId/common_homeworks/:category_id" || this.props.match.path === "/classrooms/:coursesId/common_homework/:category_id"||
this.props.match.path === "/classrooms/:coursesId/group_homeworks/:category_id" || this.props.match.path === "/classrooms/:coursesId/group_homework/:category_id"
) {
@ -220,11 +223,21 @@ class commonWork extends Component{
}
onPageChange=(pageNumber)=>{
this.setState({
page:pageNumber,
checkBoxValues:[]
})
let {search,order,category_id}=this.state;
let {search,order,category_id,checkAll}=this.state;
if(checkAll===true){
this.setState({
page:pageNumber,
checkBoxValues:[],
checkAll:false
})
}else{
this.setState({
page:pageNumber,
checkBoxValues:[]
})
}
this.getList(pageNumber,search,order,category_id);
}

@ -121,7 +121,7 @@ class CoursesHome extends Component {
const { order, page, coursesHomelist } = this.state;
const { user, tojoinclass } = this.props
console.log(tojoinclass, '--------------s')
return (
<div>
{this.state.updata === undefined ? "" : <UpgradeModals

@ -170,7 +170,7 @@ class Boards extends Component{
})
let {status,searchValue}=this.state;
this.fetchAll(searchValue,pageNum,status);
console.log(this.state.checkBoxValues);
}
// 筛选

@ -150,12 +150,21 @@ class Poll extends Component{
}
//切换分页
changePage=(pageNumber)=>{
let{type,StudentList_value,checkAllValue}=this.state;
if(checkAllValue===true){
this.setState({
page:pageNumber,
checkBoxValues:[],
checkAllValue:false
})
}else{
this.setState({
page:pageNumber,
checkBoxValues:[]
})
}
this.setState({
page:pageNumber,
checkBoxValues:[]
})
let{type,StudentList_value}=this.state
this.InitList(type,StudentList_value,pageNumber);
}
// 搜索

@ -637,12 +637,19 @@ class ShixunHomework extends Component{
// }
PaginationCourse=(pageNumber)=>{
let {Coursename,order}=this.state;
this.setState({
page:pageNumber,
checkBoxValues:[]
})
let {Coursename,order,checkedtype}=this.state;
if(checkedtype===true){
this.setState({
page:pageNumber,
checkBoxValues:[],
checkedtype:false
})
}else{
this.setState({
page:pageNumber,
checkBoxValues:[],
})
}
this.homeworkupdatalist(Coursename,pageNumber,order);

@ -11,15 +11,15 @@ class Showmarkdown extends Component {
componentDidMount() {
if (this.props.descriptions) {
setTimeout(()=>{
var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", {
window.editormd.markdownToHTML("memo_content_editorMd", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
}, 200)
}
}

Loading…
Cancel
Save