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] 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| 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]) @watch_course_videos = @watch_course_videos.where("course_members.course_group_id = ?", params[:group_id])
end 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? if params[:order].present?
key = params[:order].split("-") key = params[:order].split("-")

@ -103,25 +103,38 @@ class CoursesController < ApplicationController
end end
def course_videos 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") @video_module = @course.course_modules.find_by(module_type: "video")
if params[:category_id].present? && params[:category_id].to_i != 0 if params[:category_id].present? && params[:category_id].to_i != 0
@category = @video_module&.course_second_categories.find_by(id: params[:category_id]) @category = @video_module&.course_second_categories.find_by(id: params[:category_id])
tip_exception("子目录id有误") if !@category.present? 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 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})" @count = course_videos.count("course_videos.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")
logger.info("#######count:#{@count}") 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 end
def delete_course_video def delete_course_video
@ -1491,11 +1504,10 @@ class CoursesController < ApplicationController
@videos = CourseVideo.joins(" @videos = CourseVideo.joins("
JOIN videos ON course_videos.course_id = #{@course.id} AND videos.id = course_videos.video_id JOIN videos ON course_videos.course_id = #{@course.id} AND videos.id = course_videos.video_id
LEFT JOIN ( 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 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 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} 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")
@ -1509,7 +1521,7 @@ class CoursesController < ApplicationController
end end
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 @videos = paginate @videos
end 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 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 watch_course_videos ON course_videos.id = watch_course_videos.course_video_id AND watch_course_videos.user_id = #{current_user.id}
JOIN ( 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 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 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 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 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.id
) AS hisotries ON hisotries.course_video_id = course_videos.id").select("course_videos.id") ) AS hisotries ON hisotries.id = watch_course_videos.id ").select("course_videos.id")
@count = @videos.count @count = @videos.count
@ -1542,7 +1554,7 @@ class CoursesController < ApplicationController
end end
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 @videos = paginate @videos
end end

@ -115,7 +115,7 @@ class Attachment < ApplicationRecord
def become_history def become_history
history = self.attachment_histories.first 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, attachment_id: self.id,
version: history.nil? ? 1 : history.version + 1, version: history.nil? ? 1 : history.version + 1,
)) ))
@ -123,7 +123,7 @@ class Attachment < ApplicationRecord
end end
def copy_attributes_from_new_attachment(new_attachment) 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 end
def set_public(is_public) def set_public(is_public)

@ -161,7 +161,7 @@ class Course < ApplicationRecord
end end
def videos_count 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 .or(course_videos.where(course_videos: {is_link: true})).size
end end

@ -1,5 +1,6 @@
json.data do json.data do
json.array! @watch_course_videos do |d| json.array! @watch_course_videos do |d|
json.id d.id
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(0) 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_img url_to_avatar(user)
json.user_login user&.login json.user_login user&.login
else else
json.course_video_id video.id
json.partial! 'users/videos/video', locals: { video: video.video } json.partial! 'users/videos/video', locals: { video: video.video }
json.total_time video.watch_course_videos.sum(:total_duration).round(0) json.total_time video['total_duration'].round(0)
json.people_num video.watch_course_videos.count(:user_id) json.people_num video['count']
end end
end end

@ -1,8 +1,9 @@
json.data do json.data do
json.array! @videos.each do |d| json.array! @videos.each do |d|
json.watch_course_video_id d['watch_course_video_id']
json.title d.title json.title d.title
json.user_name d.video.user&.real_name 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.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

@ -1,7 +1,7 @@
json.videos do json.videos do
json.array! @videos do |v| json.array! @videos do |v|
json.id v.id json.id v.id
json.title v.title json.title v['video_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'].round(0) json.total_time v['total_time'].round(0)

@ -17,8 +17,9 @@ json.data do
end end
# json.partial! "files/course_groups", attachment_group_settings: attachment.attachment_group_settings # json.partial! "files/course_groups", attachment_group_settings: attachment.attachment_group_settings
json.category_id attachment.course_second_category_id 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.category_name attachment.course_second_category&.name
json.parent_category_name attachment.course_second_category&.parent&.name
end end
end end
end end

