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

courseware
dinglink 5 years ago
commit 2e35127ff3

@ -106,7 +106,7 @@ class AttendancesController < ApplicationController
attrs = %i[course_attendance_id user_id course_member_id course_id course_group_id created_at updated_at]
same_attrs = {course_attendance_id: attendance.id, course_id: course.id}
same_attrs = {course_attendance_id: @attendance.id, course_id: @course.id}
CourseMemberAttendance.bulk_insert(*attrs) do |worker|

@ -35,7 +35,7 @@ class CourseVideosController < ApplicationController
@watch_course_videos = @watch_course_videos.where("course_members.course_group_id = ?", params[:group_id])
end
@watch_course_videos = @watch_course_videos.select("count(watch_course_videos.course_video_id) AS freq, watch_course_videos.*")
@watch_course_videos = @watch_course_videos.select("count(watch_course_videos.course_video_id) AS freq, watch_course_videos.id, watch_course_videos.user_id, watch_course_videos.start_at, watch_course_videos.end_at, watch_course_videos.is_finished, watch_course_videos.total_duration")
if params[:order].present?
key = params[:order].split("-")

@ -103,25 +103,38 @@ class CoursesController < ApplicationController
end
def course_videos
videos = @course.course_videos
course_videos = @course.course_videos
course_videos = course_videos.joins("
LEFT JOIN videos ON course_videos.video_id = videos.id AND
((videos.transcoded = TRUE OR videos.user_id = #{current_user.id}) OR course_videos.is_link = TRUE)
LEFT JOIN (
SELECT watch_course_videos.course_video_id,
SUM(watch_course_videos.total_duration) AS total_duration,
count(watch_course_videos.course_video_id) AS count
FROM watch_course_videos
JOIN course_videos ON watch_course_videos.course_video_id = course_videos.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}
GROUP BY watch_course_videos.course_video_id
) AS watch_courses ON watch_courses.course_video_id = course_videos.id
")
@video_module = @course.course_modules.find_by(module_type: "video")
if params[:category_id].present? && params[:category_id].to_i != 0
@category = @video_module&.course_second_categories.find_by(id: params[:category_id])
tip_exception("子目录id有误") if !@category.present?
videos = videos.where(course_second_category_id: params[:category_id].to_i)
course_videos = course_videos.where(course_second_category_id: params[:category_id].to_i)
end
videos = custom_sort(videos, params[:sort_by], params[:sort_direction])
course_videos = custom_sort(course_videos, params[:sort_by], params[:sort_direction])
course_videos = course_videos.includes(video: [user: :user_extension], user: :user_extension)
#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(video: [user: :user_extension],user: :user_extension).select("course_videos.id, course_videos.title, course_videos.link, course_videos.user_id")
videos = videos.where(videos: {transcoded: true})
.or(videos.where(videos: {user_id: current_user.id}))
.or(videos.where(course_videos: {is_link: true}))
@count = videos.count("course_videos.id")
@count = course_videos.count("course_videos.id")
logger.info("#######count:#{@count}")
@videos = paginate videos
course_videos = course_videos.select("course_videos.id, IFNULL(watch_courses.total_duration, 0) AS total_duration, IFNULL(watch_courses.count,0) AS count, course_videos.video_id, course_videos.title, course_videos.link, course_videos.is_link, course_videos.user_id")
@videos = paginate course_videos
end
def delete_course_video
@ -1491,11 +1504,10 @@ class CoursesController < ApplicationController
@videos = CourseVideo.joins("
JOIN videos ON course_videos.course_id = #{@course.id} AND videos.id = course_videos.video_id
LEFT JOIN (
SELECT watch_course_videos.course_video_id, SUM(watch_course_videos.total_duration) AS time, COUNT(watch_video_histories.watch_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
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
JOIN watch_video_histories ON watch_course_videos.id = watch_video_histories.watch_course_video_id AND watch_video_histories.end_at IS NOT NULL
WHERE course_videos.course_id = #{@course.id}
GROUP BY watch_course_videos.course_video_id
) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id")
@ -1509,7 +1521,7 @@ class CoursesController < ApplicationController
end
end
@videos = @videos.select("course_videos.id, videos.user_id, videos.title, IFNULL(hisotries.time,0) AS total_time, IFNULL(hisotries.num,0) AS people_num")
@videos = @videos.select("course_videos.id, videos.user_id, videos.title AS video_title, IFNULL(hisotries.time,0) AS total_time, IFNULL(hisotries.num,0) AS people_num")
@videos = paginate @videos
end
@ -1522,14 +1534,14 @@ class CoursesController < ApplicationController
JOIN videos ON course_videos.course_id = #{@course.id} AND videos.id = course_videos.video_id
JOIN watch_course_videos ON course_videos.id = watch_course_videos.course_video_id AND watch_course_videos.user_id = #{current_user.id}
JOIN (
SELECT watch_course_videos.course_video_id, COUNT(watch_video_histories.watch_course_video_id) AS num
SELECT watch_course_videos.id, COUNT(watch_video_histories.watch_course_video_id) AS num
FROM watch_course_videos
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
JOIN watch_video_histories ON watch_course_videos.id = watch_video_histories.watch_course_video_id AND watch_video_histories.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
) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id")
GROUP BY watch_course_videos.id
) AS hisotries ON hisotries.id = watch_course_videos.id ").select("course_videos.id")
@count = @videos.count
@ -1542,7 +1554,7 @@ class CoursesController < ApplicationController
end
end
@videos = @videos.select("course_videos.id, course_videos.video_id, watch_course_videos.start_at, watch_course_videos.total_duration, watch_course_videos.end_at, watch_course_videos.is_finished, videos.title, IFNULL(hisotries.num,0) AS freq")
@videos = @videos.select("course_videos.id, watch_course_videos.id AS watch_course_video_id, course_videos.video_id, watch_course_videos.start_at, watch_course_videos.total_duration, watch_course_videos.end_at, watch_course_videos.is_finished, videos.title, IFNULL(hisotries.num,0) AS freq")
@videos = paginate @videos
end

@ -115,7 +115,7 @@ class Attachment < ApplicationRecord
def become_history
history = self.attachment_histories.first
new_attachment_history = AttachmentHistory.new(self.attributes.except("id", "resource_bank_id", "unified_setting", "course_second_category_id", "delay_publish").merge(
new_attachment_history = AttachmentHistory.new(self.attributes.except("id", "resource_bank_id", "unified_setting", "course_second_category_id", "delay_publish", "link").merge(
attachment_id: self.id,
version: history.nil? ? 1 : history.version + 1,
))
@ -123,7 +123,7 @@ class Attachment < ApplicationRecord
end
def copy_attributes_from_new_attachment(new_attachment)
self.attributes = new_attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes",'is_publish','publish_time', "delay_publish")
self.attributes = new_attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads", "quotes",'is_publish','publish_time', "delay_publish", "link")
end
def set_public(is_public)

@ -161,7 +161,7 @@ class Course < ApplicationRecord
end
def videos_count
course_videos.where(video_id: videos.where("transcoded = 1 or videos.user_id = #{User.current.id}").pluck(:id))
course_videos.where(video_id: videos.where("transcoded = 1"))
.or(course_videos.where(course_videos: {is_link: true})).size
end

@ -1,5 +1,6 @@
json.data do
json.array! @watch_course_videos do |d|
json.id d.id
json.user_name d.user&.real_name
json.is_finished d.is_finished ? true : false
json.total_duration d.total_duration.round(0)

@ -9,9 +9,10 @@ json.videos @videos do |video|
json.user_img url_to_avatar(user)
json.user_login user&.login
else
json.course_video_id video.id
json.partial! 'users/videos/video', locals: { video: video.video }
json.total_time video.watch_course_videos.sum(:total_duration).round(0)
json.people_num video.watch_course_videos.count(:user_id)
json.total_time video['total_duration'].round(0)
json.people_num video['count']
end
end

@ -1,8 +1,9 @@
json.data do
json.array! @videos.each do |d|
json.watch_course_video_id d['watch_course_video_id']
json.title d.title
json.user_name d.video.user&.real_name
json.is_finished d.is_finished ? true : false
json.is_finished d.is_finished == 1 ? true : false
json.total_duration d.total_duration.round(0)
json.freq d['freq']
json.start_at d.start_at.to_s

@ -1,7 +1,7 @@
json.videos do
json.array! @videos do |v|
json.id v.id
json.title v.title
json.title v['video_title']
json.user_name v.user&.real_name
json.people_num v['people_num']
json.total_time v['total_time'].round(0)

@ -17,8 +17,9 @@ json.data do
end
# json.partial! "files/course_groups", attachment_group_settings: attachment.attachment_group_settings
json.category_id attachment.course_second_category_id
if (@parent_category_id.blank? || @parent_category_id != 0) && attachment.course_second_category&.parent_id.to_i != 0
if (@course_second_category_id.to_i == 0 && attachment.course_second_category.present?) || (@parent_category_id == 0 && attachment.course_second_category&.parent_id.to_i != 0)
json.category_name attachment.course_second_category&.name
json.parent_category_name attachment.course_second_category&.parent&.name
end
end
end

@ -255,11 +255,13 @@ class Video extends Component {
<div className="videoContent">
{
videos.map((item, key) => {
console.log(course_identity > 2 && item.user_id === user_id)
//console.log(course_identity > 2 && item.user_id === user_id)
return (
<VideoInReviewItem
Setmyktid={(id,title)=>this.props.Setmyktid(id,title)}
mykt={this.props.mykt}
{...this.props}
{...this.state}
{...item}
key={item.id}
onEditVideo={this.onEditVideo}
@ -268,6 +270,8 @@ class Video extends Component {
operation={operation || item.user_id === user_id}
deleteVideo={(admin || item.user_id === user_id) ? this.deleteVideo : undefined}
moveVideo={videoData && videoData.has_category && flagMove ? () => this.moveVideo(item.id, (course_identity > 2 && item.user_id !== user_id)) : undefined}
newtitle={item.title}
newcourse_video_id={item.course_video_id}
>
</VideoInReviewItem>
)
@ -294,4 +298,4 @@ class Video extends Component {
)
}
}
export default Video;
export default Video;

@ -41,6 +41,8 @@ class VideoIndex extends Component {
liveVisible: false,
statistics: false,
myktid:null,
mytitle:''
}
}
@ -55,7 +57,24 @@ class VideoIndex extends Component {
this.getLiveList(page);
}
}
Setmyktid=(id,title)=>{
const isAdmin = this.props&& this.props.isAdmin();
if(isAdmin===true){
this.setState({
myktid:id,
statistics:true,
mytitle:title,
})
}else{
this.setState({
statistics:true,
myktid:null,
mytitle:"",
})
}
}
componentDidMount = () => {
const {search} = this.props.location;
const {page} = this.state;
@ -79,6 +98,8 @@ class VideoIndex extends Component {
if(this.props.homedirectory ===true){
this.setState({
statistics:false,
myktid:null,
mytitle:"",
})
}
}
@ -255,12 +276,23 @@ class VideoIndex extends Component {
this.setState({
statistics: bool,
myktid:null,
mytitle:"",
})
}
mystatisticsys = (bool,n) => {
this.setState({
statistics: bool,
myktid:null,
mytitle:"",
})
}
render() {
const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = this.state;
const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics,myktid,mytitle} = this.state;
const {coursesId, videoId} = this.props.match.params;
let {course_identity} = this.props && this.props.coursedata;
let is_teacher = this.props && this.props.user && this.props.user.is_teacher;
@ -377,7 +409,14 @@ class VideoIndex extends Component {
</div>
</div>
:
<Videostatistics {...this.props} {...this.state} statisticsy={(b) => this.statisticsy(b)}></Videostatistics>
(
myktid===null||myktid===undefined?
<Videostatistics {...this.props} {...this.state} statisticsy={(b) => this.statisticsy(b)}></Videostatistics>
:
<Videostatisticscomtwo {...this.state} {...this.props} tisid={myktid} mytitle={mytitle} tisticsbools={(b,id)=>this.mystatisticsys(b,id)}></Videostatisticscomtwo>
)
}
@ -387,6 +426,8 @@ class VideoIndex extends Component {
{
type === "video" ?
<Videos
mykt={"mykt"}
Setmyktid={(id,title)=>this.Setmyktid(id,title)}
upload={upload}
videos={videos}
page={page}

@ -38,7 +38,8 @@ class ShixunWorkReport extends Component {
work_comment_hidden:undefined,
work_comment:undefined,
has_commit: false,
shixun_detail:[]
shixun_detail:[],
view_tpi:false
}
}
@ -115,7 +116,8 @@ class ShixunWorkReport extends Component {
work_comment:result.data.work_comment,
spinning: false,
has_commit: result.data.has_commit,
shixun_detail:result.data.shixun_detail
shixun_detail:result.data.shixun_detail,
view_tpi:result.data.view_tpi
})
}
@ -307,7 +309,7 @@ class ShixunWorkReport extends Component {
}
render() {
let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail} = this.state;
let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit,shixun_detail,view_tpi} = this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
let homework_common_id=data===undefined?"":data.homework_common_id;
@ -461,7 +463,7 @@ class ShixunWorkReport extends Component {
<div className={"fl"}>总体评价</div>
<div className={"fr"}>
{
this.props&&this.props.isAdmin()===true?shixun_detail&&shixun_detail.map((item,key)=>{
view_tpi&&view_tpi===true?shixun_detail&&shixun_detail.map((item,key)=>{
if(key===0){
return(
<a className={"color-blue font-16"} href={/tasks/+item.game_identifier} target="_blank" >查看学员实训</a>

@ -2,14 +2,17 @@ import React, {Component} from "react";
import '../css/signincdi.css';
import {Progress} from 'antd';
import axios from 'axios';
import Createsignmodel from '../model/Createsignmodel';
//条目
class Teacherentry extends Component {
//条目组件
constructor(props) {
super(props);
this.state = {}
this.state = {
editvisible:false,
attendancesid:null
}
}
componentDidMount() {
@ -21,7 +24,30 @@ class Teacherentry extends Component {
}
getdatalist=(id)=>{
let urls = `/attendances/${id}/edit.json`;
axios.get(urls).then((response) => {
//console.log(response);
if(response){
if(response.data){
this.setState({
editvisible:true,
attendancesdata:response.data,
attendancesid:id
})
}
}
}).catch((error) => {
console.log(error);
})
}
hideCreatesign=()=>{
this.setState({
editvisible:false
})
}
render() {
let isAdmin = this.props.isAdmin();
let item = this.props.item;
@ -32,9 +58,18 @@ class Teacherentry extends Component {
} catch (e) {
jdt = 100;
}
return (
<React.Fragment>
<div className={index===0?"ws100s edu-back-white xiaoshou": "ws100s edu-back-white mt20 xiaoshou"}>
{/*修改实训*/}
{this.state.editvisible===true?<Createsignmodel
{...this.state}
{...this.props}
hideCreatesign={()=>this.hideCreatesign()}
settabsdata={()=>this.props.getsetdatas()}
type={"edit"}
/>:""}
<div className="ws100s teacherentrydiv" onClick={isAdmin?(e)=>{e.stopPropagation();this.props.qiandaoxiangq(true,item.id)}:""}>
<p className={isAdmin?"ws100s teachedivp ymaxnamewidthdivp xiaoshou color-blue":"ws100s teachedivp ymaxnamewidthdivp"} >
{
@ -97,17 +132,21 @@ class Teacherentry extends Component {
<div className="ws100s xaxisreverseorder">
<div className="jiezhis h40s xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisEnd(item.id)}}>截止</div>
<div className="shanchu h40s xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisdelete(item.id)}}>删除</div>
<div className="shanchu h40s color-blue" onClick={(e)=>{e.stopPropagation();this.getdatalist(item.id)}}>编辑</div>
</div>
:
item.edit_auth === true ?
<div className="ws100s xaxisreverseorder">
<div className="jiezhis h40s xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.Signinnamestypes(item.id,true,item.name)}}>编辑</div>
<div className="shanchu h40s xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisdelete(item.id)}}>删除</div>
</div>
:
<div className="ws100s xaxisreverseorder">
<div className="jiezhis h40s color-reds xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisdelete(item.id)}}>删除</div>
</div>
(
//是否有编辑权限
item.edit_auth === true ?
<div className="ws100s xaxisreverseorder">
<div className="shanchu h40s xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisdelete(item.id)}}>删除</div>
<div className="shanchu h40s color-blue" onClick={(e)=>{e.stopPropagation();this.getdatalist(item.id,true,item.name)}}>编辑</div>
</div>
:
<div className="ws100s xaxisreverseorder">
<div className="jiezhis h40s color-reds xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisdelete(item.id)}}>删除</div>
</div>
)
:
(
this.props.defaultActiveKey === "1" ?

@ -472,7 +472,14 @@
white-space:nowrap;
cursor: default;
}
.maxnamewidth90s{
width: 90px;
max-width: 90px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.font-14{
font-size: 14px !important;
}

@ -33,8 +33,10 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
course_groups:[],
type:false,
dateString:null,
start_time: "",
end_time:""
start_time:"",
end_time:"",
attendance_date:"",
newmode:null
}
}
@ -53,6 +55,43 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
});
}
componentDidMount() {
if(this.props.type==="edit"){
let newlist=[]
if(this.props.attendancesdata.groups.length>0){
this.props.attendancesdata.groups.map((item,key)=>{
newlist.push(item.id)
})
}
console.log(this.props.attendancesdata.start_time)
// console.log()
this.setState({
attendance_date: this.props.attendancesdata.attendance_date,
start_time:new Date(this.props.attendancesdata.start_time),
end_time:new Date(this.props.attendancesdata.end_time),
newmode:this.props.attendancesdata.mode,
})
this.props.form.setFieldsValue({
name: this.props.attendancesdata.name,
group_ids:newlist,
mode:this.props.attendancesdata.mode,
start_time:new Date(this.props.attendancesdata.start_time),
end_time:new Date(this.props.attendancesdata.end_time),
});
}else{
this.setState({
start_time: new Date("2000-01-01T09:00:00.000+08:00"),
})
this.props.form.setFieldsValue({
start_time:new Date("2000-01-01T09:00:00.000+08:00"),
});
}
const coursesId=this.props.match.params.coursesId;
let newurl=`/courses/${coursesId}/all_course_groups.json`;
axios.get(newurl).then((response) => {
@ -73,6 +112,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
type:true
})
this.props.form.validateFields((err, values) => {
if (!err) {
if(moment(values.end_time).format('HH:mm')<moment(values.start_time).format('HH:mm')){
this.props.showNotification(`结束时间不能小于起始时间`);
@ -88,17 +128,21 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
})
return
}
let url=`/weapps/courses/${coursesId}/attendances.json`;
axios.post(url, {
attendance_date:moment(values.attendance_date).format('YYYY-MM-DD'),
end_time: moment(values.end_time).format('HH:mm'),
group_ids:values.group_ids,
mode: values.mode,
name: values.name,
start_time:moment(values.start_time).format('HH:mm'),
})
.then((response) => {
if(this.props.type==="edit"){
const attendancesid=this.props.attendancesid;
let url=`/attendances/${attendancesid}.json`
axios.put(url,{
attendance_date:moment(values.attendance_date).format('YYYY-MM-DD'),
end_time: moment(values.end_time).format('HH:mm'),
group_ids:values.group_ids,
mode: values.mode,
name: values.name,
start_time:moment(values.start_time).format('HH:mm'),
}
).then((response) => {
if (response.data.status == 0) {
this.props.showNotification(`创建签到成功`);
this.setState({
@ -107,10 +151,38 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
hideCreatesign()
settabsdata()
}
}).catch((error) => {
console.log(error)
})
}else{
let url=`/weapps/courses/${coursesId}/attendances.json`;
axios.post(url, {
attendance_date:moment(values.attendance_date).format('YYYY-MM-DD'),
end_time: moment(values.end_time).format('HH:mm'),
group_ids:values.group_ids,
mode: values.mode,
name: values.name,
start_time:moment(values.start_time).format('HH:mm'),
})
.catch(function (error) {
console.log(error);
});
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification(`创建签到成功`);
this.setState({
type:false
})
hideCreatesign()
settabsdata()
}
})
.catch(function (error) {
console.log(error);
});
}
}else{
this.setState({
type:false
@ -153,8 +225,8 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
})
}
render() {
const { visible, form ,setRadio,Radiolist,hideCreatesign} = this.props;
let {course_groups}=this.state;
const { visible,form ,setRadio,Radiolist,hideCreatesign,editvisible} = this.props;
let {course_groups,newmode}=this.state;
const { getFieldDecorator } = form;
const { Option } = Select;
const formItemLayout = {
@ -175,12 +247,12 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
"background":"#4CACFF",
"borderRadius":"4px",
}
const format = 'HH:mm';
return (
<Modal
visible={visible}
title="创建签到"
visible={editvisible?editvisible:visible}
title={this.props&&this.props.type==="edit"?"编辑签到":"创建签到"}
closable={false}
footer={null}
width={600}
@ -196,7 +268,9 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
<Form.Item label="签到班级:">
{getFieldDecorator('group_ids')(
<Select mode="multiple" placeholder={course_groups.length>0?"不选择分班时默认选择全部学生":'暂无分班,将默认选择课堂全部学生'} getPopupContainer={trigger => trigger.parentNode}>
<Select mode="multiple" placeholder={course_groups.length>0?"不选择分班时默认选择全部学生":'暂无分班,将默认选择课堂全部学生'} getPopupContainer={trigger => trigger.parentNode}
disabled={this.props&&this.props.type==="edit"?true:false}
>
{course_groups.map((item,key)=>{
return(
@ -218,18 +292,18 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
<Radio value="QRCODE">二维码签到</Radio>
</Radio.Group>,
)}
{Radiolist==="QUICK"?<div
{Radiolist==="QUICK"||!Radiolist&&newmode==="QUICK"?<div
style={{color:"#E6A23C",
height:"15px",
lineHeight: "15px"}}>学生点击签到按钮即可完成签到</div>:""}
{Radiolist==="NUMBER"?<div
{Radiolist==="NUMBER"||!Radiolist&&newmode==="NUMBER"?<div
style={{color:"#E6A23C",
height:"15px",
lineHeight: "15px"}}
>学生需要输入签到码才能完成签到</div>:""}
{Radiolist==="QRCODE"?<div
{Radiolist==="QRCODE"||!Radiolist&&newmode==="QRCODE"?<div
style={{color:"#E6A23C",
height:"15px",
lineHeight: "15px"}}
@ -238,11 +312,13 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
<Form.Item label="签到日期:">
{getFieldDecorator('attendance_date', {
rules: [{ type: 'object', required: true, message: '请选择签到日期',}],
initialValue:this.props.type==="edit"?moment(this.state.attendance_date,'YYYY-MM-DD'):"",
rules: [{required: true, message: '请选择签到日期',}],
})(<DatePicker style={{width:"413px"}} getPopupContainer={trigger => trigger.parentNode}
disabledTime={disabledDateTime}
disabledDate={disabledDate}
onChange={this.onChange}
// value={moment('2015-01-01', 'YYYY-MM-DD')}
/>)}
</Form.Item>
<style>
@ -332,7 +408,7 @@ const CollectionCreateForm = Form.create({ name: 'form_in_modal' })(
class Createsignmodel extends React.Component {
state = {
Radiolist: "",
Radiolist: null,
};
setRadio=(e)=>{
@ -341,6 +417,7 @@ class Createsignmodel extends React.Component {
})
}
render() {
return (
<React.Fragment>
<CollectionCreateForm

@ -1,7 +1,7 @@
import React, {Component} from "react";
import '../../signin/css/signincdi.css';
import {Progress, message} from 'antd';
import {getImageUrl} from 'educoder';
import {getImageUrl,formatSeconds} from 'educoder';
import axios from 'axios';
@ -33,6 +33,20 @@ class Studenticscom extends Component {
<div className="ws100s edu-back-white sortinxdirection" style={{
position: "relative"
}}>
<script>
{
`
a{ 
    text-decoration:none;
    color:#333;
}
a:hover{
    text-decoration:none;//鼠标放上面不显示下划线
    color:#333;
}
`
}
</script>
<div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection">
<p className="sortinxdirection h40s" onClick={()=>this.props.statisticsy(false)} >
@ -88,7 +102,7 @@ class Studenticscom extends Component {
<div className="yslshipingshi" style={{width:260,height:100}}>
<div className="ws100s verticallayout tbrt">
<div className="ws100 ts">总观看时长</div>
<div className="ws100s tss">{this.props.watch_staticsdata&&this.props.watch_staticsdata.total_duration?this.props.watch_staticsdata.total_duration:0}</div>
<div className="ws100s tss">{this.props.watch_staticsdata&&this.props.watch_staticsdata.total_duration?formatSeconds(this.props.watch_staticsdata.total_duration):0}</div>
</div>
</div>

@ -155,7 +155,7 @@ class Studentstatistics extends Component {
user_name: response.data.data[i].user_name,
is_finished: response.data.data[i].is_finished,
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].freq,
start_at:response.data.data[i].start_at,
end_at:response.data.data[i].end_at,
})
@ -205,7 +205,7 @@ class Studentstatistics extends Component {
let mysorder="";
if (sorter.order === "ascend") {
if(sorter.columnKey === "feq"){
mysorder="feq-asc";
mysorder="freq-asc";
}else{
mysorder="total_duration-asc";
@ -221,7 +221,7 @@ class Studentstatistics extends Component {
})
} else if (sorter.order === "descend") {
if(sorter.columnKey === "feq"){
mysorder="feq-desc";
mysorder="freq-desc";
}else{
mysorder="total_duration-desc";
@ -252,6 +252,20 @@ class Studentstatistics extends Component {
return (
<React.Fragment>
<div className="ws100s mt20">
<script>
{
`
a{ 
    text-decoration:none;
    color:#333;
}
a:hover{
    text-decoration:none;//鼠标放上面不显示下划线
    color:#333;
}
`
}
</script>
<div className="ws100s edu-back-white">
<div className="ws100s teacherentrydivss pd15s">
<div className="ws100s sortinxdirection">
@ -263,7 +277,7 @@ class Studentstatistics extends Component {
{
`
.ysltableo .ant-table-thead > tr > th, .ant-table-tbody > tr > td {
padding: 10px 10px;
padding: 10px 5px;
}
`
}

@ -1,7 +1,7 @@
import React, {Component} from "react";
import '../../signin/css/signincdi.css';
import {Progress, message} from 'antd';
import {getImageUrl} from 'educoder';
import {getImageUrl,formatSeconds} from 'educoder';
import axios from 'axios';
@ -33,6 +33,20 @@ class Videostatisticscom extends Component {
<div className="ws100s edu-back-white sortinxdirection" style={{
position: "relative"
}}>
<script>
{
`
a{ 
    text-decoration:none;
    color:#333;
}
a:hover{
    text-decoration:none;//鼠标放上面不显示下划线
    color:#333;
}
`
}
</script>
<div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection">
<p className="sortinxdirection h40s" onClick={()=>this.props.statisticsy(false)} >
@ -88,7 +102,7 @@ class Videostatisticscom extends Component {
<div className="yslshipingshi" style={{width:260,height:100}}>
<div className="ws100s verticallayout tbrt">
<div className="ws100 ts">总观看时长</div>
<div className="ws100s tss">{this.props.watch_staticsdata&&this.props.watch_staticsdata.total_duration?this.props.watch_staticsdata.total_duration:0}</div>
<div className="ws100s tss">{this.props.watch_staticsdata&&this.props.watch_staticsdata.total_duration?formatSeconds(this.props.watch_staticsdata.total_duration):0}</div>
</div>
</div>

@ -28,7 +28,7 @@ class Videostatisticscomtwo extends Component {
className: 'font-14',
width: '50px',
render: (text, record) => (
<span style={{width: '50px'}}>{record.number}</span>
<div style={{width: '50px'}}>{record.number}</div>
),
},
{
@ -39,56 +39,56 @@ class Videostatisticscomtwo extends Component {
className: 'font-14 maxnamewidth100s',
width: '100px',
render: (text, record) => (
<span style={{width: '100px'}} className="maxnamewidth100s">
<div style={{width: "100px",wordWrap: 'break-word', wordBreak: 'break-word'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.user_name}>{record.user_name}</a>
</span>
</div>
),
},
{
title: '视频是否看完',
title: '是否看完',
dataIndex: 'is_finished',
key: 'is_finished',
align: "center",
className: 'font-14',
className: 'font-14 maxnamewidth90s',
width: '90px',
render: (text, record) => (
<span style={{width: '90px'}}>{record.is_finished === true ?
<span style={{color: "#5091FF"}}></span> : <span style={{color: "#E02020"}}></span>}</span>
<div style={{width: '90px'}} className="maxnamewidth90s">{record.is_finished === true ?
<span style={{color: "#5091FF"}}></span> : <span style={{color: "#E02020"}}></span>}</div>
),
},
{
title: '视频累计观看时长',
title: '观看时长',
dataIndex: 'total_duration',
key: 'total_duration',
align: "center",
className: 'font-14 maxnamewidth140s',
width: '140px',
className: 'font-14 maxnamewidth100s',
width: '100px',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => (
<span style={{width: '140px'}} className="maxnamewidth140s"><a className="maxnamewidth140s" style={{
<div style={{width: '100px'}} className="maxnamewidth100s"><a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.total_duration}>{record.total_duration}</a></span>
}} title={record.total_duration}>{record.total_duration}</a></div>
),
},
{
title: '累计观看次数(次)',
title: '观看次数',
dataIndex: 'feq',
key: 'feq',
align: "center",
className: 'font-14 maxnamewidth140s',
width: '140px',
className: 'font-14 maxnamewidth100s',
width: '100px',
sorter: true,
sortDirections: sortDirections,
render: (text, record) => (
<span style={{width: '140px'}} className="maxnamewidth140s">
<a className="maxnamewidth140s" style={{
<div style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.feq}>{record.feq}</a>
</span>
</div>
),
},
{
@ -96,14 +96,13 @@ class Videostatisticscomtwo extends Component {
dataIndex: 'start_at',
key: 'start_at',
align: "center",
className: 'font-14 maxnamewidth90s',
width: '90px',
className: 'font-14 ',
render: (text, record) => (
<span style={{width: '90px'}} >
<a className="maxnamewidth90s" style={{
<div>
<a style={{
color:"#333333"
}} title= {moment(record.start_at).format('YYYY-MM-DD HH:mm:ss')}> {record.start_at}</a>
</span>
}} title={moment(record.start_at).format('YYYY-MM-DD HH:mm:ss')}> {moment(record.start_at).format('YYYY-MM-DD HH:mm:ss')}</a>
</div>
),
},
{
@ -111,14 +110,13 @@ class Videostatisticscomtwo extends Component {
dataIndex: 'end_at',
key: 'end_at',
align: "center",
className: 'font-14 maxnamewidth90s',
width: '90px',
className: 'font-14 ',
render: (text, record) => (
<span style={{width: '90px'}} >
<a className="maxnamewidth90s" style={{
<div>
<a style={{
color:"#333333"
}} title={moment(record.end_at).format('YYYY-MM-DD HH:mm:ss')}>{record.end_at}</a>
</span>
}} title={moment(record.end_at).format('YYYY-MM-DD HH:mm:ss')}>{moment(record.end_at).format('YYYY-MM-DD HH:mm:ss')}</a>
</div>
),
}
],
@ -476,20 +474,39 @@ class Videostatisticscomtwo extends Component {
return (
<React.Fragment>
<div className="ws100s">
<script>
{
`
a{ 
    text-decoration:none;
    color:#333;
}
a:hover{
    text-decoration:none;//鼠标放上面不显示下划线
    color:#333;
}
`
}
</script>
<div className="ws100s teacherentrydivss edu-back-white ">
<div className="ws100s sortinxdirection">
<div className="ws50s sptits font-18">{mytitle}</div>
<p className="sortinxdirection h40s" onClick={() => this.props.tisticsbools(false, null)} >
<i className="iconfont icon-zuojiantou1 font-14 posiivsiconmyss mr5 colorbluesigin xiaoshou h36s" style={{color:'#BBBBBB'}} ></i>
</p>
<div className="ws50s sptits font-18">
<div className="ml10">{mytitle}</div>
</div>
<div className="ws50s sptitss xaxisreverseorder font-14" style={{
color: "#5091FF",
lineHeight: "42px",
}}>
{
isAdmin === true ?
<div className="xiaoshou ml32" onClick={() => this.props.tisticsbools(false, null)}>
<span className="mr5 xiaoshou">视频统计总览</span><i className="iconfont icon-fanhui font-13 xiaoshou"></i>
</div>
:""
}
{/*{*/}
{/* isAdmin === true ?*/}
{/* <div className="xiaoshou ml32" onClick={() => this.props.tisticsbools(false, null)}>*/}
{/* <span className="mr5 xiaoshou">视频统计总览</span><i className="iconfont icon-fanhui font-13 xiaoshou"></i>*/}
{/* </div>*/}
{/* :""*/}
{/*}*/}
{
isAdmin === true ?

@ -249,6 +249,20 @@ class Videostatisticslist extends Component {
return (
<React.Fragment>
<div className="ws100s mt20">
<script>
{
`
a{ 
    text-decoration:none;
    color:#333;
}
a:hover{
    text-decoration:none;//鼠标放上面不显示下划线
    color:#333;
}
`
}
</script>
<div className="ws100s edu-back-white">
<div className="ws100s teacherentrydivss pd15s">
<div className="ws100s sortinxdirection">

@ -21,7 +21,7 @@ const clipboardMap = {}
function VideoInReviewItem (props) {
const theme = useContext(ThemeContext);
const { history, file_url , play_url , cover_url , transcoded , title, created_at, published_at, isReview, id
, onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation , deleteVideo , moveVideo ,link, people_num,total_time} = props;
, onEditVideo, onMaskClick, getCopyText, showNotification,vv,play_duration,operation , deleteVideo , moveVideo ,link, people_num,total_time,Setmyktid} = props;
useEffect(()=> {
if (!isReview) {
_clipboard = new ClipboardJS(`.copybtn_item_${id}`);
@ -38,7 +38,7 @@ function VideoInReviewItem (props) {
}
}, [])
const username = props.match.params.username
function toList() {
@ -52,11 +52,11 @@ function VideoInReviewItem (props) {
<div className={`${isReview ? 'videoInReviewItem' : 'nItem'} videoItem`}>
<Spin tip="正在转码,请稍等..." spinning={!transcoded && !link}>
<img className="cover" src={imgUrl} alt=""></img>
{ link ?
{ link ?
<a href={link} target='_blank' className="otherLinkPanel">
<span className="otherLink">外链</span>
</a>
: ""
</a>
: ""
}
{!isReview && <div className="mask" onClick={() => onMaskClick(props)}></div>}
@ -76,7 +76,7 @@ function VideoInReviewItem (props) {
{/* <span className="time">{moment(published_at || created_at).format('YYYY-MM-DD HH:mm:ss')}{people_num}</span> */}
{link||total_time===undefined?<span className="time"> </span>:<span className="time">{
formatSeconds(total_time)}
formatSeconds(total_time)}
{/* total_time<60?total_time+' s':total_time/60<60?(total_time/60).toFixed(0)+' min':(total_time/3600).toFixed(1)+ ' h' */}
</span>}
</div>
@ -85,28 +85,38 @@ function VideoInReviewItem (props) {
<span className={"dianjilianicon"}>
{total_time===undefined?'':!people_num || (people_num && people_num)===0 ? "" : <Tooltip title="观看人数" placement="bottom">
<i className={`icon-dianjiliang iconfont dianjilianicon font-12`}> {!people_num || (people_num && people_num)===0?"":people_num}</i>
</Tooltip> }
</Tooltip> }
</span>
<div>
{
props&&props.mykt!=undefined?isReview !== true && moveVideo &&
<Tooltip title="统计" placement="bottom">
<i className="icon-tongji1 iconfont font-15" onClick={() => Setmyktid(props.newcourse_video_id,props.newtitle)}
style={{ marginTop: '1px', display: 'inline-block'}}
></i>
</Tooltip>:""
}
{
isReview !== true && moveVideo &&
<Tooltip title="移动到" placement="bottom">
isReview !== true && moveVideo &&
<Tooltip title="移动" placement="bottom">
<i className="icon-yidong iconfont font-15" onClick={() => moveVideo(props)}
style={{ marginTop: '1px', display: 'inline-block'}}
></i>
</Tooltip>
}
{
deleteVideo &&
deleteVideo &&
<Tooltip title="删除" placement="bottom">
<i className="icon-shanchu iconfont" onClick={() => deleteVideo(props)}
style={{ marginTop: '1px', display: 'inline-block'}}
></i>
</Tooltip>
}
{
isReview !== true && operation &&
<Tooltip title="编辑" placement="bottom">
@ -117,12 +127,12 @@ function VideoInReviewItem (props) {
}
{
isReview !== true && !link ?
<Tooltip title="复制视频地址" placement="bottom">
<Tooltip title="复制" placement="bottom">
<i className={`icon-fuzhi iconfont copybtn_item_${id}`} data-clipboard-text={getCopyText((play_url || file_url), cover_url)}></i>
</Tooltip>:""
}
</div>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save