实训作业资源调整

courseware
杨树明 5 years ago
parent 221e7ed1f0
commit fb05f15f45

@ -64,6 +64,7 @@ class Fileslists extends Component{
});
}
componentDidMount=()=>{
this.getcourse_groupslists()
this.setState({
isSpin:true,
@ -85,27 +86,30 @@ class Fileslists extends Component{
this.seactall(parseInt(this.props.match.params.Id),"desc")
}
this.updadatalist();
on('updateNavSuccess', this.updateNavSuccess)
on('updateNavSuccess',this.updadatalist)
on('files', this.updateNavSuccess)
on('files',this.updadatalist)
}
updateNavSuccess=()=>{
let{sort}=this.state;
this.setState({
isSpin:true
})
if(this.props.match.params.main_id){
this.seactall(undefined,sort);
}else if(this.props.match.params.Id){
this.seactall(parseInt(this.props.match.params.Id),sort)
}
}
componentDidUpdate = (prevProps) => {
if(prevProps.coursesidtype!=this.props.coursesidtype||prevProps.match.params.main_id!=this.props.match.params.main_id||prevProps.match.params.Id!=this.props.match.params.Id){
if(prevProps.coursesidtype!=this.props.coursesidtype||prevProps.match.params.Id!=this.props.match.params.Id&&this.props.coursesidtype!="node") {
if(this.props.coursesidtype==="node") {
if(this.props.match.params.main_id){
this.getcourse_groupslists()
this.setState({
isSpin: true,
@ -119,9 +123,8 @@ class Fileslists extends Component{
})
this.seactall(undefined, "desc");
}
}
}else{
if(this.props.match.params.Id){
this.getcourse_groupslists()
this.setState({
isSpin:true,
@ -136,8 +139,12 @@ class Fileslists extends Component{
this.seactall(parseInt(this.props.match.params.Id),"desc")
}
}
}
}
updadatalist=(id)=>{
@ -174,6 +181,7 @@ class Fileslists extends Component{
}
updatafiled=()=>{
let{sort}=this.state;
if(this.props.match.params.main_id){
this.seactall(undefined,sort);
@ -640,7 +648,7 @@ class Fileslists extends Component{
}
Settingtypess=(id,title,link)=>{
debugger
this.setState({
Addanexternallink:true,
Exterchainname:"资源设置",
@ -951,10 +959,12 @@ class Fileslists extends Component{
}
secondRowLeft={
<div style={{"display":"inline-block", "marginTop": "22px"}}>
this.props.isAdmin()?<div style={{"display":"inline-block", "marginTop": "22px"}}>
<span> {total_count} 个资源</span>
<span style={{"marginLeft":"16px"}}>已发布{publish_count}</span>
<span style={{"marginLeft":"16px"}}>未发布{unpublish_count}</span>
</div>:<div style={{"display":"inline-block", "marginTop": "22px"}}>
<span> {publish_count} 个资源</span>
</div>
}
onPressEnter={this.onPressEnter}

@ -775,7 +775,7 @@ class CommonWorkList extends Component{
const hasData = this.state.homework_status && this.state.homework_status.indexOf("未发布") == -1 // student_works && !!student_works.length && page == 1 &&
console.log(StudentData)
//console.log(StudentData)
// console.log(student_works)
return(
<React.Fragment>

@ -536,7 +536,7 @@ class Coursesleftnav extends Component{
successFunc && successFunc(1);
}
saveNavmodapost=(url,value,positiontype,coursesId)=>{
saveNavmodapost=(url,value,positiontype,coursesId,type)=>{
axios.post(url,
{name:value}).then((result)=>{
@ -548,15 +548,28 @@ class Coursesleftnav extends Component{
description:result.data.message
});
if(positiontype==="shixun_homeworks"){
if(positiontype==="shixun_homeworks"||positiontype==="shixun_homework"){
if(type===true){
this.updasaveNavmoda()
trigger('shixun')
}else{
this.updasaveNavmoda()
trigger('updateNavSuccess')
this.props.history.push(`/classrooms/${coursesId}/shixun_homework/${result.data.category_id}`);
}
if(positiontype==="files"){
}
if(positiontype==="files"||positiontype==="file"){
if(type===true){
this.updasaveNavmoda()
trigger('files')
}else{
this.updasaveNavmoda()
trigger('updateNavSuccess')
this.props.history.push(`/classrooms/${coursesId}/file/${result.data.category_id}`);
}
}
if(positiontype==="boards"){
@ -565,7 +578,7 @@ class Coursesleftnav extends Component{
this.props.history.push(`/classrooms/${coursesId}/boards/${result.data.category_id}`);
}
if(positiontype!="course_groups"&&positiontype!="shixun_homeworks"){
if(positiontype!="course_groups"&&positiontype!="shixun_homeworks"&&positiontype!="shixun_homework"){
this.updasaveNavmoda()
}
@ -640,12 +653,12 @@ class Coursesleftnav extends Component{
}else if(Navmodaltypename===3){
let url="/course_modules/"+id+"/rename_module.json"
this.saveNavmodapost(url,NavmodalValue)
this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,null,true)
}else if(Navmodaltypename===4){
let url="/course_second_categories/"+id+"/rename_category.json";
this.saveNavmodapost(url,NavmodalValue)
this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,null,true)
}else if(Navmodaltypename===5){

@ -58,6 +58,7 @@ class ShixunHomework extends Component{
}
}
updateNavSuccess=()=>{
debugger
this.setState({
isSpin:true
})
@ -111,7 +112,7 @@ class ShixunHomework extends Component{
this.updadatalist()
}
}
on('updateNavSuccess', this.updateNavSuccess)
on('shixun', this.updateNavSuccess)
}
seactall=(id)=>{
this.setState({
@ -146,7 +147,7 @@ class ShixunHomework extends Component{
componentDidUpdate = (prevProps) => {
if(prevProps.coursesidtype!=this.props.coursesidtype||prevProps.match.params.main_id!=this.props.match.params.main_id||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.props.coursesidtype!="node") {
if(this.props.match.params.main_id){
if(this.props.match.params.main_id!=undefined){

@ -83,7 +83,7 @@ export default ({ middleshixundata, pagination, typepvisible, pages, totalcount,
</div>
<div className="both"></div>
<div className={"ml425"}
<div className={"educontent edu-txt-center mt10"}
style={{ display: pagination ? "block" : "none" }}>
<Pagination defaultCurrent={1} current={pages} total={totalcount || 1299} type="mini" pageSize={16} onChange={onPageChange} />
</div>

Loading…
Cancel
Save