From ba740a815bf06644c3cc02f47041260273cbb23a Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 17 Mar 2020 10:46:09 +0800 Subject: [PATCH 01/38] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/courses_controller.rb | 4 ++-- app/models/course.rb | 4 ++++ app/views/admins/courses/index.xlsx.axlsx | 8 ++++++-- app/views/admins/courses/shared/_list.html.erb | 14 +++++++++----- app/views/admins/courses/shared/_td.html.erb | 6 +++++- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/app/controllers/admins/courses_controller.rb b/app/controllers/admins/courses_controller.rb index 518054e12..c1093d9e7 100644 --- a/app/controllers/admins/courses_controller.rb +++ b/app/controllers/admins/courses_controller.rb @@ -7,13 +7,13 @@ class Admins::CoursesController < Admins::BaseController courses = Admins::CourseQuery.call(params) @ended_courses = courses.where(is_end: 1).size @processed_courses = courses.where(is_end: 0).size - @courses = paginate courses.includes(:school, :students, :attachments, :homework_commons, teacher: :user_extension) + @courses = paginate courses.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, teacher: :user_extension) respond_to do |format| format.js format.html format.xlsx do - @courses = courses.includes(:school, :students, :attachments, :homework_commons, :course_acts, teacher: :user_extension) + @courses = courses.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, :course_activities, teacher: :user_extension) filename = "课堂列表_#{Time.current.strftime('%Y%m%d%H%M%S')}.xlsx" render xlsx: 'index', filename: filename end diff --git a/app/models/course.rb b/app/models/course.rb index a0daaea22..cb8e3560d 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -406,6 +406,10 @@ class Course < ApplicationRecord homework_commons.select{|homework| homework.homework_type == type}.size end + def student_works_count + StudentWork.joins(:homework_common).where(homework_commons: {course_id: id}).where("work_status > 0").size + end + private #创建课程后,给该用户发送消息 diff --git a/app/views/admins/courses/index.xlsx.axlsx b/app/views/admins/courses/index.xlsx.axlsx index 7cab54482..cb8ab0610 100644 --- a/app/views/admins/courses/index.xlsx.axlsx +++ b/app/views/admins/courses/index.xlsx.axlsx @@ -3,17 +3,21 @@ wb = xlsx_package.workbook wb.styles do |s| blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center} wb.add_worksheet(name: "课堂列表") do |sheet| - sheet.add_row %w(ID 课堂名称 成员 资源 普通作业 分组作业 实训作业 试卷 评测次数 私有 状态 单位 创建者 创建时间 动态时间), :height => 25,:style => blue_cell + sheet.add_row %w(ID 课堂名称 老师 学生 资源 公告 视频 普通作业 分组作业 实训作业 作品数 试卷 评测次数 私有 状态 单位 创建者 创建时间 动态时间), :height => 25,:style => blue_cell @courses.each do |course| data = [ course.id, course.name, - course.course_members_count, + course.teacher_course_members.size, + course.students.size, get_attachment_count(course, 0), + course.informs.size, + course.course_videos.size, course.course_homework_count(1), course.course_homework_count(3), course.course_homework_count(4), + course.student_works_count, course.exercises_count, course.evaluate_count, course.is_public == 1 ? "--" : "√", diff --git a/app/views/admins/courses/shared/_list.html.erb b/app/views/admins/courses/shared/_list.html.erb index 4105c8153..47839c549 100644 --- a/app/views/admins/courses/shared/_list.html.erb +++ b/app/views/admins/courses/shared/_list.html.erb @@ -3,18 +3,22 @@ 序号 ID - 课堂名称 - 成员 + 课堂名称 + 老师 + 学生 资源 + 公告 + 视频 普通作业 分组作业 实训作业 + 作品数 试卷 评测次数 私有 - 状态 - 单位 - 创建者 + 状态 + 单位 + 创建者 <%= sort_tag('创建时间', name: 'created_at', path: admins_courses_path) %> 首页 邮件通知 diff --git a/app/views/admins/courses/shared/_td.html.erb b/app/views/admins/courses/shared/_td.html.erb index 7b72179da..397a69aae 100644 --- a/app/views/admins/courses/shared/_td.html.erb +++ b/app/views/admins/courses/shared/_td.html.erb @@ -3,11 +3,15 @@ <%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %> -<%= course.course_members_count %> +<%= course.teacher_course_members.size %> +<%= course.students.size %> <%= get_attachment_count(course, 0) %> +<%= course.informs.size %> +<%= course.course_videos.size %> <%= course.course_homework_count("normal") %> <%= course.course_homework_count("group") %> <%= course.course_homework_count("practice") %> +<%= course.student_works_count %> <%= course.exercises_count %> <%= course.evaluate_count %> <%= course.is_public == 1 ? "--" : "√" %> From fdef75d144baa4593fb8794b6aefc87ea5305e22 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 17 Mar 2020 11:03:28 +0800 Subject: [PATCH 02/38] =?UTF-8?q?=E9=83=A8=E9=97=A8=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admins/courses_controller.rb | 2 +- app/views/admins/courses/index.xlsx.axlsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admins/courses_controller.rb b/app/controllers/admins/courses_controller.rb index c1093d9e7..4f82d5d58 100644 --- a/app/controllers/admins/courses_controller.rb +++ b/app/controllers/admins/courses_controller.rb @@ -13,7 +13,7 @@ class Admins::CoursesController < Admins::BaseController format.js format.html format.xlsx do - @courses = courses.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, :course_activities, teacher: :user_extension) + @courses = courses.includes(:school, :students, :teacher_course_members, :informs, :course_videos, :attachments, :homework_commons, :course_activities, teacher: [user_extension: :department]) filename = "课堂列表_#{Time.current.strftime('%Y%m%d%H%M%S')}.xlsx" render xlsx: 'index', filename: filename end diff --git a/app/views/admins/courses/index.xlsx.axlsx b/app/views/admins/courses/index.xlsx.axlsx index cb8ab0610..3185f21be 100644 --- a/app/views/admins/courses/index.xlsx.axlsx +++ b/app/views/admins/courses/index.xlsx.axlsx @@ -3,7 +3,7 @@ wb = xlsx_package.workbook wb.styles do |s| blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center} wb.add_worksheet(name: "课堂列表") do |sheet| - sheet.add_row %w(ID 课堂名称 老师 学生 资源 公告 视频 普通作业 分组作业 实训作业 作品数 试卷 评测次数 私有 状态 单位 创建者 创建时间 动态时间), :height => 25,:style => blue_cell + sheet.add_row %w(ID 课堂名称 老师 学生 资源 公告 视频 普通作业 分组作业 实训作业 作品数 试卷 评测次数 私有 状态 单位 部门 创建者 创建时间 动态时间), :height => 25,:style => blue_cell @courses.each do |course| data = [ @@ -23,6 +23,7 @@ wb.styles do |s| course.is_public == 1 ? "--" : "√", course.is_end ? "已结束" : "正在进行", course.school&.name, + course.teacher&.department_name course.teacher&.real_name, course.created_at&.strftime('%Y-%m-%d %H:%M'), course.max_activity_time ? course.max_activity_time&.strftime('%Y-%m-%d %H:%M') : "--" From 3fca3d83244b97142b38978497663c6c33312978 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 17 Mar 2020 11:13:11 +0800 Subject: [PATCH 03/38] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/courses/index.xlsx.axlsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admins/courses/index.xlsx.axlsx b/app/views/admins/courses/index.xlsx.axlsx index 3185f21be..22cf58e4d 100644 --- a/app/views/admins/courses/index.xlsx.axlsx +++ b/app/views/admins/courses/index.xlsx.axlsx @@ -23,7 +23,7 @@ wb.styles do |s| course.is_public == 1 ? "--" : "√", course.is_end ? "已结束" : "正在进行", course.school&.name, - course.teacher&.department_name + course.teacher&.department_name, course.teacher&.real_name, course.created_at&.strftime('%Y-%m-%d %H:%M'), course.max_activity_time ? course.max_activity_time&.strftime('%Y-%m-%d %H:%M') : "--" From 34df3fd1c06e8a1302df83715ed08ce1071f06fb 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, 17 Mar 2020 11:21:29 +0800 Subject: [PATCH 04/38] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/signin/css/signincdi.css | 1 + .../videostatistics/Videostatistics.js | 13 +---------- .../component/Videostatisticscom.js | 4 ++++ .../component/Videostatisticscomtwo.js | 22 +++++++++++++++---- .../component/Videostatisticslist.js | 2 +- 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index a7fbbb20a..9416de345 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -440,3 +440,4 @@ .mr32{ margin-right: 32px; } + diff --git a/public/react/src/modules/courses/videostatistics/Videostatistics.js b/public/react/src/modules/courses/videostatistics/Videostatistics.js index f497b3ca6..ba4891b2c 100644 --- a/public/react/src/modules/courses/videostatistics/Videostatistics.js +++ b/public/react/src/modules/courses/videostatistics/Videostatistics.js @@ -64,19 +64,8 @@ class Videostatistics extends Component{
-
-

