Merge branch 'courseware' of http://bdgit.educoder.net/Hjqreturn/educoder into courseware

courseware
dinglink 5 years ago
commit 7c1a864ec2

@ -7,13 +7,13 @@ class Admins::CoursesController < Admins::BaseController
courses = Admins::CourseQuery.call(params) courses = Admins::CourseQuery.call(params)
@ended_courses = courses.where(is_end: 1).size @ended_courses = courses.where(is_end: 1).size
@processed_courses = courses.where(is_end: 0).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| respond_to do |format|
format.js format.js
format.html format.html
format.xlsx do 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: :department])
filename = "课堂列表_#{Time.current.strftime('%Y%m%d%H%M%S')}.xlsx" filename = "课堂列表_#{Time.current.strftime('%Y%m%d%H%M%S')}.xlsx"
render xlsx: 'index', filename: filename render xlsx: 'index', filename: filename
end end

@ -26,14 +26,13 @@ class CourseVideosController < ApplicationController
@watch_course_videos = course_video.watch_course_videos.joins(" @watch_course_videos = course_video.watch_course_videos.joins("
JOIN watch_video_histories ON watch_video_histories.watch_course_video_id = watch_course_videos.id JOIN watch_video_histories ON watch_video_histories.watch_course_video_id = watch_course_videos.id
JOIN course_members ON course_members.user_id = watch_course_videos.user_id AND course_members.course_id = #{@course.id} AND role = 4
").group("watch_video_histories.watch_course_video_id").where("watch_course_videos.end_at IS NOT NULL").select("watch_course_videos.id") ").group("watch_video_histories.watch_course_video_id").where("watch_course_videos.end_at IS NOT NULL").select("watch_course_videos.id")
@count = @watch_course_videos.count.count @count = @watch_course_videos.count.count
if params[:group_id].present? if params[:group_id].present?
@watch_course_videos = @watch_course_videos.joins(" @watch_course_videos = @watch_course_videos.where("course_members.course_group_id = ?", params[:group_id])
JOIN course_members ON course_members.user_id = watch_course_videos.user_id AND course_members.course_id = #{@course.id}
").where("course_members.course_group_id = ?", params[:group_id])
end end
@watch_course_videos = @watch_course_videos.select("count(watch_video_histories.id) AS freq, watch_course_videos.*") @watch_course_videos = @watch_course_videos.select("count(watch_video_histories.id) AS freq, watch_course_videos.*")

@ -1494,6 +1494,7 @@ class CoursesController < ApplicationController
SELECT watch_course_videos.course_video_id, SUM(watch_course_videos.total_duration) AS time, COUNT(watch_course_videos.course_video_id) AS num SELECT watch_course_videos.course_video_id, SUM(watch_course_videos.total_duration) AS time, COUNT(watch_course_videos.course_video_id) AS num
FROM watch_course_videos FROM watch_course_videos
JOIN course_videos ON course_videos.id = watch_course_videos.course_video_id AND watch_course_videos.end_at IS NOT NULL JOIN course_videos ON course_videos.id = watch_course_videos.course_video_id AND watch_course_videos.end_at IS NOT NULL
JOIN course_members ON course_members.user_id = watch_course_videos.user_id AND course_members.course_id = #{@course.id} AND role = 4
WHERE course_videos.course_id = #{@course.id} WHERE course_videos.course_id = #{@course.id}
GROUP BY watch_course_videos.course_video_id GROUP BY watch_course_videos.course_video_id
) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id") ) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id")
@ -1523,6 +1524,7 @@ class CoursesController < ApplicationController
SELECT watch_course_videos.course_video_id, COUNT(watch_course_videos.course_video_id) AS num SELECT watch_course_videos.course_video_id, COUNT(watch_course_videos.course_video_id) AS num
FROM watch_course_videos FROM watch_course_videos
JOIN course_videos ON course_videos.id = watch_course_videos.course_video_id JOIN course_videos ON course_videos.id = watch_course_videos.course_video_id
JOIN course_members ON course_members.user_id = watch_course_videos.user_id AND course_members.course_id = #{@course.id} AND role = 4
WHERE course_videos.course_id = #{@course.id} AND watch_course_videos.user_id = #{current_user.id} AND watch_course_videos.end_at IS NOT NULL WHERE course_videos.course_id = #{@course.id} AND watch_course_videos.user_id = #{current_user.id} AND watch_course_videos.end_at IS NOT NULL
GROUP BY watch_course_videos.course_video_id GROUP BY watch_course_videos.course_video_id
) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id") ) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id")
@ -1543,9 +1545,12 @@ class CoursesController < ApplicationController
# 课堂视频的统计总览 # 课堂视频的统计总览
def watch_statics def watch_statics
@total_duration = @course.course_videos.joins(:watch_course_videos).sum(:total_duration).round(2) course_videos = @course.course_videos.joins(:watch_course_videos).joins("
@frequencies = @course.course_videos.joins([watch_course_videos: :watch_video_histories]).count(:id) JOIN course_members ON course_members.user_id = watch_course_videos.user_id AND course_members.course_id = #{@course.id} AND role = 4
@people_num = @course.course_videos.joins(:watch_course_videos).count(:id) ").where("watch_course_videos.end_at IS NOT NULL")
@total_duration = course_videos.sum(:total_duration).round(0)
@frequencies = course_videos.joins("JOIN watch_video_histories ON watch_course_videos.id = watch_video_histories.watch_course_video_id").count(:id)
@people_num = course_videos.count(:id)
render json: { render json: {
total_duration: @total_duration, total_duration: @total_duration,
freq: @frequencies, freq: @frequencies,

@ -244,7 +244,7 @@ class SubjectsController < ApplicationController
@subject.update_attributes(public: 1) @subject.update_attributes(public: 1)
ApplyAction.create(container_type: "ApplySubject", container_id: @subject.id, user_id: current_user.id, status: 0) ApplyAction.create(container_type: "ApplySubject", container_id: @subject.id, user_id: current_user.id, status: 0)
begin begin
Educoder::Sms.send(mobile: '18711011226', send_type:'publish_subject' , name: '管理员') Educoder::Sms.send(mobile: '17347001317', send_type:'publish_subject' , name: '管理员')
rescue => e rescue => e
uid_logger_error("发送验证码出错: #{e}") uid_logger_error("发送验证码出错: #{e}")
end end

@ -406,6 +406,15 @@ class Course < ApplicationRecord
homework_commons.select{|homework| homework.homework_type == type}.size homework_commons.select{|homework| homework.homework_type == type}.size
end 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
private private
#创建课程后,给该用户发送消息 #创建课程后,给该用户发送消息

@ -33,12 +33,10 @@ class CreateWatchVideoService < ApplicationService
if watch_course_video.present? if watch_course_video.present?
watch_course_video.total_duration = watch_course_video.watch_video_histories.sum(:total_duration) watch_course_video.total_duration = watch_course_video.watch_video_histories.sum(:total_duration)
watch_course_video.end_at = current_time 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] watch_course_video.watch_duration = params[:watch_duration] if 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 if params[:ed].present?
watch_course_video.is_finished = watch_course_video.total_duration >= watch_course_video.duration
end
end end
watch_course_video.save! watch_course_video.save!
end end

@ -3,22 +3,28 @@ wb = xlsx_package.workbook
wb.styles do |s| 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} 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| 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| @courses.each do |course|
data = [ data = [
course.id, course.id,
course.name, course.name,
course.course_members_count, course.teacher_course_members.size,
course.students.size,
get_attachment_count(course, 0), get_attachment_count(course, 0),
course.course_homework_count(1), course.informs.size,
course.course_homework_count(3), course.course_videos.size,
course.course_homework_count(4), 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.exercises_count,
course.evaluate_count, course.evaluate_count,
course.is_public == 1 ? "--" : "√", course.is_public == 1 ? "--" : "√",
course.is_end ? "已结束" : "正在进行", course.is_end ? "已结束" : "正在进行",
course.school&.name, course.school&.name,
course.teacher&.department_name,
course.teacher&.real_name, course.teacher&.real_name,
course.created_at&.strftime('%Y-%m-%d %H:%M'), course.created_at&.strftime('%Y-%m-%d %H:%M'),
course.max_activity_time ? course.max_activity_time&.strftime('%Y-%m-%d %H:%M') : "--" course.max_activity_time ? course.max_activity_time&.strftime('%Y-%m-%d %H:%M') : "--"

@ -3,18 +3,22 @@
<tr> <tr>
<th width="4%">序号</th> <th width="4%">序号</th>
<th width="4%">ID</th> <th width="4%">ID</th>
<th width="10%" class="text-left">课堂名称</th> <th width="8%" class="text-left">课堂名称</th>
<th width="5%">成员</th> <th width="4%">老师</th>
<th width="4%">学生</th>
<th width="4%">资源</th> <th width="4%">资源</th>
<th width="4%">公告</th>
<th width="4%">视频</th>
<th width="4%">普通作业</th> <th width="4%">普通作业</th>
<th width="4%">分组作业</th> <th width="4%">分组作业</th>
<th width="4%">实训作业</th> <th width="4%">实训作业</th>
<th width="4%">作品数</th>
<th width="4%">试卷</th> <th width="4%">试卷</th>
<th width="6%">评测次数</th> <th width="6%">评测次数</th>
<th width="4%">私有</th> <th width="4%">私有</th>
<th width="6%">状态</th> <th width="4%">状态</th>
<th width="10%">单位</th> <th width="8%">单位</th>
<th width="7%">创建者</th> <th width="6%">创建者</th>
<th width="10%"><%= sort_tag('创建时间', name: 'created_at', path: admins_courses_path) %></th> <th width="10%"><%= sort_tag('创建时间', name: 'created_at', path: admins_courses_path) %></th>
<th width="4%">首页</th> <th width="4%">首页</th>
<th width="5%">邮件通知</th> <th width="5%">邮件通知</th>

@ -3,11 +3,15 @@
<td class="text-left"> <td class="text-left">
<%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %> <%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %>
</td> </td>
<td><%= course.course_members_count %></td> <td><%= course.teacher_course_members.size %></td>
<td><%= course.students.size %></td>
<td><%= get_attachment_count(course, 0) %></td> <td><%= get_attachment_count(course, 0) %></td>
<td><%= course.informs.size %></td>
<td><%= course.course_videos.size %></td>
<td><%= course.course_homework_count("normal") %></td> <td><%= course.course_homework_count("normal") %></td>
<td><%= course.course_homework_count("group") %></td> <td><%= course.course_homework_count("group") %></td>
<td><%= course.course_homework_count("practice") %></td> <td><%= course.course_homework_count("practice") %></td>
<td><%= course.student_works_count %></td>
<td><%= course.exercises_count %></td> <td><%= course.exercises_count %></td>
<td><%= course.evaluate_count %></td> <td><%= course.evaluate_count %></td>
<td><%= course.is_public == 1 ? "--" : "√" %></td> <td><%= course.is_public == 1 ? "--" : "√" %></td>

@ -2,7 +2,7 @@ json.data do
json.array! @watch_course_videos do |d| json.array! @watch_course_videos do |d|
json.user_name d.user&.real_name json.user_name d.user&.real_name
json.is_finished d.is_finished ? true : false json.is_finished d.is_finished ? true : false
json.total_duration d.total_duration.round(2) json.total_duration d.total_duration.round(0)
json.feq d['freq'] json.feq d['freq']
json.start_at d.start_at.to_s json.start_at d.start_at.to_s
json.end_at d.end_at.to_s json.end_at d.end_at.to_s

@ -30,6 +30,7 @@ json.course_modules @course_modules.each do |mod|
json.third_category category.children do |child| json.third_category category.children do |child|
json.partial! "category_info", category: child json.partial! "category_info", category: child
json.parent_id child.parent_id
end end
end end
end end

@ -3,7 +3,7 @@ json.data do
json.title d.title json.title d.title
json.user_name @current_user&.real_name json.user_name @current_user&.real_name
json.is_finished d.is_finished ? true : false json.is_finished d.is_finished ? true : false
json.total_duration d.total_duration.round(2) json.total_duration d.total_duration.round(0)
json.freq d['freq'] json.freq d['freq']
json.start_at d.start_at.to_s json.start_at d.start_at.to_s
json.end_at d.end_at.to_s json.end_at d.end_at.to_s

@ -4,7 +4,7 @@ json.videos do
json.title v.title json.title v.title
json.user_name v.user&.real_name json.user_name v.user&.real_name
json.people_num v['people_num'] json.people_num v['people_num']
json.total_time v['total_time'] json.total_time v['total_time'].round(0)
end end
end end
json.count @count json.count @count

@ -21,7 +21,7 @@ module Educoder
def self.notify_admin(opt) def self.notify_admin(opt)
opt[:name] = '管理员' opt[:name] = '管理员'
opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18711085785' opt[:mobile] = ENV['NOTIFY_ADMIN_PHONE'] || EduSetting.get('notify_admin_phone') || '18670760309'
send(opt) send(opt)
end end
@ -49,7 +49,7 @@ module Educoder
elsif send_type == "apply_pro_certification" || send_type == "apply_auth" elsif send_type == "apply_pro_certification" || send_type == "apply_auth"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'apply_pro_certification'?'':''}认证申请,请尽快处理" params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'apply_pro_certification'?'':''}认证申请,请尽快处理"
elsif send_type == "publish_subject" ||send_type == "publish_shixun"|| send_type == "user_apply_auth" || send_type == "discuss" elsif send_type == "publish_subject" ||send_type == "publish_shixun"|| send_type == "user_apply_auth" || send_type == "discuss"
params['mobile'] = EduSetting.get('subject_shixun_notify_phone') || '18711011226' if send_type == "publish_subject" || send_type == "publish_shixun" params['mobile'] = EduSetting.get('subject_shixun_notify_phone') || '17347001317' if send_type == "publish_subject" || send_type == "publish_shixun"
params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'publish_subject'?'':(send_type == 'publish_shixun' ? '' : (send_type == 'discuss' ? '':''))}申请发布,请尽快处理" params['text'] = "【Edu实训】亲爱的#{name},有新的#{send_type == 'publish_subject'?'':(send_type == 'publish_shixun' ? '' : (send_type == 'discuss' ? '':''))}申请发布,请尽快处理"
elsif send_type == 'join_course_multi_role' elsif send_type == 'join_course_multi_role'
params['text'] = "【Edu实训】亲爱的#{user_name},您的课堂#{name}有助教或者教师申请加入,请尽快审核" params['text'] = "【Edu实训】亲爱的#{user_name},您的课堂#{name}有助教或者教师申请加入,请尽快审核"

@ -12,7 +12,7 @@ import Videostatistics from '../videostatistics/Videostatistics';
import './video.css'; import './video.css';
import '../css/Courses.css'; import '../css/Courses.css';
import '../publicNav/nav.css'; import '../publicNav/nav.css';
import Videostatisticscomtwo from '../videostatistics/component/Videostatisticscomtwo';
const PAGE_SIZE = 15; const PAGE_SIZE = 15;
const LIVE_PAGE_SIZE = 10; const LIVE_PAGE_SIZE = 10;
const $ = window.$; const $ = window.$;
@ -378,7 +378,12 @@ class VideoIndex extends Component {
</div> </div>
</div> </div>
: :
(
isAdmin?
<Videostatistics {...this.props} {...this.state} statisticsy={(b) => this.statisticsy(b)}></Videostatistics> <Videostatistics {...this.props} {...this.state} statisticsy={(b) => this.statisticsy(b)}></Videostatistics>
:
<Videostatisticscomtwo {...this.props} {...this.state} mytitle={""} ></Videostatisticscomtwo>
)
} }
{ {
statistics === false ? statistics === false ?

@ -2519,7 +2519,6 @@ class Listofworksstudentone extends Component {
axios.get(url).then((response) => { axios.get(url).then((response) => {
if (response) { if (response) {
if (response.data.status === 0) { if (response.data.status === 0) {
setTimeout(() => {
this.props.showNotification(`${response.data.message}`); this.props.showNotification(`${response.data.message}`);
// var homeworkid = this.props.match.params.homeworkid; // var homeworkid = this.props.match.params.homeworkid;
this.Getalistofworks(homeworkid, false); this.Getalistofworks(homeworkid, false);
@ -2529,12 +2528,14 @@ class Listofworksstudentone extends Component {
} catch (e) { } catch (e) {
} }
}, 2500);
} }
} }
// this.Getalistofworkstwo("", "", "", "", 1, 20); // this.Getalistofworkstwo("", "", "", "", 1, 20);
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
this.setState({
computeTimetype:true
})
}); });
} }
@ -3364,10 +3365,6 @@ class Listofworksstudentone extends Component {
axios.get(url).then((response) => { axios.get(url).then((response) => {
if (response) { if (response) {
if (response.data.status === 0) { if (response.data.status === 0) {
// if(response.data.message!==undefined){
// return;
// }
setTimeout(() => {
this.setState({ this.setState({
loadingstate: true loadingstate: true
}) })
@ -3382,13 +3379,13 @@ class Listofworksstudentone extends Component {
} catch (e) { } catch (e) {
} }
}, 2500);
} }
// this.props.history.replace( matchurl );
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
this.setState({
computeTimetype:true
})
}); });
}; };
@ -3672,27 +3669,9 @@ class Listofworksstudentone extends Component {
<li className="clearfix mt10"> <li className="clearfix mt10">
<div className="fr search-newysl" style={{marginBottom: '1px'}}> <div className="fr search-newysl" style={{marginBottom: '1px'}}>
{/*{course_is_end===true?"":<span>*/}
{/*{teacherdata&&teacherdata.update_score===true&&computeTimetype===true?*/}
{/* (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>*/}
{/* 查看最新成绩*/}
{/* </div>:""):*/}
{/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/}
{/* (this.props.isNotMember()===false?<div className={"computeTimes font-16"}>*/}
{/* 查看最新成绩*/}
{/* </div>:"")*/}
{/*}*/}
{/*</span>}*/}
<span className="search-newyslw fr ml20"> <span className="search-newyslw fr ml20">
{/*<Search*/}
{/* placeholder="请输入姓名或学号搜索"*/}
{/* id="subject_search_input"*/}
{/* autoComplete="off"*/}
{/* value={searchtext}*/}
{/* // onKeyUp={(e) => this.onSearchKeywordKeyUpt(e)}*/}
{/* onInput={this.inputSearchValuest}*/}
{/* onSearch={this.searchValuest}*/}
{/*></Search>*/}
{publicSearchs("请输入姓名或学号搜索",this.searchValuest,this.inputSearchValuest,this.inputSearchValuest)} {publicSearchs("请输入姓名或学号搜索",this.searchValuest,this.inputSearchValuest,this.inputSearchValuest)}
</span> </span>
</div> </div>
@ -3993,27 +3972,7 @@ class Listofworksstudentone extends Component {
<div className="fr"> <div className="fr">
{/*<span className="fl mr10 color-grey-6 ">计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>*/}
{/* { course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>*/}
{/* {computeTimetype===true?*/}
{/* (this.props.isNotMember()===false?*/}
{/* (*/}
{/* teacherdata&&teacherdata.update_score===true?*/}
{/* <div className={"computeTime font-16"} onClick={this.setComputeTime}>*/}
{/* 查看最新成绩*/}
{/* </div>*/}
{/* :""*/}
{/* )*/}
{/* :"")*/}
{/* :*/}
{/* (teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/}
{/* this.props.isNotMember()===false?*/}
{/* <div className={"computeTimes font-16"}>*/}
{/* 查看最新成绩*/}
{/* </div>*/}
{/* :"")*/}
{/* }*/}
{/*</span>}*/}
</div> </div>
@ -4238,24 +4197,7 @@ class Listofworksstudentone extends Component {
</style> </style>
<div className="fr"> <div className="fr">
{/*<span className="fl mr10 color-grey-6 ">计算成绩时间:{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>*/}
{/* { course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>*/}
{/* {computeTimetype===true?*/}
{/* (this.props.isNotMember()===false?*/}
{/* (*/}
{/* teacherdata&&teacherdata.update_score===true?*/}
{/* <div className={"computeTime font-16"} onClick={this.setComputeTime}>*/}
{/* 查看最新成绩*/}
{/* </div>:""*/}
{/* )*/}
{/* :""):*/}
{/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/}
{/* (this.props.isNotMember()===false?<div className={"computeTimes font-16"}>*/}
{/* 查看最新成绩*/}
{/* </div>:"")*/}
{/* }*/}
{/*</span>}*/}
</div> </div>
</div> </div>
</div> </div>

@ -65,9 +65,16 @@ class Detailss extends Component {
position: "relative" position: "relative"
}}> }}>
<div className="ws100s teacherentrydiv "> <div className="ws100s teacherentrydiv ">
<p className="ws100s teachedivp ymaxnamewidthdivp"> <div className="ws100s sortinxdirection">
<p className="sortinxdirection" style={{color:'#5091FF'}} onClick={()=>this.props.qiandaoxiangq(false)}>
<i style={{color:'#5091FF'}} className="iconfont icon-zuojiantou posiivsiconmyss mr5 colorbluesigin xiaoshou" onClick={()=>this.props.qiandaoxiangq(false)}></i>
<p style={{color:'#5091FF'}} className="fh mr27 colorbluesigin xiaoshou" onClick={()=>this.props.qiandaoxiangq(false)}>返回</p>
</p>
<p className="ws100s teachedivp ymaxnamewidthdivp86">
{item && item.name} {item && item.name}
</p> </p>
</div>
<div className="ws100s sortinxdirection mt17"> <div className="ws100s sortinxdirection mt17">
<div className="teachedivps"> <div className="teachedivps">

