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

courseware
杨树林 5 years ago
commit 65cac18c5f

@ -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

@ -100,7 +100,10 @@
width: 80%; width: 80%;
} }
.ws50s{ .ws50s{
width: 50%; width: 50%;
}
.ws40s{
width: 40%;
} }
.hs30s{ .hs30s{
height: 30%; height: 30%;
@ -425,6 +428,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 +451,4 @@
.mr32{ .mr32{
margin-right: 32px; margin-right: 32px;
} }

@ -64,19 +64,8 @@ class Videostatistics extends Component{
<div className="ws100s" style={{ <div className="ws100s" style={{
position: "relative", position: "relative",
}}> }}>
<div className="ws100s " style={{
position: "absolute",
top: "-29px",
}}>
<p className="sortinxdirection" > <Videostatisticscom {...this.state} {...this.props} watch_staticsdata={watch_staticsdata} statisticsy={(b)=>this.props.statisticsy(b)}></Videostatisticscom>
<i className="iconfont icon-zuojiantou posiivsiconmyss mr5 colorbluesigin xiaoshou" onClick={()=>this.props.statisticsy(false)}></i>
<p className="fh mr20 colorbluesigin xiaoshou" onClick={()=>this.props.statisticsy(false)}>返回</p>
</p>
</div>
<Videostatisticscom {...this.state} {...this.props} watch_staticsdata={watch_staticsdata} ></Videostatisticscom>

@ -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)} >
<i className="iconfont icon-zuojiantou posiivsiconmyss mr5 colorbluesigin xiaoshou h40s" onClick={()=>this.props.statisticsy(false)}></i>
<p className="fh mr20 colorbluesigin xiaoshou h40s" onClick={()=>this.props.statisticsy(false)}>返回</p>
</p>
<div className="ws40s sptits">视频统计总览</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>

@ -95,11 +95,11 @@ 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= {record.start_at}> {record.start_at}</a>
</span> </span>
@ -110,11 +110,11 @@ 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= {record.end_at}>{record.end_at}</a>
</span> </span>
@ -203,7 +203,7 @@ class Videostatisticscomtwo extends Component {
number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1), number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1),
user_name: response.data.data[i].user_name, user_name: response.data.data[i].user_name,
is_finished: response.data.data[i].is_finished, 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, 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,
@ -291,10 +291,24 @@ class Videostatisticscomtwo extends Component {
} }
} else { } else {
data = { try {
id: CourseId, if(id!==null&&id===0){
page: this.state.page data = {
id: CourseId,
page: this.state.page,
group_id: id
}
}else{
data = {
id: CourseId,
page: this.state.page
}
}
}catch (e) {
} }
} }
this.getdatas(data); this.getdatas(data);
} }

@ -152,7 +152,7 @@ class Videostatisticslist extends Component {
number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1), number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1),
title: response.data.videos[i].title, title: response.data.videos[i].title,
people_num: response.data.videos[i].people_num, 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, user_name: response.data.videos[i].user_name,
id: response.data.videos[i].id, id: response.data.videos[i].id,
}) })

Loading…
Cancel
Save