- this.props.statisticsy(false)}> -

this.props.statisticsy(false)}>返回

-

- - -
- + this.props.statisticsy(b)}> diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js index 1111b6509..3c12ff424 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js @@ -35,6 +35,10 @@ class Videostatisticscom extends Component { }}>
+

this.props.statisticsy(false)} > + this.props.statisticsy(false)}> +

this.props.statisticsy(false)}>返回

+

视频统计总览
播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计
diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js index b64cd06ac..8c4025143 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js @@ -203,7 +203,7 @@ class Videostatisticscomtwo extends Component { number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1), user_name: response.data.data[i].user_name, is_finished: response.data.data[i].is_finished, - total_duration: response.data.data[i].total_duration, + total_duration: response.data.data[i].total_duration?formatSeconds(response.data.data[i].total_duration):0, feq: response.data.data[i].feq, start_at: response.data.data[i].start_at, end_at: response.data.data[i].end_at, @@ -291,10 +291,24 @@ class Videostatisticscomtwo extends Component { } } else { - data = { - id: CourseId, - page: this.state.page + try { + if(id!==null&&id===0){ + data = { + id: CourseId, + page: this.state.page, + group_id: id + } + }else{ + data = { + id: CourseId, + page: this.state.page + } + } + + }catch (e) { + } + } this.getdatas(data); } diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js index fa24c9c32..a30d872de 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js @@ -152,7 +152,7 @@ class Videostatisticslist extends Component { number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1), title: response.data.videos[i].title, people_num: response.data.videos[i].people_num, - total_time: response.data.videos[i].total_time, + total_time: response.data.videos[i].total_time?formatSeconds(response.data.videos[i].total_time):0, user_name: response.data.videos[i].user_name, id: response.data.videos[i].id, }) From fcdd2da413c95169994f53e30a21e66adee702e7 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 17 Mar 2020 11:36:07 +0800 Subject: [PATCH 05/38] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/admins/courses/index.xlsx.axlsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/admins/courses/index.xlsx.axlsx b/app/views/admins/courses/index.xlsx.axlsx index cb8ab0610..f21141de0 100644 --- a/app/views/admins/courses/index.xlsx.axlsx +++ b/app/views/admins/courses/index.xlsx.axlsx @@ -14,9 +14,9 @@ wb.styles do |s| get_attachment_count(course, 0), course.informs.size, course.course_videos.size, - course.course_homework_count(1), - course.course_homework_count(3), - course.course_homework_count(4), + course.course_homework_count("normal"), + course.course_homework_count("group"), + course.course_homework_count("practice"), course.student_works_count, course.exercises_count, course.evaluate_count, From f987bcd5e2e882ac186bd501b6c8d354b0250721 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 17 Mar 2020 11:41:30 +0800 Subject: [PATCH 06/38] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=A2=9E=E5=8A=A0=E7=BB=9F=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/course.rb | 5 +++++ app/views/admins/courses/index.xlsx.axlsx | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/course.rb b/app/models/course.rb index cb8e3560d..d4d5387d5 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -406,6 +406,11 @@ class Course < ApplicationRecord homework_commons.select{|homework| homework.homework_type == type}.size end + # 课堂作业数 + def published_course_homework_count type + homework_commons.select{|homework| homework.homework_type == type && homework.publish_time.present? && homework.publish_time <= Time.now}.size + end + def student_works_count StudentWork.joins(:homework_common).where(homework_commons: {course_id: id}).where("work_status > 0").size end diff --git a/app/views/admins/courses/index.xlsx.axlsx b/app/views/admins/courses/index.xlsx.axlsx index 9690eaa05..bc6581972 100644 --- a/app/views/admins/courses/index.xlsx.axlsx +++ b/app/views/admins/courses/index.xlsx.axlsx @@ -3,7 +3,7 @@ wb = xlsx_package.workbook wb.styles do |s| blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center} wb.add_worksheet(name: "课堂列表") do |sheet| - sheet.add_row %w(ID 课堂名称 老师 学生 资源 公告 视频 普通作业 分组作业 实训作业 作品数 试卷 评测次数 私有 状态 单位 部门 创建者 创建时间 动态时间), :height => 25,:style => blue_cell + sheet.add_row %w(ID 课堂名称 老师 学生 资源 公告 视频 普通作业 分组作业 实训作业 实训作业已发布数 作品数 试卷 评测次数 私有 状态 单位 部门 创建者 创建时间 动态时间), :height => 25,:style => blue_cell @courses.each do |course| data = [ @@ -17,6 +17,7 @@ wb.styles do |s| course.course_homework_count("normal"), course.course_homework_count("group"), course.course_homework_count("practice"), + course.published_course_homework_count("practice"), course.student_works_count, course.exercises_count, course.evaluate_count, From 25e6feccec7855f60ee17d6bf44b9b753a144056 Mon Sep 17 00:00:00 2001 From: anke1460 Date: Tue, 17 Mar 2020 11:43:14 +0800 Subject: [PATCH 07/38] =?UTF-8?q?fix=20=E8=A7=86=E9=A2=91=E7=9C=8B?= =?UTF-8?q?=E5=AE=8C=E6=B2=A1=E6=A0=87=E8=AE=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/create_watch_video_service.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/services/create_watch_video_service.rb b/app/services/create_watch_video_service.rb index 0f1b32814..5a3813571 100644 --- a/app/services/create_watch_video_service.rb +++ b/app/services/create_watch_video_service.rb @@ -33,12 +33,10 @@ class CreateWatchVideoService < ApplicationService if watch_course_video.present? watch_course_video.total_duration = watch_course_video.watch_video_histories.sum(:total_duration) watch_course_video.end_at = current_time - if !watch_course_video.is_finished && watch_course_video.watch_duration < params[:watch_duration] + if !watch_course_video.is_finished # 更新课程视频的时长及是否看完状态 - watch_course_video.watch_duration = params[:watch_duration] - if params[:ed].present? - watch_course_video.is_finished = watch_course_video.total_duration >= watch_course_video.duration - end + watch_course_video.watch_duration = params[:watch_duration] if watch_course_video.watch_duration < params[:watch_duration] + watch_course_video.is_finished = watch_course_video.total_duration >= watch_course_video.duration if params[:ed].present? end watch_course_video.save! end From b4703c01eb7b3efa33365834c8dccce33be9f57c 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, 17 Mar 2020 11:46:09 +0800 Subject: [PATCH 08/38] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/signin/css/signincdi.css | 13 ++++++++++++- .../component/Videostatisticscom.js | 2 +- .../component/Videostatisticscomtwo.js | 16 ++++++++-------- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index 9416de345..cdd41eede 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -100,7 +100,10 @@ width: 80%; } .ws50s{ - width: 50%; + width: 50%; + } +.ws40s{ + width: 40%; } .hs30s{ height: 30%; @@ -425,6 +428,14 @@ white-space:nowrap; cursor: default; } +.maxnamewidth90s{ + width: 90px; + max-width: 90px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} .maxnamewidth100s{ width: 100px; max-width: 100px; diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js index 3c12ff424..dff57d642 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js @@ -39,7 +39,7 @@ class Videostatisticscom extends Component { this.props.statisticsy(false)}>