@ -102,6 +102,9 @@
.ws50s{ .ws50s{
width: 50%; width: 50%;
} }
.ws40s{
width: 40%;
}
.hs30s{ .hs30s{
height: 30%; height: 30%;
} }
@ -211,6 +214,14 @@
white-space:nowrap; white-space:nowrap;
cursor: default; cursor: default;
} }
.ymaxnamewidthdivp86{
max-width:86%;
width: 86%;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.teachedivps{ .teachedivps{
font-size:14px; font-size:14px;
font-family:Microsoft YaHei; font-family:Microsoft YaHei;
@ -408,6 +419,14 @@
white-space:nowrap; white-space:nowrap;
cursor: default; cursor: default;
} }
.maxnamewidth140s{
width: 140px;
max-width: 140px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth200s{ .maxnamewidth200s{
text-align: center; text-align: center;
width: 200px; width: 200px;
@ -425,6 +444,14 @@
white-space:nowrap; white-space:nowrap;
cursor: default; cursor: default;
} }
.maxnamewidth90s{
width: 90px;
max-width: 90px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth100s{ .maxnamewidth100s{
width: 100px; width: 100px;
max-width: 100px; max-width: 100px;
@ -440,3 +467,6 @@
.mr32{ .mr32{
margin-right: 32px; margin-right: 32px;
} }
.mr27{
margin-right: 27px;
}

@ -43,14 +43,8 @@ class Signindetails extends Component{
<div className="ws100s" style={{ <div className="ws100s" style={{
position: "relative", position: "relative",
}}> }}>
<div className="ws100s mb20">
<p className="sortinxdirection" >
<i className="iconfont icon-zuojiantou posiivsiconmyss mr5 colorbluesigin xiaoshou" onClick={()=>this.props.qiandaoxiangq(false)}></i>
<p className="fh mr20 colorbluesigin xiaoshou" onClick={()=>this.props.qiandaoxiangq(false)}>正在签到</p>
</p>
</div>
<Detailss <Detailss
qiandaoxiangq={(b)=>this.props.qiandaoxiangq(b)}
defaultActiveKey={this.props.defaultActiveKey} defaultActiveKey={this.props.defaultActiveKey}
headdata={headdata} headdata={headdata}
switattendance_id={this.props.switattendance_id} switattendance_id={this.props.switattendance_id}

@ -14,6 +14,7 @@ class Videostatistics extends Component{
watch_staticsdata:[], watch_staticsdata:[],
tisticsbool:false, tisticsbool:false,
tisid:null, tisid:null,
mytitle:""
} }
@ -43,16 +44,17 @@ class Videostatistics extends Component{
}); });
} }
tisticsbools=(bool,id)=>{ tisticsbools=(bool,id,mytitle)=>{
this.setState({ this.setState({
tisticsbool:bool, tisticsbool:bool,
tisid:id, tisid:id,
mytitle:mytitle
}) })
} }
render(){ render(){
let {watch_staticsdata,tisticsbool,tisid}= this.state; let {watch_staticsdata,tisticsbool,tisid,mytitle}= this.state;
return( return(
<React.Fragment> <React.Fragment>
@ -62,28 +64,19 @@ class Videostatistics extends Component{
<div className="ws100s" style={{ <div className="ws100s" style={{
position: "relative", position: "relative",
}}> }}>
<div className="ws100s xaxisreverseorder" style={{
position: "absolute",
top: "-29px",
}}>
<p className="sortinxdirection xiaoshou" onClick={()=>this.props.statisticsy(false)}>
<i className="iconfont icon-zuojiantou posiivsiconmyss mr5"></i>
<p className="fh mr20"> 返回</p>
</p>
</div> <Videostatisticscom {...this.state} {...this.props} watch_staticsdata={watch_staticsdata} statisticsy={(b)=>this.props.statisticsy(b)}></Videostatisticscom>
<Videostatisticscom {...this.state} {...this.props} watch_staticsdata={watch_staticsdata} ></Videostatisticscom>
<div> <div>
<Videostatisticslist {...this.state} {...this.props} tisticsbools={(b,id)=>this.tisticsbools(b,id)}></Videostatisticslist> <Videostatisticslist {...this.state} {...this.props} tisticsbools={(b,id,t)=>this.tisticsbools(b,id,t)}></Videostatisticslist>
</div> </div>
</div> </div>
: :
<Videostatisticscomtwo {...this.state} {...this.props} tisid={tisid} tisticsbools={(b,id)=>this.tisticsbools(b,id)}></Videostatisticscomtwo> <Videostatisticscomtwo {...this.state} {...this.props} tisid={tisid} mytitle={mytitle} tisticsbools={(b,id,t)=>this.tisticsbools(b,id,t)}></Videostatisticscomtwo>
} }
</div> </div>

@ -35,7 +35,11 @@ class Videostatisticscom extends Component {
}}> }}>
<div className="ws100s teacherentrydivss "> <div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws50s sptits">视频统计总览</div> <p className="sortinxdirection h40s" onClick={()=>this.props.statisticsy(false)} style={{color:'#5091FF'}}>
<i className="iconfont icon-zuojiantou posiivsiconmyss mr5 colorbluesigin xiaoshou h40s" onClick={()=>this.props.statisticsy(false)} style={{color:'#5091FF'}}></i>
<p style={{color:'#5091FF'}} className="fh mr20 colorbluesigin xiaoshou h40s" onClick={()=>this.props.statisticsy(false)}>返回</p>
</p>
<div className="ws40s sptits font-18">视频统计总览</div>
<div className="ws50s sptitss xaxisreverseorder">播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计</div> <div className="ws50s sptitss xaxisreverseorder">播放数据从{this.props.watch_staticsdata&&this.props.watch_staticsdata.begin_at?this.props.watch_staticsdata.begin_at:0}开始统计</div>
</div> </div>
<style> <style>

