From 72eafee2f8b2a0772fd1573a4a206683fa1416ff Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Mon, 9 Mar 2020 14:32:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Index.js | 106 +++++++++++++----- .../src/modules/courses/Video/VideoIndex.js | 25 ++++- .../courses/coursesDetail/CoursesLeftNav.js | 49 ++++---- 3 files changed, 126 insertions(+), 54 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 880ec0e9a..d8b8b82e9 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -510,33 +510,85 @@ class CoursesIndex extends Component { > {/*视频列表*/} - () - } - > - {/* 资源列表页 */} - () - } - > - () - } - > - () - } - > - {/*课堂讨论*/} - () - } - > + render() { + const common = { + previousPathName: this.historyArray && this.historyArray[1] + // isAdmin: this.isAdmin, + // isStudent: this.isStudent, + // isAdminOrStudent: this.isAdminOrStudent, + + // isNotMember: this.isNotMember, + // isCourseidentity:this.isCourseidentity + } + // const commons = { + // admind: this.props.user, + // // isAdminOrStudent: this.isAdminOrStudent, + // + // // isNotMember: this.isNotMember, + // // isCourseidentity:this.isCourseidentity + // } + // console.log("commonscommons") + // console.log(commons) + return ( + + {/*排序*/} + () + } + > + {/*视频列表*/} + () + } + > + () + } + > + {/* 资源列表页 */} + () + } + > + () + } + > + () + } + > + {/*课堂讨论*/} + () + } + > + + {/* 毕业设计 */} + {/* 毕设问答 */} + () + } + > + + {/* 毕设选题新建页 */} + () + }> + {/* 毕设选题编辑页*/} + () + }> {/* 毕业设计 */} {/* 毕设问答 */} diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js index d58a2f187..63bb55512 100644 --- a/public/react/src/modules/courses/Video/VideoIndex.js +++ b/public/react/src/modules/courses/Video/VideoIndex.js @@ -93,12 +93,13 @@ class VideoIndex extends Component{ // 获取视频列表 getList=(page)=>{ - const CourseId=this.props.match.params.coursesId; - const fetchUrl = `/courses/${CourseId}/course_videos.json`; + const { coursesId , videoId }=this.props.match.params; + const fetchUrl = `/courses/${coursesId}/course_videos.json`; axios.get(fetchUrl, { params: { page, limit: PAGE_SIZE, + category_id:videoId } }) .then((response) => { @@ -200,9 +201,18 @@ class VideoIndex extends Component{ }) this.setliveVisibel(true); } + + addDir=()=>{ + + } + editDir=()=>{ + + } render(){ const { videos , upload , videoData , type , liveData , lives , page , liveVisible , isSpining , liveId } = this.state; const { admin , is_teacher , business } = this.props.user; + const { coursesId , videoId }=this.props.match.params; + // console.log("p",this.props); return( @@ -247,6 +257,17 @@ class VideoIndex extends Component{ { type === "video" ? + { + this.props.isAdmin() && + + { + videoId ? + this.editDir()} className={"mr30 font-16"}>目录重命名 + : + 新建目录 + } + + } { upload ? this.uploadVideo(false)}>取消 diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index f4ccccdba..c6e72fee5 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -658,32 +658,28 @@ class Coursesleftnav extends Component{ updatadeleteSecondary=(url)=>{ this.props.updataleftNavfun(); - // this.setState({ - // ModalsType:true, - // Modalstopval:"删除成功", - // loadtype:true, - // }) - // notification.open({ - // message: "删除成功", - // }); - - // this.props.history.replace(url); - window.location.href = url; + this.setState({ + ModalsType:false, + Modalstopval:"", + loadtype:false, + }) + notification.open({ + message: "删除成功", + }); + + this.props.history.replace(url); + + // window.location.href = url; } deletenavchilds=(url,mainurl)=>{ - this.setState({ - antIcon:true - }) + console.log(this.props); + this.setState({ + antIcon:true + }) axios.delete(url).then((result)=>{ if(result.data.status===0){ - - if(mainurl===undefined){ - this.updatadeleteSecondary(result.data.right_url) - }else{ - this.updatadeleteSecondary(mainurl) - } - + this.updatadeleteSecondary(mainurl || result.data.right_url); } }).catch((error)=>{ console.log(error) @@ -698,8 +694,8 @@ class Coursesleftnav extends Component{ ModalsType:true, Modalstopval:"该目录下的内容将被移动到父目录,", ModalsBottomval:"是否确认删除?", - ModalSave:()=>this.deletenavchilds(url), - + ModalSave:()=>this.deletenavchilds(url,mainurl), + loadtype:false }) }else if(type===2){ @@ -709,7 +705,7 @@ class Coursesleftnav extends Component{ Modalstopval:"该分班的学生将被移动到“未分班”,", ModalsBottomval:"是否确认删除?", ModalSave:()=>this.deletenavchilds(url), - + loadtype:false }) }else if(type===3){ let url="/boards/"+id+".json" @@ -718,7 +714,7 @@ class Coursesleftnav extends Component{ Modalstopval:"该目录下的内容将被移动到父目录,", ModalsBottomval:"是否确认删除?", ModalSave:()=>this.deletenavchilds(url,mainurl), - + loadtype:false }) } @@ -874,6 +870,9 @@ class Coursesleftnav extends Component{ {/*讨论区*/} {item.type==="board"?
this.Navmodalnames(e,7,"editSecondname",iem.category_id,iem.category_name)}>重命名
:""} {item.type==="board"?
this.deleteSecondary(e,3,iem.category_id,item.category_url)}>删除
:""} + {/*视频*/} + {item.type==="video"?
this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名
:""} + {item.type==="video"?
this.deleteSecondary(e,1,iem.category_id,item.category_url)}>删除
:""} ) };