this.props.statisticsy(false)}>返回

-
视频统计总览
+
视频统计总览
播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计
- {/*计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}*/} - {/* { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":*/} - {/* {computeTimetype===true?*/} - - {/* (this.props.isNotMember()===false?*/} - {/* (*/} - {/* teacherdata&&teacherdata.update_score===true?*/} - {/*
*/} - {/* 查看最新成绩*/} - {/*
:""*/} - {/* )*/} - {/* :""):*/} - {/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/} - {/* (this.props.isNotMember()===false?
*/} - {/* 查看最新成绩*/} - {/*
:"")*/} - {/* }*/} - {/*
}*/} +
From be50b57aae5a7cc8578596d49e5deb8559f2abfd Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 17 Mar 2020 14:12:27 +0800 Subject: [PATCH 13/38] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=BF=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/left_banner.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/courses/left_banner.json.jbuilder b/app/views/courses/left_banner.json.jbuilder index b53dbbb79..efc40f5ef 100644 --- a/app/views/courses/left_banner.json.jbuilder +++ b/app/views/courses/left_banner.json.jbuilder @@ -30,6 +30,7 @@ json.course_modules @course_modules.each do |mod| json.third_category category.children do |child| json.partial! "category_info", category: child + json.parent_id child.parent_id end end end From 7b32ae5c30be796a6c326f4842d6c8746d37a462 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, 17 Mar 2020 14:15:45 +0800 Subject: [PATCH 14/38] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=97=B6=E9=97=B4=20=E6=97=B6=E9=97=B4=E9=95=BF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworksstudentone.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index f6e82d396..fb9c244cd 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2519,7 +2519,6 @@ class Listofworksstudentone extends Component { axios.get(url).then((response) => { if (response) { if (response.data.status === 0) { - setTimeout(() => { this.props.showNotification(`${response.data.message}`); // var homeworkid = this.props.match.params.homeworkid; this.Getalistofworks(homeworkid, false); @@ -2529,12 +2528,14 @@ class Listofworksstudentone extends Component { } catch (e) { } - }, 2500); } } // this.Getalistofworkstwo("", "", "", "", 1, 20); }).catch((error) => { console.log(error) + this.setState({ + computeTimetype:true + }) }); } @@ -3364,7 +3365,6 @@ class Listofworksstudentone extends Component { axios.get(url).then((response) => { if (response) { if (response.data.status === 0) { - setTimeout(() => { this.setState({ loadingstate: true }) @@ -3379,11 +3379,13 @@ class Listofworksstudentone extends Component { } catch (e) { } - }, 500); } } }).catch((error) => { console.log(error) + this.setState({ + computeTimetype:true + }) }); }; From b84f1a435eafb59b90e814f38d0717233bb67145 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, 17 Mar 2020 14:37:06 +0800 Subject: [PATCH 15/38] =?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/videostatistics/component/Videostatisticscom.js | 2 +- .../courses/videostatistics/component/Videostatisticscomtwo.js | 2 +- .../courses/videostatistics/component/Videostatisticslist.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js index 220a59b46..c819e76c9 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscom.js @@ -39,7 +39,7 @@ class Videostatisticscom extends Component { this.props.statisticsy(false)} style={{color:'#5091FF'}}>

this.props.statisticsy(false)}>返回

-
视频统计总览
+
视频统计总览
播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计
-
+
观看总人数(人)
diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js index bba642e6a..056191a4d 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js @@ -252,7 +252,7 @@ class Videostatisticslist extends Component {
-
统计详情
+
统计列表
From 0438df7ce92584be1ba0b50c0c53dc8fdd076680 Mon Sep 17 00:00:00 2001 From: dinglink <837816638@qq.com> Date: Tue, 17 Mar 2020 15:10:00 +0800 Subject: [PATCH 18/38] =?UTF-8?q?=E8=B5=84=E6=BA=90=E4=B8=89=E7=BA=A7?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E7=BC=A9=E8=BF=9B=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/Resource/index.js | 54 ++++++++++--------- .../courses/coursesDetail/CoursesLeftNav.js | 31 +++++------ .../modules/courses/shixunHomework/guide.css | 4 ++ 3 files changed, 47 insertions(+), 42 deletions(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 5c8cc7831..92eeafe3e 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -144,10 +144,6 @@ class Fileslists extends Component{ } } - - - - } updadatalist=(id)=>{ @@ -184,8 +180,8 @@ class Fileslists extends Component{ } updatafiled=()=>{ - - let{sort}=this.state; + console.log(5) + let{sort}=this.state; if(this.props.match.params.main_id){ this.seactall(undefined,sort); }else if(this.props.match.params.Id){ @@ -219,12 +215,15 @@ class Fileslists extends Component{ }) newsort="desc" } - + console.log(1) this.getfileslist(pagesize,page,tagname,searchValue,newsort,sorttype,coursesecondcategoryid); } getfileslist=(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid)=>{ + + this.updadatalist(0); + let url = "/files.json"; const courseid = this.props.match.params.coursesId; let id=coursesecondcategoryid; @@ -446,6 +445,7 @@ class Fileslists extends Component{ onPressEnter = () => { let {searchValue}=this.state; let{pagesize,page,tagname,sort,sorttype,coursesecondcategoryid}=this.state; + console.log(2) this.getfileslist(pagesize,1,tagname,searchValue,sort,sorttype,coursesecondcategoryid); } @@ -456,17 +456,21 @@ class Fileslists extends Component{ } addDir = () => { - let {filesId,course_modules}=this.state; + let {filesId,course_modules,coursesecondcategoryid}=this.state; + //调用获取资源接口 刷新数据 this.setState({ checkBoxValues:[] - }) + }) + + console.log(this.props); if(parseInt(this.props.match.params.main_id)!=parseInt(this.props.coursesids)){ - trigger('attachmentAddlog', {id: parseInt( course_modules&&course_modules.course_modules[0].value),name:'资源'}) + + trigger('attachmentAddlog', {id: parseInt( course_modules&&course_modules.course_modules[0].value),name:'资源',coursesecondcategoryid:coursesecondcategoryid}) }else{ console.log(parseInt(filesId)) - trigger('attachmentAddlog', {id:parseInt(filesId),name:'资源'}) - } + trigger('attachmentAddlog', {id:parseInt(filesId),name:'资源',coursesecondcategoryid:coursesecondcategoryid}) + } } @@ -557,6 +561,7 @@ class Fileslists extends Component{ this.onCheckBoxChange(checkBoxValues) } PaginationTask=(page)=>{ + console.log(3) let {search,order,selectpage,checkAllValue,checkBoxValues}=this.state; let selectpagetype=selectpage===page?true:false @@ -631,6 +636,7 @@ class Fileslists extends Component{ Updateresourcepage=()=>{ + console.log(4) let{pagesize,tagname,searchValue,page,sort,sorttype,coursesecondcategoryid}=this.state; this.getfileslist(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid); } @@ -1012,9 +1018,7 @@ class Fileslists extends Component{ margin-left: 10px; padding: 10px; } - .bordboom{ - border-bottom: 1 solid red; - } + `}