@ -5,6 +5,7 @@ import {getImageUrl, sortDirections,formatSeconds} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin"; import LoadingSpin from "../../../../common/LoadingSpin";
import NoneDatas from "../../signin/component/NoneDatas"; import NoneDatas from "../../signin/component/NoneDatas";
import moment from 'moment';
//条目 //条目
@ -52,9 +53,9 @@ class Videostatisticscomtwo extends Component {
key: 'is_finished', key: 'is_finished',
align: "center", align: "center",
className: 'font-14', className: 'font-14',
width: '98px', width: '90px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '98px'}}>{record.is_finished === true ? <span style={{width: '90px'}}>{record.is_finished === true ?
<span style={{color: "#5091FF"}}></span> : <span style={{color: "#E02020"}}></span>}</span> <span style={{color: "#5091FF"}}></span> : <span style={{color: "#E02020"}}></span>}</span>
), ),
}, },
@ -63,12 +64,12 @@ class Videostatisticscomtwo extends Component {
dataIndex: 'total_duration', dataIndex: 'total_duration',
key: 'total_duration', key: 'total_duration',
align: "center", align: "center",
className: 'font-14 maxnamewidth150s', className: 'font-14 maxnamewidth140s',
width: '150px', width: '140px',
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '150px'}} className="maxnamewidth150s"><a className="maxnamewidth150s" style={{ <span style={{width: '140px'}} className="maxnamewidth140s"><a className="maxnamewidth140s" style={{
color:"#333333" color:"#333333"
}} title={record.total_duration}>{record.total_duration}</a></span> }} title={record.total_duration}>{record.total_duration}</a></span>
), ),
@ -78,13 +79,13 @@ class Videostatisticscomtwo extends Component {
dataIndex: 'feq', dataIndex: 'feq',
key: 'feq', key: 'feq',
align: "center", align: "center",
className: 'font-14 maxnamewidth100s', className: 'font-14 maxnamewidth140s',
width: '100px', width: '140px',
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px'}} className="maxnamewidth100s"> <span style={{width: '140px'}} className="maxnamewidth140s">
<a className="maxnamewidth100s" style={{ <a className="maxnamewidth140s" style={{
color:"#333333" color:"#333333"
}} title={record.feq}>{record.feq}</a> }} title={record.feq}>{record.feq}</a>
</span> </span>
@ -95,13 +96,13 @@ class Videostatisticscomtwo extends Component {
dataIndex: 'start_at', dataIndex: 'start_at',
key: 'start_at', key: 'start_at',
align: "center", align: "center",
className: 'font-14 maxnamewidth100s', className: 'font-14 maxnamewidth90s',
width: '100px', width: '90px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px'}} > <span style={{width: '90px'}} >
<a className="maxnamewidth100s" style={{ <a className="maxnamewidth90s" style={{
color:"#333333" color:"#333333"
}} title= {record.start_at}> {record.start_at}</a> }} title= {moment(record.start_at).format('YYYY-MM-DD HH:mm:ss')}> {record.start_at}</a>
</span> </span>
), ),
}, },
@ -110,13 +111,13 @@ class Videostatisticscomtwo extends Component {
dataIndex: 'end_at', dataIndex: 'end_at',
key: 'end_at', key: 'end_at',
align: "center", align: "center",
className: 'font-14 maxnamewidth100s', className: 'font-14 maxnamewidth90s',
width: '100px', width: '90px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px'}} > <span style={{width: '90px'}} >
<a className="maxnamewidth100s" style={{ <a className="maxnamewidth90s" style={{
color:"#333333" color:"#333333"
}} title= {record.end_at}>{record.end_at}</a> }} title={moment(record.end_at).format('YYYY-MM-DD HH:mm:ss')}>{record.end_at}</a>
</span> </span>
), ),
} }
@ -126,6 +127,7 @@ class Videostatisticscomtwo extends Component {
course_groups: [], course_groups: [],
fbbool: false, fbbool: false,
groupsid: null, groupsid: null,
none_group_member_count:0,
} }
} }
@ -164,9 +166,9 @@ class Videostatisticscomtwo extends Component {
let url = `/courses/${CourseId}/course_groups.json`; let url = `/courses/${CourseId}/course_groups.json`;
axios.get(url).then((response) => { axios.get(url).then((response) => {
if (response) { if (response) {
console.log("分班"); // console.log("分班");
console.log("response"); // console.log("response");
console.log(response); // console.log(response);
this.setState({ this.setState({
course_groups: response.data.course_groups, course_groups: response.data.course_groups,
current_group_id: response.data.current_group_id, current_group_id: response.data.current_group_id,
@ -206,6 +208,7 @@ class Videostatisticscomtwo extends Component {
feq: response.data.data[i].feq, feq: response.data.data[i].feq,
start_at: response.data.data[i].start_at, start_at: response.data.data[i].start_at,
end_at: response.data.data[i].end_at, end_at: response.data.data[i].end_at,
title: response.data.data[i].title,
}) })
} }
@ -288,12 +291,26 @@ class Videostatisticscomtwo extends Component {
group_id: id group_id: id
} }
} else {
try {
if(id!==null&&id===0){
data = {
id: CourseId,
page: this.state.page,
group_id: id
}
}else{ }else{
data = { data = {
id: CourseId, id: CourseId,
page: this.state.page page: this.state.page
} }
} }
}catch (e) {
}
}
this.getdatas(data); this.getdatas(data);
} }
@ -398,7 +415,7 @@ class Videostatisticscomtwo extends Component {
render() { render() {
let {loading, data, page, limit, members_count, columnsstu, fbbool, course_groups} = this.state; let {loading, data, page, limit, members_count, columnsstu, fbbool, course_groups} = this.state;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props&& this.props.isAdmin();
const menu = ( const menu = (
<Menu> <Menu>
@ -423,21 +440,57 @@ class Videostatisticscomtwo extends Component {
: :
"" ""
} }
{
this.state.none_group_member_count&&this.state.none_group_member_count>0?
<Menu.Item>
<a onClick={() => this.setcourse_groups(0)}>
<p className="maxnamewidth200yss">未分班</p>
</a>
</Menu.Item>
:
""
}
</Menu> </Menu>
); );
let mytitle="";
if(isAdmin){
mytitle=this.props&&this.props.mytitle;
}else{
if(this.state.data){
if(this.state.data.length>0){
try {
if(this.state.data[0].title){
mytitle=this.state.data[0].title;
}
}catch (e) {
}
}
}
}
return ( return (
<React.Fragment> <React.Fragment>
<div className="ws100s"> <div className="ws100s">
<div className="ws100s teacherentrydivss edu-back-white "> <div className="ws100s teacherentrydivss edu-back-white ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws50s sptits">视频名称视频名称</div> <div className="ws50s sptits font-18">{mytitle}</div>
<div className="ws50s sptitss xaxisreverseorder font-14" style={{ <div className="ws50s sptitss xaxisreverseorder font-14" style={{
color: "#5091FF", color: "#5091FF",
lineHeight: "42px", lineHeight: "42px",
}}> }}>
{
isAdmin === true ?
<div className="xiaoshou" onClick={() => this.props.tisticsbools(false, null)}> <div className="xiaoshou" onClick={() => this.props.tisticsbools(false, null)}>
<span className="mr5 xiaoshou">视频统计总览</span><i className="iconfont icon-fanhui font-13 xiaoshou"></i> <span className="mr5 xiaoshou">视频统计总览</span><i className="iconfont icon-fanhui font-13 xiaoshou"></i>
</div> </div>
:""
}
{ {
isAdmin === true ? isAdmin === true ?
<div className="xiaoshou" onClick={() => this.fenbanone()}> <div className="xiaoshou" onClick={() => this.fenbanone()}>
@ -447,9 +500,9 @@ class Videostatisticscomtwo extends Component {
<span className="mr5 xiaoshou">分班</span> <span className="mr5 xiaoshou">分班</span>
{ {
fbbool === true ? fbbool === true ?
<i className="iconfont icon-sanjiaoxing-down font-13 mr32 xiaoshou"></i>
:
<i className="iconfont icon-sanjiaoxing-up font-13 mr32 xiaoshou"></i> <i className="iconfont icon-sanjiaoxing-up font-13 mr32 xiaoshou"></i>
:
<i className="iconfont icon-sanjiaoxing-down font-13 mr32 xiaoshou"></i>
} }
</span> </span>
</Dropdown> </Dropdown>
@ -466,13 +519,13 @@ class Videostatisticscomtwo extends Component {
{ {
` `
.ysltableo .ant-table-thead > tr > th, .ant-table-tbody > tr > td { .ysltableo .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 10px 10px; padding: 10px 5px;
} }
` `
} }
</style> </style>
<div className="ws100s ysltableo mt10"> <div className="ws100s ysltableo mt10" style={{ minHeight: "400px"}}>
{ {
data.length === 0 ? data.length === 0 ?
<div style={{ <div style={{

@ -97,7 +97,7 @@ class Videostatisticslist extends Component {
className: 'font-14', className: 'font-14',
width: '50px', width: '50px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '50px',color:'#5091FF'}} className="xiaoshou" onClick={()=>this.props.tisticsbools(true,record.id)}>详情</span> <span style={{width: '50px',color:'#5091FF'}} className="xiaoshou" onClick={()=>this.props.tisticsbools(true,record.id,record.title)}>详情</span>
), ),
} }
], ],
@ -252,7 +252,7 @@ class Videostatisticslist extends Component {
<div className="ws100s edu-back-white"> <div className="ws100s edu-back-white">
<div className="ws100s teacherentrydivss "> <div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws100s sptits">统计详情</div> <div className="ws100s sptits font-16">统计详情</div>
</div> </div>
</div> </div>
@ -266,7 +266,7 @@ class Videostatisticslist extends Component {
} }
</style> </style>
<div className="ws100s ysltableo teacherentrydivs pdinstop0"> <div className="ws100s ysltableo teacherentrydivs pdinstop0" style={{ minHeight: "400px"}}>
{ {
data.length===0? data.length===0?
<div style={{ <div style={{

Loading…
Cancel
Save