@ -255,11 +255,13 @@ class Video extends Component {
<div className="videoContent"> <div className="videoContent">
{ {
videos.map((item, key) => { 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 ( return (
<VideoInReviewItem <VideoInReviewItem
Setmyktid={(id,title)=>this.props.Setmyktid(id,title)}
mykt={this.props.mykt}
{...this.props} {...this.props}
{...this.state}
{...item} {...item}
key={item.id} key={item.id}
onEditVideo={this.onEditVideo} onEditVideo={this.onEditVideo}
@ -268,6 +270,8 @@ class Video extends Component {
operation={operation || item.user_id === user_id} operation={operation || item.user_id === user_id}
deleteVideo={(admin || item.user_id === user_id) ? this.deleteVideo : undefined} 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} 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> </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, liveVisible: false,
statistics: false, statistics: false,
myktid:null,
mytitle:''
} }
} }
@ -55,7 +57,24 @@ class VideoIndex extends Component {
this.getLiveList(page); 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 = () => { componentDidMount = () => {
const {search} = this.props.location; const {search} = this.props.location;
const {page} = this.state; const {page} = this.state;
@ -79,6 +98,8 @@ class VideoIndex extends Component {
if(this.props.homedirectory ===true){ if(this.props.homedirectory ===true){
this.setState({ this.setState({
statistics:false, statistics:false,
myktid:null,
mytitle:"",
}) })
} }
} }
@ -255,12 +276,23 @@ class VideoIndex extends Component {
this.setState({ this.setState({
statistics: bool, statistics: bool,
myktid:null,
mytitle:"",
})
}
mystatisticsys = (bool,n) => {
this.setState({
statistics: bool,
myktid:null,
mytitle:"",
}) })
} }
render() { 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; const {coursesId, videoId} = this.props.match.params;
let {course_identity} = this.props && this.props.coursedata; let {course_identity} = this.props && this.props.coursedata;
let is_teacher = this.props && this.props.user && this.props.user.is_teacher; let is_teacher = this.props && this.props.user && this.props.user.is_teacher;
@ -377,7 +409,14 @@ class VideoIndex extends Component {
</div> </div>
</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" ? type === "video" ?
<Videos <Videos
mykt={"mykt"}
Setmyktid={(id,title)=>this.Setmyktid(id,title)}
upload={upload} upload={upload}
videos={videos} videos={videos}
page={page} page={page}

@ -38,7 +38,8 @@ class ShixunWorkReport extends Component {
work_comment_hidden:undefined, work_comment_hidden:undefined,
work_comment:undefined, work_comment:undefined,
has_commit: false, has_commit: false,
shixun_detail:[] shixun_detail:[],
view_tpi:false
} }
} }
@ -115,7 +116,8 @@ class ShixunWorkReport extends Component {
work_comment:result.data.work_comment, work_comment:result.data.work_comment,
spinning: false, spinning: false,
has_commit: result.data.has_commit, 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() { 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 category_id=data===undefined?"":data.category===null?"":data.category.category_id;
let homework_common_id=data===undefined?"":data.homework_common_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={"fl"}>总体评价</div>
<div className={"fr"}> <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){ if(key===0){
return( return(
<a className={"color-blue font-16"} href={/tasks/+item.game_identifier} target="_blank" >查看学员实训</a> <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 '../css/signincdi.css';
import {Progress} from 'antd'; import {Progress} from 'antd';
import axios from 'axios'; import axios from 'axios';
import Createsignmodel from '../model/Createsignmodel';
//条目 //条目
class Teacherentry extends Component { class Teacherentry extends Component {
//条目组件 //条目组件
constructor(props) { constructor(props) {
super(props); super(props);
this.state = {} this.state = {
editvisible:false,
attendancesid:null
}
} }
componentDidMount() { 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() { render() {
let isAdmin = this.props.isAdmin(); let isAdmin = this.props.isAdmin();
let item = this.props.item; let item = this.props.item;
@ -32,9 +58,18 @@ class Teacherentry extends Component {
} catch (e) { } catch (e) {
jdt = 100; jdt = 100;
} }
return ( return (
<React.Fragment> <React.Fragment>
<div className={index===0?"ws100s edu-back-white xiaoshou": "ws100s edu-back-white mt20 xiaoshou"}> <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)}:""}> <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"} > <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="ws100s xaxisreverseorder">
<div className="jiezhis h40s xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisEnd(item.id)}}>截止</div> <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 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> </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> item.edit_auth === true ?
<div className="shanchu h40s xiaoshou" onClick={(e)=>{e.stopPropagation();this.props.thisdelete(item.id)}}>删除</div> <div className="ws100s xaxisreverseorder">
</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,true,item.name)}}>编辑</div>
<div className="ws100s xaxisreverseorder"> </div>
<div className="jiezhis h40s color-reds 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>
)
: :
( (
this.props.defaultActiveKey === "1" ? this.props.defaultActiveKey === "1" ?

@ -472,7 +472,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;
}
.font-14{ .font-14{
font-size: 14px !important; font-size: 14px !important;
} }

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

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

@ -155,7 +155,7 @@ class Studentstatistics extends Component {
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?formatSeconds(response.data.data[i].total_duration):0, 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, start_at:response.data.data[i].start_at,
end_at:response.data.data[i].end_at, end_at:response.data.data[i].end_at,
}) })
@ -205,7 +205,7 @@ class Studentstatistics extends Component {
let mysorder=""; let mysorder="";
if (sorter.order === "ascend") { if (sorter.order === "ascend") {
if(sorter.columnKey === "feq"){ if(sorter.columnKey === "feq"){
mysorder="feq-asc"; mysorder="freq-asc";
}else{ }else{
mysorder="total_duration-asc"; mysorder="total_duration-asc";
@ -221,7 +221,7 @@ class Studentstatistics extends Component {
}) })
} else if (sorter.order === "descend") { } else if (sorter.order === "descend") {
if(sorter.columnKey === "feq"){ if(sorter.columnKey === "feq"){
mysorder="feq-desc"; mysorder="freq-desc";
}else{ }else{
mysorder="total_duration-desc"; mysorder="total_duration-desc";
@ -252,6 +252,20 @@ class Studentstatistics extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<div className="ws100s mt20"> <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 edu-back-white">
<div className="ws100s teacherentrydivss pd15s"> <div className="ws100s teacherentrydivss pd15s">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
@ -263,7 +277,7 @@ class Studentstatistics 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;
} }
` `
} }

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

@ -28,7 +28,7 @@ class Videostatisticscomtwo extends Component {
className: 'font-14', className: 'font-14',
width: '50px', width: '50px',
render: (text, record) => ( 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', className: 'font-14 maxnamewidth100s',
width: '100px', width: '100px',
render: (text, record) => ( 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={{ <a className="maxnamewidth100s" style={{
color:"#333333" color:"#333333"
}} title={record.user_name}>{record.user_name}</a> }} title={record.user_name}>{record.user_name}</a>
</span> </div>
), ),
}, },
{ {
title: '视频是否看完', title: '是否看完',
dataIndex: 'is_finished', dataIndex: 'is_finished',
key: 'is_finished', key: 'is_finished',
align: "center", align: "center",
className: 'font-14', className: 'font-14 maxnamewidth90s',
width: '90px', width: '90px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '90px'}}>{record.is_finished === true ? <div style={{width: '90px'}} className="maxnamewidth90s">{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>}</div>
), ),
}, },
{ {
title: '视频累计观看时长', title: '观看时长',
dataIndex: 'total_duration', dataIndex: 'total_duration',
key: 'total_duration', key: 'total_duration',
align: "center", align: "center",
className: 'font-14 maxnamewidth140s', className: 'font-14 maxnamewidth100s',
width: '140px', width: '100px',
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( 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" color:"#333333"
}} title={record.total_duration}>{record.total_duration}</a></span> }} title={record.total_duration}>{record.total_duration}</a></div>
), ),
}, },
{ {
title: '累计观看次数(次)', title: '观看次数',
dataIndex: 'feq', dataIndex: 'feq',
key: 'feq', key: 'feq',
align: "center", align: "center",
className: 'font-14 maxnamewidth140s', className: 'font-14 maxnamewidth100s',
width: '140px', width: '100px',
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '140px'}} className="maxnamewidth140s"> <div style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth140s" style={{ <a className="maxnamewidth100s" style={{
color:"#333333" color:"#333333"
}} title={record.feq}>{record.feq}</a> }} title={record.feq}>{record.feq}</a>
</span> </div>
), ),
}, },
{ {
@ -96,14 +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 maxnamewidth90s', className: 'font-14 ',
width: '90px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '90px'}} > <div>
<a className="maxnamewidth90s" style={{ <a style={{
color:"#333333" color:"#333333"
}} title= {moment(record.start_at).format('YYYY-MM-DD HH:mm:ss')}> {record.start_at}</a> }} title={moment(record.start_at).format('YYYY-MM-DD HH:mm:ss')}> {moment(record.start_at).format('YYYY-MM-DD HH:mm:ss')}</a>
</span> </div>
), ),
}, },
{ {
@ -111,14 +110,13 @@ class Videostatisticscomtwo extends Component {
dataIndex: 'end_at', dataIndex: 'end_at',
key: 'end_at', key: 'end_at',
align: "center", align: "center",
className: 'font-14 maxnamewidth90s', className: 'font-14 ',
width: '90px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '90px'}} > <div>
<a className="maxnamewidth90s" style={{ <a style={{
color:"#333333" color:"#333333"
}} title={moment(record.end_at).format('YYYY-MM-DD HH:mm:ss')}>{record.end_at}</a> }} title={moment(record.end_at).format('YYYY-MM-DD HH:mm:ss')}>{moment(record.end_at).format('YYYY-MM-DD HH:mm:ss')}</a>
</span> </div>
), ),
} }
], ],
@ -476,20 +474,39 @@ class Videostatisticscomtwo extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<div className="ws100s"> <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 teacherentrydivss edu-back-white ">
<div className="ws100s sortinxdirection"> <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={{ <div className="ws50s sptitss xaxisreverseorder font-14" style={{
color: "#5091FF", color: "#5091FF",
lineHeight: "42px", lineHeight: "42px",
}}> }}>
{ {/*{*/}
isAdmin === true ? {/* isAdmin === true ?*/}
<div className="xiaoshou ml32" onClick={() => this.props.tisticsbools(false, null)}> {/* <div className="xiaoshou ml32" 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 ?

@ -249,6 +249,20 @@ class Videostatisticslist extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<div className="ws100s mt20"> <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 edu-back-white">
<div className="ws100s teacherentrydivss pd15s"> <div className="ws100s teacherentrydivss pd15s">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">

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

Loading…
Cancel
Save