调整课堂模块列表筛选

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 {search,order,selectpage,checkAllValue,checkBoxValues}=this.state;
let selectpagetype=selectpage===page&&checkBoxValues.length===15?true:false let selectpagetype=selectpage===page&&checkBoxValues.length===15?true:false
console.log(selectpagetype)
this.setState({ this.setState({
page:page, 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> */} {/* <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>} {itm.children.length===0?'':<i style={{marginLeft:15,marginRight:15}} onClick={() => this.istowshow(itm,filesId)} className="iconfont icon-xiajiantou font-12 ml2"></i>}
</div> </div>
{ this.state.istowshowid===itm.value? { this.state.istowshowid===itm.value?
itm.children.map((tt,ti) => { itm.children.map((tt,ti) => {
return( return(
filesId&&filesId===itm.id?"": filesId&&filesId===itm.id?"":
<div style={{marginTop:10,height:20,display:this.state.isToggleOn?'block':'none'}}> <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> <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> </div>
) )
}) })
:''} :''}

@ -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>
) )
} }

@ -73,6 +73,9 @@ class commonWork extends Component{
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (prevProps.coursesidtype != this.props.coursesidtype||prevProps.match.params.category_id!=this.props.match.params.category_id) { 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"|| 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" 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)=>{ onPageChange=(pageNumber)=>{
this.setState({ let {search,order,category_id,checkAll}=this.state;
page:pageNumber,
checkBoxValues:[] if(checkAll===true){
}) this.setState({
let {search,order,category_id}=this.state; page:pageNumber,
checkBoxValues:[],
checkAll:false
})
}else{
this.setState({
page:pageNumber,
checkBoxValues:[]
})
}
this.getList(pageNumber,search,order,category_id); this.getList(pageNumber,search,order,category_id);
} }

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

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

@ -150,12 +150,21 @@ class Poll extends Component{
} }
//切换分页 //切换分页
changePage=(pageNumber)=>{ 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); this.InitList(type,StudentList_value,pageNumber);
} }
// 搜索 // 搜索

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

@ -11,15 +11,15 @@ class Showmarkdown extends Component {
componentDidMount() { componentDidMount() {
if (this.props.descriptions) { 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 htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true, taskList: true,
tex: true, // 默认不解析 tex: true, // 默认不解析
flowChart: true, // 默认不解析 flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析 sequenceDiagram: true // 默认不解析
}); });
}, 200)
} }
} }

Loading…
Cancel
Save