From 962d1da60bbde012491eb8c33fa3b0e4ba96f486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 16:57:05 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/graduation/topics/GraduateTopicDetail.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js index b4bcaf0fa..4097a051e 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js @@ -88,7 +88,7 @@ class GraduateTopicDetail extends Component{ } }) } - + render(){ let { tableData, @@ -114,7 +114,7 @@ class GraduateTopicDetail extends Component{

{tableData && tableData.graduation_topic_name} - 返回 + 返回

@@ -141,7 +141,7 @@ class GraduateTopicDetail extends Component{ tab && tab==1&&
- +
{ tableData && tableData.users_count>tablePageSize && @@ -161,4 +161,4 @@ class GraduateTopicDetail extends Component{ ) } } -export default GraduateTopicDetail; \ No newline at end of file +export default GraduateTopicDetail; From ab37080796ce9052290cfba9b026b35b2d2d1cf3 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Mar 2020 17:02:07 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=8E=B7=E5=8F=96=E8=A7=86=E9=A2=91=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/weapps/courses_controller.rb | 10 ++++++++++ app/views/weapps/courses/course_videos.json.jbuilder | 4 ++++ config/routes.rb | 1 + 3 files changed, 15 insertions(+) create mode 100644 app/views/weapps/courses/course_videos.json.jbuilder diff --git a/app/controllers/weapps/courses_controller.rb b/app/controllers/weapps/courses_controller.rb index e1ceb6fd3..c4dde41e0 100644 --- a/app/controllers/weapps/courses_controller.rb +++ b/app/controllers/weapps/courses_controller.rb @@ -48,6 +48,16 @@ class Weapps::CoursesController < Weapps::BaseController render_error(ex.message) end + def course_videos + videos = @course.videos.where(transcoded: true) + videos = custom_sort(videos, params[:sort_by], params[:sort_direction]) + #sql = "left join videos on videos.id=course_videos.video_id AND (videos.transcoded=1 OR videos.user_id = #{current_user.id})" + #@videos = paginate videos.joins(sql).includes(video: [user: :user_extension], user: :user_extension) + videos = videos.includes(user: :user_extension) + @count = videos.count + @videos = paginate videos + end + def basic_info @course = current_course end diff --git a/app/views/weapps/courses/course_videos.json.jbuilder b/app/views/weapps/courses/course_videos.json.jbuilder new file mode 100644 index 000000000..e14e4f5d8 --- /dev/null +++ b/app/views/weapps/courses/course_videos.json.jbuilder @@ -0,0 +1,4 @@ +json.count @count +json.videos @videos do |video| + json.partial! 'users/videos/video', locals: { video: video.video } +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 9c6b73ddc..db9b74bd2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1055,6 +1055,7 @@ Rails.application.routes.draw do get :course_groups get :basic_info get :course_activities + get :course_videos post :change_member_roles delete :delete_course_teachers delete :delete_course_students From f214cef15a972929c57ec9ceaabd7002b966c3a7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 10 Mar 2020 17:02:54 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users/videos_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb index 15365dc69..04e483a6b 100644 --- a/app/controllers/users/videos_controller.rb +++ b/app/controllers/users/videos_controller.rb @@ -57,7 +57,6 @@ class Users::VideosController < Users::BaseController video = Video.find_by(id: params[:id]) return render_forbidden unless video.user_id == current_user.id || current_user.admin? return render_not_found if video.blank? - return render_error('该状态下不能删除视频') unless video.published? video.destroy! From cf038e1542d850de47dc7b08748f7c25677c7e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 17:04:28 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesBanner.js | 2 +- .../courses/exercise/ExerciseNewCommon.js | 2 +- .../exercise/ExerciseReviewAndAnswer.js | 126 +++++++++--------- .../graduation/topics/GraduateTopicDetail.js | 4 +- .../src/modules/courses/new/Goldsubject.js | 2 +- .../react/src/modules/courses/poll/PollNew.js | 14 +- .../modules/courses/poll/PollNewQuestbank.js | 4 +- .../shixunHomework/ShixunWorkReport.js | 2 +- .../courses/shixunHomework/shixunHomework.js | 2 +- 9 files changed, 79 insertions(+), 79 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 8c3520054..7d2791b15 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -294,7 +294,7 @@ class CoursesBanner extends Component { }) that.modalCancel(); message.success("删除成功", 1) - push.push(`/courses`) + push.push(`/classrooms`) } }) diff --git a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js index 736f44308..0f61b9942 100644 --- a/public/react/src/modules/courses/exercise/ExerciseNewCommon.js +++ b/public/react/src/modules/courses/exercise/ExerciseNewCommon.js @@ -157,7 +157,7 @@ class ExerciseNewCommon extends Component{ const exercise_id = response.data.data.exercise_id; this.isEdit = true; - this.props.history.replace(`/courses/${courseId}/exercises/${exercise_id}/edit`); + this.props.history.replace(`/classrooms/${courseId}/exercises/${exercise_id}/edit`); } }) diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 20c40f025..337a9b7e9 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -30,8 +30,8 @@ const { Countdown } = Statistic; const Textarea =Input.TextArea const tagArray = [ - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', - 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] const $ = window.$; @@ -99,8 +99,8 @@ class ExerciseReviewAndAnswer extends Component{ if(this.props.coursedata.name){ this.getInfo(); } - - //window.addEventListener('scroll', this.handleScroll); + + //window.addEventListener('scroll', this.handleScroll); } remainTime=(time)=>{ @@ -170,7 +170,7 @@ class ExerciseReviewAndAnswer extends Component{ sureCommit=()=>{ let coursesId = this.props.match.params.coursesId; let eId = this.props.match.params.Id; - this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`); + this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`); } // 滚动定位 @@ -279,7 +279,7 @@ class ExerciseReviewAndAnswer extends Component{ //答题后更改题目列表得状态 changeQuestionStatus=(No,flag)=>{ this.setState( - (prevState) => ({ + (prevState) => ({ question_status : update(prevState.question_status, {[No]: { ques_status: {$set: flag} }}) }) ) @@ -287,7 +287,7 @@ class ExerciseReviewAndAnswer extends Component{ // 调分 showSetScore=(key,flag,position,type,id)=>{ this.setState( - (prevState) => ({ + (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[key]: { setScore: {$set: flag == undefined || flag==false ? true : false}}}) }),()=>{ if (position && type && (flag == undefined || flag==false)) { @@ -323,7 +323,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"请输入数字" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入数字"}}}) }) ) @@ -334,7 +334,7 @@ class ExerciseReviewAndAnswer extends Component{ // score:value // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { inputSore: {$set: value},setTip:{$set: ""}}}) }) ) @@ -349,7 +349,7 @@ class ExerciseReviewAndAnswer extends Component{ let { ajustSore } = this.state; var index = ajustSore.map(function (item) { return item.id; }).indexOf(id); this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: value}}}) }) ) @@ -368,7 +368,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"请输入分数" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "请输入分数"}}}) }) ) @@ -379,7 +379,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"分数必须大于或者等于0" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数必须大于或者等于0"}}}) }) ) @@ -390,7 +390,7 @@ class ExerciseReviewAndAnswer extends Component{ // setTip:"分数不能大于当前题目的分数" // }) this.setState( - (prevState) => ({ + (prevState) => ({ ajustSore : update(prevState.ajustSore, {[index]: { setTip: {$set: "分数不能大于当前题目的分数"}}}) }) ) @@ -407,15 +407,15 @@ class ExerciseReviewAndAnswer extends Component{ this.props.showNotification('调分成功'); this.getInfo(); // let statusScore = score==0 ? 0 : score > 0 && score < maxScore ? 2 : 1; - + // this.setState( - // (prevState) => ({ + // (prevState) => ({ // exercise_questions : update(prevState.exercise_questions, {[key]: { user_score: {$set: parseFloat(score).toFixed(1)},answer_status : {$set: statusScore},question_comments:{$set:result.data.question_comments} }}), // }) // ) - + // this.setState( - // (prevState) => ({ + // (prevState) => ({ // ajustSore : update(prevState.ajustSore, {[index]: { desc: {$set: undefined},inputSore:{ $set:undefined }}}) // }) // ) @@ -430,14 +430,14 @@ class ExerciseReviewAndAnswer extends Component{ console.log(error); }) } - + } // 选择题,切换答案 changeOption = (index,ids) =>{ //console.log(index+" "+ids); this.setState( - (prevState) => ({ + (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[index]: { user_answer: {$set: ids} }}), }) ) @@ -446,7 +446,7 @@ class ExerciseReviewAndAnswer extends Component{ //简答题 显示和隐藏答案 changeA_flag=(index,status)=>{ this.setState( - (prevState) => ({ + (prevState) => ({ exercise_questions : update(prevState.exercise_questions, {[index]: { a_flag: {$set: status} }}) }) ) @@ -582,7 +582,7 @@ class ExerciseReviewAndAnswer extends Component{ returnBtn = () =>{ let coursesId=this.props.match.params.coursesId; let eId=this.props.match.params.Id; - this.props.history.push(`/courses/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`) + this.props.history.push(`/classrooms/${coursesId}/exercises/${eId}/student_exercise_list?tab=0`) } deadline=(time)=>{ @@ -684,9 +684,9 @@ class ExerciseReviewAndAnswer extends Component{

{courseName} > - {data && data.left_banner_name} + {data && data.left_banner_name} > - {data && data.left_banner_name}详情> + {data && data.left_banner_name}详情> {exercise_answer_user&&exercise_answer_user.user_name}{data&&data.exercise.user_name}

@@ -722,23 +722,23 @@ class ExerciseReviewAndAnswer extends Component{ }

{ - exercise_types && exercise_types.q_singles > 0 && + exercise_types && exercise_types.q_singles > 0 && 单选题 {exercise_types.q_singles} 题,共 {exercise_types && exercise_types.q_singles_scores} 分 } { - exercise_types && exercise_types.q_doubles > 0 && + exercise_types && exercise_types.q_doubles > 0 && 多选题 {exercise_types.q_doubles} 题,共 {exercise_types && exercise_types.q_doubles_scores} 分 } { - exercise_types && exercise_types.q_judges > 0 && + exercise_types && exercise_types.q_judges > 0 && 判断题 {exercise_types.q_judges} 题,共 {exercise_types && exercise_types.q_judges_scores} 分 } { - exercise_types && exercise_types.q_nulls > 0 && + exercise_types && exercise_types.q_nulls > 0 && 填空题 {exercise_types.q_nulls} 题,共 {exercise_types && exercise_types.q_nulls_scores} 分 } { - exercise_types && exercise_types.q_mains > 0 && + exercise_types && exercise_types.q_mains > 0 && 简答题 {exercise_types.q_mains} 题,共 {exercise_types && exercise_types.q_mains_scores} 分 } { @@ -755,11 +755,11 @@ class ExerciseReviewAndAnswer extends Component{ { exercise_start_at && 开始答题时间:{ exercise_start_at && moment(exercise_start_at).format(format) } } - { - (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore && + { + (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && exerciseTotalScore && 总分: { exerciseTotalScore } } - + { // 老师身份 || 学生身份且试卷已经截止 (isAdmin || (isStudent && exercise && exercise.exercise_status == 3)) && @@ -785,7 +785,7 @@ class ExerciseReviewAndAnswer extends Component{

} { - exercise_scores && exercise_scores.subjective_scores.length > 0 && + exercise_scores && exercise_scores.subjective_scores.length > 0 &&

主观题 @@ -804,8 +804,8 @@ class ExerciseReviewAndAnswer extends Component{

}
- } - + } + { //学生身份 且试卷还未截止 isStudent && exercise && exercise.exercise_status == 2 ? @@ -838,12 +838,12 @@ class ExerciseReviewAndAnswer extends Component{ { // 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮 - isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ? + isAdmin && ((parseInt(item.answer_status) != 0 && item.question_type == 4) || item.question_type == 3 || item.question_type == 1) ? this.showSetScore(key,item.setScore,item.q_position,item.question_type,item.question_id)}>调分:"" } { // 简答题,未评分的显示未批 - isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ? + isAdmin && parseInt(item.answer_status) == 0 && item.question_type == 4 ? 未批:"" } { @@ -869,16 +869,16 @@ class ExerciseReviewAndAnswer extends Component{

  • {/*

    */} -
  • { // 选择题和判断题共用 - (item.question_type == 0 || item.question_type == 2) && - } - + { //调分理由部分 - item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) && + item.question_comments && item.question_comments.comment && (item.question_type == 3 || item.question_type == 4 || item.question_type == 1) &&
    @@ -967,14 +967,14 @@ class ExerciseReviewAndAnswer extends Component{ *调分:
  • - 0 && list[0].inputSore} - step={0.1} + 0 && list[0].inputSore} + step={0.1} precision={1} - className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"} + className={ list && list.length>0 && list[0].setTip !="" ? "edu-txt-center winput-115-40 fl mt3 noticeTip inputNumber30" : "edu-txt-center winput-115-40 fl mt3 inputNumber30"} onChange={(value)=>this.inputScore(value,item.question_id)} id={`${"input_"+item.q_position+"_"+item.question_type}`} > @@ -1016,4 +1016,4 @@ class ExerciseReviewAndAnswer extends Component{ ) } } -export default ExerciseReviewAndAnswer \ No newline at end of file +export default ExerciseReviewAndAnswer diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js index 4097a051e..50368fe9c 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicDetail.js @@ -107,7 +107,7 @@ class GraduateTopicDetail extends Component{

    {tableData && tableData.course_name} > - {tableData.graduation_name} + {tableData.graduation_name} > 选题详情

    @@ -134,7 +134,7 @@ class GraduateTopicDetail extends Component{ 取消选题 } { - isAdmin && 编辑 + isAdmin && 编辑 }
  • { diff --git a/public/react/src/modules/courses/new/Goldsubject.js b/public/react/src/modules/courses/new/Goldsubject.js index b3fd113da..6d637552d 100644 --- a/public/react/src/modules/courses/new/Goldsubject.js +++ b/public/react/src/modules/courses/new/Goldsubject.js @@ -720,7 +720,7 @@ class Goldsubject extends Component { {/* {Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"}*/} {/**/}

    - {Whethertocreateanewclassroom===true?"教学课堂":name} > {Whethertocreateanewclassroom===true?"新建课堂":"编辑课堂"} diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 3b50695e8..a3cbba89b 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -362,7 +362,7 @@ class PollNew extends Component { pollid: result.data.data.id, Newedit: false, }) - this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) + this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) } }) } @@ -2590,7 +2590,7 @@ class PollNew extends Component { if (result.data.status === 0) { // console.log("更新题目成功") // this.props.showNotification("保存成功"); - this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`) + this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`) } } catch (e) { @@ -2766,7 +2766,7 @@ class PollNew extends Component { // // let courseId=this.props.match.params.coursesId; // if(courseId===undefined){ - // this.props.history.push("/courses"); + // this.props.history.push("/classrooms"); // }else{ // this.props.history.push(this.props.current_user.first_category_url); // } @@ -2833,10 +2833,10 @@ class PollNew extends Component { { this.props.match.params.news === "new"? 问卷 + href={`/classrooms/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷 : 问卷 + href={`/classrooms/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷 } > @@ -2847,10 +2847,10 @@ class PollNew extends Component { className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

    { this.props.match.params.news === "new" ? - : - }
    diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index ad68530e7..58aa916c4 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -385,7 +385,7 @@ class PollNewQuestbank extends Component { pollid: result.data.data.id, Newedit: false, }) - this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) + this.props.history.push(`/classrooms/${this.props.match.params.coursesId}/polls/${result.data.data.id}/detail?tab=2`) } }) } @@ -4309,4 +4309,4 @@ export default PollNewQuestbank {/* */ } {/*}*/ -} \ No newline at end of file +} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 28292d13b..5e4842574 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -138,7 +138,7 @@ class ShixunWorkReport extends Component { gotohome=()=>{ let courseId=this.props.match.params.coursesId; if(courseId===undefined){ - this.props.history.push("/courses"); + this.props.history.push("/classrooms"); }else{ this.props.history.push(this.props.current_user.first_category_url); } diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 74f2ed7a2..605c649d8 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -974,7 +974,7 @@ class ShixunHomework extends Component{ gotohome=()=>{ let courseId=this.props.match.params.coursesId; if(courseId===undefined){ - this.props.history.push("/courses"); + this.props.history.push("/classrooms"); }else{ this.props.history.push(this.props.current_user.first_category_url); } From 60e26b0b129bb4fea9bb10ffae7af48c35e1c046 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 10 Mar 2020 17:06:17 +0800 Subject: [PATCH 5/9] issue --- .../user/usersInfo/video/InfosVideo.css | 3 - .../user/usersInfo/video/InfosVideo.js | 58 ++++++++++++++----- .../user/usersInfo/video/VideoInReviewItem.js | 10 ++-- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.css b/public/react/src/modules/user/usersInfo/video/InfosVideo.css index a28f7cf5d..60813fb0c 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.css +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.css @@ -68,9 +68,6 @@ } -.videoInReviewItem .square-main { - background: #EAEAEA; -} .videoItem .time { color: #C0C4CC; } diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js index 1557b0686..8f2f9dab3 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.js @@ -65,8 +65,9 @@ function InfoVideo(props) { const videoEl = useRef(null); const { showNotification, history } = props; - const username = props.match.params.username - + const username = props.match.params.username; + const { user } = props; + console.log(user); function toUpload() { if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { history.push(`/users/${username}/videos/upload`) @@ -87,16 +88,15 @@ function InfoVideo(props) { sort_direction: sorts[1], // } + }).then((response) => { + setLoading(false) + if (response.data.videos) { + setvideos(response.data.videos) + setCount(response.data.count) + } + }).catch(() => { + setLoading(false) }) - .then((response) => { - setLoading(false) - if (response.data.videos) { - setvideos(response.data.videos) - setCount(response.data.count) - } - }).catch(() => { - setLoading(false) - }) } function fetchReviewvideos() { const fetchUrl = `/users/${username}/videos/review.json` @@ -184,9 +184,8 @@ function InfoVideo(props) { videoId = { videoId: item.id, title: item.title, - file_url: item.file_url, + file_url: item.play_url || item.file_url, cover_url: item.cover_url - } videoModalObj.setVisible(true) } @@ -218,6 +217,36 @@ function InfoVideo(props) { } + + function deleteVideo(item){ + props.confirm({ + content: '该视频将被删除,不可恢复', + subContent: '是否确认删除?', + + onOk: () => { + const url = `/users/${user && user.login}/videos/${item.id}.json`; + axios.delete(url).then(result => { + if (result) { + props.showNotification(`视频删除成功!`); + if (pageObj.current === 1) { + if (categoryObj.category === 'all') { + fetchvideos() + } else { + fetchReviewvideos() + } + } else { + pageObj.onChange(1) + } + } + }).catch(error => { + console.log(error); + }) + }, + onCancel() { + console.log('Cancel'); + }, + }); + } function getCopyText(file_url, cover_url) { return `` } @@ -397,7 +426,7 @@ function InfoVideo(props) { onEditVideo={onEditVideo} onMaskClick={onMaskClick} getCopyText={getCopyText} - + deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined} > ) }) @@ -416,6 +445,7 @@ function InfoVideo(props) { {...item} key={item.id} isReview={true} + deleteVideo={user && ((user.login === item.user_login) || user.admin) ? deleteVideo : undefined} > ) }) diff --git a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js index 6849db062..4e0ca8fb2 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js +++ b/public/react/src/modules/user/usersInfo/video/VideoInReviewItem.js @@ -79,9 +79,9 @@ function VideoInReviewItem (props) { } {!vv || (vv && vv)===0?"":vv}
    - { isReview != true &&
    +
    { - moveVideo && + isReview !== true && moveVideo && moveVideo(props)} style={{ marginTop: '1px', display: 'inline-block'}} @@ -98,7 +98,7 @@ function VideoInReviewItem (props) { } { - operation && + isReview !== true && operation && onEditVideo(props)} style={{ marginTop: '1px', display: 'inline-block'}} @@ -106,13 +106,13 @@ function VideoInReviewItem (props) { } { - !link ? + isReview !== true && !link ? :"" } -
    } +
    From bf3924f3891e533496d7c7940a7559c7d2b4f39b Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Tue, 10 Mar 2020 17:45:12 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E8=A7=86=E9=A2=91=E5=81=9C=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/user/usersInfo/video/InfosVideo.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js index 8f2f9dab3..05d726628 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.js @@ -67,7 +67,7 @@ function InfoVideo(props) { const { showNotification, history } = props; const username = props.match.params.username; const { user } = props; - console.log(user); + function toUpload() { if (props.current_user.admin || (props.current_user.is_teacher && props.checkIfProfessionalCertification())) { history.push(`/users/${username}/videos/upload`) @@ -144,7 +144,8 @@ function InfoVideo(props) { useEffect(() => { if (videoModalObj.visible == false) { // 关闭视频 - videoEl.current && videoEl.current.pause() + videoEl.current && videoEl.current.pause(); + videoId = {}; if (_clipboard) { _clipboard.destroy(); _clipboard = null; @@ -266,7 +267,7 @@ function InfoVideo(props) { className="showVideoModal" width={800 - 1} > - + {videoModalObj.visible && }
    Date: Tue, 10 Mar 2020 18:18:36 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesDetail/CoursesLeftNav.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index b4912f6c4..f8e425128 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -181,6 +181,7 @@ class Coursesleftnav extends Component{ } componentDidMount() { + this.setState({ url:this.props.match.url }) @@ -545,7 +546,7 @@ class Coursesleftnav extends Component{ message:"提示", description:result.data.message }); - + if(positiontype==="files"){ this.updasaveNavmoda() From 8a5d0b14ca25746552314c718e10d7df2faee77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 10 Mar 2020 18:24:24 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesDetail/CoursesLeftNav.js | 2 +- .../react/src/modules/courses/shixunHomework/shixunHomework.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index f8e425128..6569b4f10 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -546,7 +546,7 @@ class Coursesleftnav extends Component{ message:"提示", description:result.data.message }); - + if(positiontype==="files"){ this.updasaveNavmoda() diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 605c649d8..e32479735 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -1179,7 +1179,7 @@ class ShixunHomework extends Component{ {datas===undefined?"":datas.homeworks && datas.homeworks.length>1?this.props.isAdminOrCreator()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null? - 调整排序 + 调整排序 :"":"":""} From 210c2a3eff7bfb6054a42e627c6e2d03ef2817b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 10 Mar 2020 18:39:13 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=99=AE=E9=80=9A=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E3=80=81=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=B7=B2=E8=AF=84=E6=95=B0=E3=80=81=E8=B5=84=E6=BA=90=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/Resource/index.js | 2 +- .../modules/courses/busyWork/CommonWorkList.js | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 787865219..8f32699ce 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -916,7 +916,7 @@ class Fileslists extends Component{ { ` .filesnameslist{ - max-width: 486px; + max-width: 389px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 42ca215ba..6125c3e02 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -285,7 +285,23 @@ function buildColumns(that, student_works, studentData) { ), }) } + if (that.state.anonymous_comment) { + /** + 开启了匿评的才显示此列 + */ + columns.push({ + width: 84, + title:
    已评数
    , + key: 'user_comment_count', + dataIndex: 'user_comment_count', + render: (student_score, record) => ( + + {record.user_comment_count} + + ), + }) + } if (that.state.anonymous_appeal) { columns.push({ width: 70,