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

courseware
dinglink 5 years ago
commit fc781e15e1

@ -973,15 +973,15 @@ class GamesController < ApplicationController
if res && res['code'].to_i != 0 if res && res['code'].to_i != 0
raise("实训云平台繁忙繁忙等级99") raise("实训云平台繁忙繁忙等级99")
end end
# @vnc_url = res['showServer'] @vnc_url = res['showServer']
@vnc_url = # @vnc_url =
if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb" # if request.subdomain == "pre-newweb" || request.subdomain == "test-newweb"
# 无域名版本 # # 无域名版本
"http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless" # "http://#{service_host}:#{res['port']}/vnc_lite.html?password=headless"
else # else
# 有域名版本 # # 有域名版本
"https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless" # "https://#{res['port']}.#{service_host}/vnc_lite.html?password=headless"
end # end
@vnc_evaluate = shixun.vnc_evaluate @vnc_evaluate = shixun.vnc_evaluate
rescue Exception => e rescue Exception => e
Rails.logger.error(e.message) Rails.logger.error(e.message)

@ -46,7 +46,7 @@ debugType="admin";
// 老师 // 老师
// debugType="teacher"; // debugType="teacher";
// 学生 // 学生
//debugType="student"; // debugType="student";

@ -102,7 +102,8 @@ class ListPageIndex extends Component{
this.state={ this.state={
yslGuideone:undefined, yslGuideone:undefined,
yslElearning:false, yslElearning:false,
isexcellent:false isexcellent:false,
homedirectory:false,
} }
} }
comyslElearning(bool){ comyslElearning(bool){
@ -183,6 +184,21 @@ class ListPageIndex extends Component{
updatabanners=()=>{ updatabanners=()=>{
this.refs.CoursesBanner.updatabanner() this.refs.CoursesBanner.updatabanner()
} }
//是否点击了目录
Callhomedirectoryornot=(bool)=>{
this.setState({
homedirectory:bool
})
if(bool===true){
setTimeout(() => {
this.setState({
homedirectory:false,
})
}, 1000);
}
}
render() { render() {
let {yslGuideone} =this.state; let {yslGuideone} =this.state;
// console.log("98"); // console.log("98");
@ -218,7 +234,7 @@ class ListPageIndex extends Component{
{/*left_nav*/} {/*left_nav*/}
<div className={"with22 fl setleft"} style={{width:'264px',minHeight:'500px'}}> <div className={"with22 fl setleft"} style={{width:'264px',minHeight:'500px'}}>
<Coursesleftnav {...this.props} {...this.state} comyslElearning={(i)=>this.comyslElearning(i)}/> <Coursesleftnav {...this.props} {...this.state} comyslElearning={(i)=>this.comyslElearning(i)} myinex={true} Callhomedirectoryornot={(b)=>this.Callhomedirectoryornot(b)}/>
</div> </div>
{/*right_concent*/} {/*right_concent*/}
@ -261,16 +277,16 @@ class ListPageIndex extends Component{
} }
></Route> ></Route>
{/*视频列表*/} {/*视频列表*/}
<Route path="/classrooms/:coursesId/course_video/:videoId" <Route path="/classrooms/:coursesId/course_video/:videoId"
render={ render={
(props) => (<CourseVideo {...this.props} {...props} {...this.state} />) (props) => (<CourseVideo {...this.props} {...props} {...this.state} homedirectory={this.state.homedirectory}/>)
} }
></Route> ></Route>
<Route path="/classrooms/:coursesId/course_videos" <Route path="/classrooms/:coursesId/course_videos"
render={ render={
(props) => (<CourseVideo {...this.props} {...props} {...this.state} />) (props) => (<CourseVideo {...this.props} {...props} {...this.state} homedirectory={this.state.homedirectory}/>)
} }
></Route> ></Route>
{/* 教师列表*/} {/* 教师列表*/}
<Route path="/classrooms/:coursesId/teachers" <Route path="/classrooms/:coursesId/teachers"
render={ render={

@ -1,7 +1,7 @@
import React,{ Component } from "react"; import React, {Component} from "react";
import { WordsBtn,on, trigger ,publicSearchs} from 'educoder'; import {WordsBtn, on, trigger, publicSearchs} from 'educoder';
import { Menu, Spin } from 'antd'; import {Menu, Spin} from 'antd';
import axios from 'axios'; import axios from 'axios';
import Videos from './Video'; import Videos from './Video';
@ -12,288 +12,310 @@ import Videostatistics from '../videostatistics/Videostatistics';
import './video.css'; import './video.css';
import '../css/Courses.css'; import '../css/Courses.css';
import '../publicNav/nav.css'; import '../publicNav/nav.css';
const PAGE_SIZE = 15; const PAGE_SIZE = 15;
const LIVE_PAGE_SIZE = 10; const LIVE_PAGE_SIZE = 10;
const $ = window.$; const $ = window.$;
function getRight(){ function getRight() {
var right = parseInt($(".-task-sidebar").css("right")); var right = parseInt($(".-task-sidebar").css("right"));
return right===0?0:right; return right === 0 ? 0 : right;
} }
class VideoIndex extends Component{
constructor(props){ class VideoIndex extends Component {
super(props); constructor(props) {
this.state={ super(props);
page:1, this.state = {
upload:false, page: 1,
videos:undefined, upload: false,
videoData:undefined, videos: undefined,
otherLinkVisible:false, videoData: undefined,
type:"video", otherLinkVisible: false,
isSpining:false, type: "video",
isSpining: false,
lives:undefined,
liveData:undefined, lives: undefined,
liveData: undefined,
liveId:undefined,
liveId: undefined,
liveVisible:false,
statistics:false, liveVisible: false,
statistics: false,
} }
} }
checkType=(type,page)=>{ checkType = (type, page) => {
this.setState({ this.setState({
type, type,
isSpining:true isSpining: true
}) })
if(type === "video"){ if (type === "video") {
this.getList(page); this.getList(page);
}else{ } else {
this.getLiveList(page); this.getLiveList(page);
} }
} }
componentDidMount=()=>{ componentDidMount = () => {
const { search } = this.props.location; const {search} = this.props.location;
const { page } = this.state; const {page} = this.state;
if(search && search === "?open=live"){ if (search && search === "?open=live") {
this.setState({ this.setState({
type:"live" type: "live"
}) })
this.checkType("live",page); this.checkType("live", page);
}else{ } else {
if(search === "?open=new"){ if (search === "?open=new") {
this.setState({ this.setState({
upload:true upload: true
}) })
} }
this.checkType("video",page); this.checkType("video", page);
} }
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if(this.props.match.params.videoId !== prevProps.match.params.videoId ){ try {
this.setState({ if (this.props.homedirectory !== prevProps.homedirectory) {
upload:false if(this.props.homedirectory ===true){
}) this.setState({
const { page } = this.state; statistics:false,
this.checkType("video",page); })
} }
} }
// 获取直播列表 }catch (e) {
getLiveList=(page)=>{
const CourseId=this.props.match.params.coursesId; }
const url = `/courses/${CourseId}/live_links.json`;
axios.get(url,{ if (this.props.match.params.videoId !== prevProps.match.params.videoId) {
params:{ this.setState({
page, upload: false,
limit:LIVE_PAGE_SIZE })
} const {page} = this.state;
}).then(result=>{ this.checkType("video", page);
if(result){ }
this.setState({
liveData:result.data,
lives:result.data.lives, }
isSpining:false, // 获取直播列表
}) getLiveList = (page) => {
} const CourseId = this.props.match.params.coursesId;
}).catch(error=>{ const url = `/courses/${CourseId}/live_links.json`;
console.log(error); axios.get(url, {
}) params: {
} page,
limit: LIVE_PAGE_SIZE
// 获取视频列表 }
getList=(page)=>{ }).then(result => {
const { coursesId , videoId }=this.props.match.params; if (result) {
const fetchUrl = `/courses/${coursesId}/course_videos.json`; this.setState({
axios.get(fetchUrl, { liveData: result.data,
params: { lives: result.data.lives,
page, isSpining: false,
limit: PAGE_SIZE, })
category_id:videoId }
} }).catch(error => {
}) console.log(error);
.then((response) => { })
if(response){ }
this.setState({
videos:response.data.videos, // 获取视频列表
videoData:response.data, getList = (page) => {
isSpining:false const {coursesId, videoId} = this.props.match.params;
}) const fetchUrl = `/courses/${coursesId}/course_videos.json`;
} axios.get(fetchUrl, {
}).catch((error) => { params: {
console.log(error); page,
}) limit: PAGE_SIZE,
} category_id: videoId
}
changeType=(e)=>{ })
this.setState({ .then((response) => {
type:e.key, if (response) {
upload:false, this.setState({
page:1 videos: response.data.videos,
}) videoData: response.data,
this.checkType(e.key,1); isSpining: false
} })
}
changePage=(page,type)=>{ }).catch((error) => {
this.setState({ console.log(error);
page })
}) }
this.checkType(type,page);
} changeType = (e) => {
this.setState({
onEditVideo=(item)=>{ type: e.key,
let videoId = { upload: false,
videoId: item.id, page: 1
title: item.title })
} this.checkType(e.key, 1);
this.setState({ }
videoId,
}) changePage = (page, type) => {
this.setVisible(true); this.setState({
} page
uploadVideo=(upload)=>{ })
this.checkType(type, page);
this.setState({ }
upload,
isSpining:true onEditVideo = (item) => {
}) let videoId = {
const { page } = this.state; videoId: item.id,
setTimeout(()=>{ title: item.title
this.getList(page); }
},500) this.setState({
} videoId,
})
toUpload =()=> { this.setVisible(true);
const { admin , is_teacher,business} = this.props.user; }
if (admin || business || (is_teacher && this.props.checkIfProfessionalCertification())) { uploadVideo = (upload) => {
this.setState({
type:"video", this.setState({
upload:true, upload,
page:1 isSpining: true
})
} else {
this.props.showProfessionalCertificationDialog();
}
}
// 直播设置后回调的方法
// successFunc=()=>{
// this.setState({
// type:"live",
// page:1
// })
// this.checkType("live",1);
// }
// 直播设置
liveSetting=()=>{
this.setState({
liveId:undefined
})
this.setliveVisibel(true);
}
//直播设置弹框
setliveVisibel=(flag,changetypeFlag)=>{
this.setState({
liveVisible:flag
})
if(flag === false){
this.setState({
liveId:undefined
})
}
if(changetypeFlag){
this.checkType("live",1);
}
}
// 列表-编辑修改传到编辑的id
setLiveId=(id)=>{
this.setState({
liveId:id
})
this.setliveVisibel(true);
}
// 新增目录
addDir=()=>{
let {videoData}=this.state;
trigger('videoAdd', parseInt(videoData.course_module_id));
}
// 目录重命名
editDir=(name,id)=>{
let data={id,name,update:this.getList}
trigger('editVideo',data);
}
// 增加外链
setLinkeVisible=(flag,refresh)=>{
this.setState({
otherLinkVisible:flag
})
if(refresh){
const { page } = this.state;
this.getList(page);
}
}
//统计
statisticsy=(bool)=>{
this.setState({
statistics:bool
}) })
const {page} = this.state;
setTimeout(() => {
this.getList(page);
}, 500)
}
toUpload = () => {
const {admin, is_teacher, business} = this.props.user;
if (admin || business || (is_teacher && this.props.checkIfProfessionalCertification())) {
this.setState({
type: "video",
upload: true,
page: 1
})
} else {
this.props.showProfessionalCertificationDialog();
}
} }
render(){
const { videos , upload , videoData , type , liveData , lives , page , liveVisible , isSpining , liveId , otherLinkVisible,statistics } = this.state; // 直播设置后回调的方法
const { coursesId , videoId }=this.props.match.params; // successFunc=()=>{
let course_identity = this.props&&this.props.coursedata; // this.setState({
let is_teacher=this.props&&this.props.user&&this.props.user.is_teacher; // type:"live",
const flag = parseInt(course_identity) < 5; // page:1
const newOperation = flag; // })
const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification()); // this.checkType("live",1);
return( // }
<React.Fragment> // 直播设置
<VideoLink liveSetting = () => {
coursesId={coursesId} this.setState({
videoId={videoId} liveId: undefined
visible={otherLinkVisible} })
notification={this.props.showNotification} this.setliveVisibel(true);
setVisible={this.setLinkeVisible} }
></VideoLink> //直播设置弹框
<LivesNew setliveVisibel = (flag, changetypeFlag) => {
visible={liveVisible} this.setState({
liveId={liveId} liveVisible: flag
setliveVisibel={this.setliveVisibel} })
{...this.props} if (flag === false) {
{...this.state} this.setState({
></LivesNew> liveId: undefined
{ })
liveVisible ? }
<style>{ if (changetypeFlag) {
` this.checkType("live", 1);
}
}
// 列表-编辑修改传到编辑的id
setLiveId = (id) => {
this.setState({
liveId: id
})
this.setliveVisibel(true);
}
// 新增目录
addDir = () => {
let {videoData} = this.state;
trigger('videoAdd', parseInt(videoData.course_module_id));
}
// 目录重命名
editDir = (name, id) => {
let data = {id, name, update: this.getList}
trigger('editVideo', data);
}
// 增加外链
setLinkeVisible = (flag, refresh) => {
this.setState({
otherLinkVisible: flag
})
if (refresh) {
const {page} = this.state;
this.getList(page);
}
}
//统计
statisticsy = (bool) => {
this.setState({
statistics: bool,
})
}
render() {
const {videos, upload, videoData, type, liveData, lives, page, liveVisible, isSpining, liveId, otherLinkVisible, statistics} = 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;
const flag = parseInt(course_identity) < 5;
const newOperation = flag;
const new_upload = flag && (is_teacher && this.props.checkIfProfessionalCertification());
const isAdmin = this.props&& this.props.isAdmin();
return (
<React.Fragment>
<VideoLink
coursesId={coursesId}
videoId={videoId}
visible={otherLinkVisible}
notification={this.props.showNotification}
setVisible={this.setLinkeVisible}
></VideoLink>
<LivesNew
visible={liveVisible}
liveId={liveId}
setliveVisibel={this.setliveVisibel}
{...this.props}
{...this.state}
></LivesNew>
{
liveVisible ?
<style>{
`
body{ body{
width: calc(100% - 7px)!important; width: calc(100% - 7px)!important;
overflow: hidden!important; overflow: hidden!important;
} }
.-task-sidebar{ .-task-sidebar{
right:${getRight()+7}px!important; right:${getRight() + 7}px!important;
} }
`}</style>: `}</style> :
<style>{ <style>{
` `
body{ body{
width: 100%!important; width: 100%!important;
} }
`}</style> `}</style>
} }
{ {
statistics===false? statistics === false ?
<div className="edu-back-white" style={{marginBottom:"1px"}}> <div className="edu-back-white" style={{marginBottom: "1px"}}>
<div className="clearfix pl30 pr30 menuDiv"> <div className="clearfix pl30 pr30 menuDiv">
{ {
videoData && videoData.category_name && type === "video" ? videoData && videoData.category_name && type === "video" ?
<span className="font-18 fl color-dark-21 mt20 mb20">{videoData.category_name}</span> <span className="font-18 fl color-dark-21 mt20 mb20">{videoData.category_name}</span>
: :
<div className="task_menu_ul fl mt2" style={{width:"240px"}}> <div className="task_menu_ul fl mt2" style={{width: "240px"}}>
<Menu mode="horizontal" selectedKeys={[type]} onClick={this.changeType}> <Menu mode="horizontal" selectedKeys={[type]} onClick={this.changeType}>
<Menu.Item key="video">视频</Menu.Item> <Menu.Item key="video">视频</Menu.Item>
<Menu.Item key="live">直播</Menu.Item> <Menu.Item key="live">直播</Menu.Item>
@ -304,32 +326,50 @@ class VideoIndex extends Component{
{ {
type === "video" ? type === "video" ?
<React.Fragment> <React.Fragment>
<span>
{
videoId ?
""
:
<WordsBtn style="blue" className="ml30 font-16 tongjis"
onClick={() => this.statisticsy(true)}
><i className="iconfont icon-tongji1 mr5"></i></WordsBtn>
}
</span>
{ {
newOperation ? newOperation ?
<span> <span>
<WordsBtn style="blue" className="ml30 font-16 tongjis"
onClick={()=>this.statisticsy(true)}
><i className="iconfont icon-tongji1 mr5"></i></WordsBtn>
{ {
videoId ? videoId ?
<WordsBtn style="blue" onClick={()=>this.editDir(videoData && videoData.category_name,videoId)} className={"ml30 font-16"}>目录重命名</WordsBtn> <WordsBtn style="blue"
onClick={() => this.editDir(videoData && videoData.category_name, videoId)}
className={"ml30 font-16"}>目录重命名</WordsBtn>
: :
<WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn> <WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn>
} }
<WordsBtn style="blue" className="ml30 font-16" onClick={()=>this.setLinkeVisible(true)}>增加外链</WordsBtn> <WordsBtn style="blue" className="ml30 font-16"
</span>:"" onClick={() => this.setLinkeVisible(true)}>增加外链</WordsBtn>
</span> : ""
} }
{ {
new_upload ? new_upload ?
<span> <span>
{ {
upload ? upload ?
<WordsBtn style="grey" className="font-16 ml30" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn> <WordsBtn style="grey" className="font-16 ml30"
onClick={() => this.uploadVideo(false)}>取消</WordsBtn>
: :
<WordsBtn style="blue" className="font-16 ml30" onClick={this.toUpload}>上传视频</WordsBtn> <WordsBtn style="blue" className="font-16 ml30" onClick={this.toUpload}>上传视频</WordsBtn>
} }
</span>:"" </span>
: ""
} }
</React.Fragment> </React.Fragment>
: :
<WordsBtn style="blue" className="font-16 ml30" onClick={this.liveSetting}>添加直播</WordsBtn> <WordsBtn style="blue" className="font-16 ml30" onClick={this.liveSetting}>添加直播</WordsBtn>
@ -338,44 +378,45 @@ class VideoIndex extends Component{
</div> </div>
</div> </div>
: :
<Videostatistics {...this.props} {...this.state} statisticsy={(b)=>this.statisticsy(b)}></Videostatistics> <Videostatistics {...this.props} {...this.state} statisticsy={(b) => this.statisticsy(b)}></Videostatistics>
} }
{ {
statistics===false? statistics === false ?
<Spin spinning={isSpining}> <Spin spinning={isSpining}>
{ {
type === "video" ? type === "video" ?
<Videos <Videos
upload={upload} upload={upload}
videos={videos} videos={videos}
page={page} page={page}
data={videoData} data={videoData}
pageSize={PAGE_SIZE} pageSize={PAGE_SIZE}
uploadVideo={this.uploadVideo} uploadVideo={this.uploadVideo}
listFunc={this.getList} listFunc={this.getList}
changePage={this.changePage} changePage={this.changePage}
{...this.props} {...this.props}
{...this.state} {...this.state}
></Videos> ></Videos>
: :
<Lives <Lives
lives={lives} lives={lives}
liveData={liveData} liveData={liveData}
page={page} page={page}
pageSize={LIVE_PAGE_SIZE} pageSize={LIVE_PAGE_SIZE}
successFunc={this.getLiveList} successFunc={this.getLiveList}
changePage={this.changePage} changePage={this.changePage}
setLiveId={this.setLiveId} setLiveId={this.setLiveId}
{...this.props} {...this.props}
{...this.state} {...this.state}
></Lives> ></Lives>
} }
</Spin> </Spin>
: :
"" ""
} }
</React.Fragment> </React.Fragment>
) )
} }
} }
export default VideoIndex; export default VideoIndex;

@ -1,78 +1,78 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import axios from 'axios'; import axios from 'axios';
import {Input,Pagination,Tooltip} from 'antd'; import {Input,Pagination,Tooltip} from 'antd';
//业务组件 //业务组件
import CoursesBanner from "../coursesDetail/CoursesBanner"; import CoursesBanner from "../coursesDetail/CoursesBanner";
import Coursesleftnav from "../coursesDetail/CoursesLeftNav"; import Coursesleftnav from "../coursesDetail/CoursesLeftNav";
class CourseLayoutcomponent extends Component{ class CourseLayoutcomponent extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
} }
componentDidMount(){ componentDidMount(){
} }
// //
// getleftNavid=(navid,newselectnavid)=>{ // getleftNavid=(navid,newselectnavid)=>{
// console.log(navid,newselectnavid) // console.log(navid,newselectnavid)
// this.setState({ // this.setState({
// navkey:navid, // navkey:navid,
// navttype:newselectnavid // navttype:newselectnavid
// }) // })
// } // }
render() { render() {
// 加 , ...this.props 样式会出现2份children // 加 , ...this.props 样式会出现2份children
const childrenWithProps = React.Children.map(this.props.children, child => { const childrenWithProps = React.Children.map(this.props.children, child => {
// debugger; // debugger;
if(!child) { if(!child) {
return '' return ''
} }
return React.cloneElement(child, { ...this.state }) return React.cloneElement(child, { ...this.state })
} }
); );
// console.log("CoursesBanner") // console.log("CoursesBanner")
// console.log(this.props) // console.log(this.props)
return ( return (
<div> <div>
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*头部banner*/} {/*头部banner*/}
<CoursesBanner {...this.props}></CoursesBanner> <CoursesBanner {...this.props}></CoursesBanner>
<div className="educontent clearfix" style={{flex: "1 0 auto"}}> <div className="educontent clearfix" style={{flex: "1 0 auto"}}>
<div className="stud-class-set"> <div className="stud-class-set">
<div className="news"> <div className="news">
<div className="edu-class-inner container clearfix"> <div className="edu-class-inner container clearfix">
<div className="member for-content-0 for-content"> <div className="member for-content-0 for-content">
<div className="people clearfix mb60"> <div className="people clearfix mb60">
{/*left_nav*/} {/*left_nav*/}
<div className={"with22 fl setleft"} style={{width:'264px',minHeight:'500px'}}> <div className={"with22 fl setleft"} style={{width:'264px',minHeight:'500px'}}>
<Coursesleftnav {...this.props} {...this.state}/> <Coursesleftnav myinex={false} {...this.props} {...this.state}/>
</div> </div>
{/*right_concent*/} {/*right_concent*/}
<div className="with78 fl"> <div className="with78 fl">
<div className={"ml20 clearfix"}> <div className={"ml20 clearfix"}>
{childrenWithProps} {childrenWithProps}
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
) )
} }
} }
export default CourseLayoutcomponent; export default CourseLayoutcomponent;

@ -1,105 +1,106 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import axios from 'axios'; import axios from 'axios';
import {Input,Pagination,Tooltip} from 'antd'; import {Input,Pagination,Tooltip} from 'antd';
//业务组件 //业务组件
//top banner //top banner
import CoursesBanner from "./CoursesBanner"; import CoursesBanner from "./CoursesBanner";
//Left nav //Left nav
import Coursesleftnav from "./CoursesLeftNav"; import Coursesleftnav from "./CoursesLeftNav";
// 实训作业 // 实训作业
import ShixunHomework from '../shixunHomework/shixunHomework'; import ShixunHomework from '../shixunHomework/shixunHomework';
// 问卷 // 问卷
import Poll from '../poll/Poll'; import Poll from '../poll/Poll';
// 试卷 // 试卷
import Exercise from '../exercise/Exercise'; import Exercise from '../exercise/Exercise';
//教师列表 //教师列表
import TeacherList from "../members/teacherList" import TeacherList from "../members/teacherList"
//普通作业 //普通作业
import CommonWork from "../busyWork/commonWork" import CommonWork from "../busyWork/commonWork"
// 毕设选题 // 毕设选题
import graduationTopics from '../graduation/topics/index' import graduationTopics from '../graduation/topics/index'
class CoursesDetail extends Component{ class CoursesDetail extends Component{
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
getleftNavid:undefined, getleftNavid:undefined,
coursesId:"" coursesId:""
} }
} }
componentDidMount(){ componentDidMount(){
} }
getleftNavid=(type,id)=>{ getleftNavid=(type,id)=>{
console.log(type+" "+id) console.log(type+" "+id)
this.setState({ this.setState({
getleftNavid:type, getleftNavid:type,
coursesId:id coursesId:id
}) })
} }
render() { render() {
let{getleftNavid,coursesId}=this.state; let{getleftNavid,coursesId}=this.state;
// console.log(getleftNavid) // console.log(getleftNavid)
return ( return (
<div> <div>
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*头部banner*/} {/*头部banner*/}
<CoursesBanner {...this.props}></CoursesBanner> <CoursesBanner {...this.props}></CoursesBanner>
<div className="educontent clearfix" style={{flex: "1 0 auto"}}> <div className="educontent clearfix" style={{flex: "1 0 auto"}}>
<div className="stud-class-set"> <div className="stud-class-set">
<div className="news"> <div className="news">
<div className="edu-class-inner container clearfix"> <div className="edu-class-inner container clearfix">
<div className="member for-content-0 for-content"> <div className="member for-content-0 for-content">
<div className="people clearfix mb60"> <div className="people clearfix mb60">
{/*left_nav*/} {/*left_nav*/}
<div className={"with22 fl setleft"} style={{width:'264px',minHeight:'500px'}}> <div className={"with22 fl setleft"} style={{width:'264px',minHeight:'500px'}}>
<Coursesleftnav <Coursesleftnav
{...this.props} {...this.props}
getleftNavid={this.getleftNavid} myinex={false}
/> getleftNavid={this.getleftNavid}
</div> />
</div>
{/*right_concent*/}
<div className="with78 fl"> {/*right_concent*/}
<div className={"ml20 clearfix"}> <div className="with78 fl">
{/* 毕设选题 */} <div className={"ml20 clearfix"}>
{getleftNavid==="graduation"?<graduationTopics {...this.props} coursesId={coursesId}></graduationTopics>:""} {/* 毕设选题 */}
{getleftNavid==="graduation"?<graduationTopics {...this.props} coursesId={coursesId}></graduationTopics>:""}
{/*/!*普通作业*!/*/}
{/*{getleftNavid==="common_homework"?<CommonWork {...this.props} coursesId={coursesId}/>:""}*/} {/*/!*普通作业*!/*/}
{/*{getleftNavid==="common_homework"?<CommonWork {...this.props} coursesId={coursesId}/>:""}*/}
<ShixunHomework {...this.props} child={false}/>
{/*{getleftNavid==="shixun_homeworkchild"?<ShixunHomework {...this.props} child={true} />:""}*/} <ShixunHomework {...this.props} child={false}/>
{/*{getleftNavid==="shixun_homeworkchild"?<ShixunHomework {...this.props} child={true} />:""}*/}
{/*/!*问卷*!/*/}
{/*{getleftNavid==="poll"?<Poll child={false}/>:""}*/} {/*/!*问卷*!/*/}
{/*/!*试卷*!/*/} {/*{getleftNavid==="poll"?<Poll child={false}/>:""}*/}
{/*{getleftNavid==="exercise"?<Exercise child={false}/>:""}*/} {/*/!*试卷*!/*/}
{/*{getleftNavid==="exercise"?<Exercise child={false}/>:""}*/}
</div>
</div> </div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
</div> </div>
) </div>
} )
} }
export default CoursesDetail; }
export default CoursesDetail;

@ -394,7 +394,16 @@ class Coursesleftnav extends Component{
indexs:index indexs:index
}) })
// this.props.history.replace(urls); // this.props.history.replace(urls);
e.stopPropagation();//阻止冒泡 try {
if(this.props.myinex===true){
this.props.Callhomedirectoryornot(true);
}
}catch (e) {
}
e.stopPropagation();//阻止冒泡
} }
selectnavids=(e,key,id,type,urls,index,santype)=>{ selectnavids=(e,key,id,type,urls,index,santype)=>{
@ -409,6 +418,14 @@ class Coursesleftnav extends Component{
}) })
this.props.updataleftNavfun(); this.props.updataleftNavfun();
this.props.history.replace(urls); this.props.history.replace(urls);
try {
if(this.props.myinex===true){
this.props.Callhomedirectoryornot(true);
}
}catch (e) {
}
e.stopPropagation();//阻止冒泡 e.stopPropagation();//阻止冒泡
} }
@ -1011,6 +1028,13 @@ class Coursesleftnav extends Component{
url:urls, url:urls,
indexs:index indexs:index
}) })
try {
if(this.props.myinex===true){
this.props.Callhomedirectoryornot(true);
}
}catch (e) {
}
this.props.history.replace(urls); this.props.history.replace(urls);
e.stopPropagation();//阻止冒泡 e.stopPropagation();//阻止冒泡
} }

@ -188,6 +188,15 @@
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
} }
.pdinstop0{
padding-top: 0px !important;
}
.teacherentrydivss{
padding-left: 20px;
padding-right: 20px;
padding-top: 20px;
padding-bottom: 20px;
}
.teachedivp{ .teachedivp{
font-size:16px; font-size:16px;
font-family:Microsoft YaHei; font-family:Microsoft YaHei;
@ -408,6 +417,14 @@
white-space:nowrap; white-space:nowrap;
cursor: default; cursor: default;
} }
.maxnamewidth200yss{
text-align: center;
max-width:200px;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
cursor: default;
}
.maxnamewidth100s{ .maxnamewidth100s{
width: 100px; width: 100px;
max-width: 100px; max-width: 100px;

@ -49,6 +49,7 @@ class Students_signin extends Component{
page:1, page:1,
limit:5 limit:5
} }
this.gogetdatas(data); this.gogetdatas(data);
// const query = this.props.location.search; // const query = this.props.location.search;
@ -58,8 +59,17 @@ class Students_signin extends Component{
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
try {
if (this.props.homedirectory !== prevProps.homedirectory) {
if(this.props.homedirectory ===true){
this.setState({
switchs:false,
})
}
}
}catch (e) {
}
} }
callback=(key)=> { callback=(key)=> {

@ -33,7 +33,7 @@ class Videostatisticscom extends Component {
<div className="ws100s edu-back-white sortinxdirection" style={{ <div className="ws100s edu-back-white sortinxdirection" style={{
position: "relative" position: "relative"
}}> }}>
<div className="ws100s teacherentrydivs "> <div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws50s sptits">视频统计总览</div> <div className="ws50s 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>

@ -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 {Pagination, Table, Menu, Dropdown} from 'antd'; import {Pagination, Table, Menu, Dropdown,Spin} from 'antd';
import {getImageUrl, sortDirections} from 'educoder'; import {getImageUrl, sortDirections,formatSeconds} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin"; import LoadingSpin from "../../../../common/LoadingSpin";
import NoneDatas from "../../signin/component/NoneDatas"; import NoneDatas from "../../signin/component/NoneDatas";
@ -16,7 +16,7 @@ class Videostatisticscomtwo extends Component {
this.state = { this.state = {
data: [], data: [],
page: 1, page: 1,
limit: 10, limit: 20,
members_count: 0, members_count: 0,
columnsstu: [ columnsstu: [
{ {
@ -38,7 +38,12 @@ 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">{record.user_name}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.user_name}>{record.user_name}</a>
</span>
), ),
}, },
{ {
@ -63,7 +68,9 @@ class Videostatisticscomtwo extends Component {
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '150px'}} className="maxnamewidth150s">{record.total_duration}</span> <span style={{width: '150px'}} className="maxnamewidth150s"><a className="maxnamewidth150s" style={{
color:"#333333"
}} title={record.total_duration}>{record.total_duration}</a></span>
), ),
}, },
{ {
@ -76,7 +83,11 @@ class Videostatisticscomtwo extends Component {
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '100px'}} className="maxnamewidth100s">{record.feq}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.feq}>{record.feq}</a>
</span>
), ),
}, },
{ {
@ -87,7 +98,11 @@ 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', color: '#5091FF'}} className="xiaoshou">{record.start_at}</span> <span style={{width: '100px'}} >
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title= {record.start_at}> {record.start_at}</a>
</span>
), ),
}, },
{ {
@ -98,7 +113,11 @@ 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', color: '#5091FF'}} className="xiaoshou">{record.end_at}</span> <span style={{width: '100px'}} >
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title= {record.end_at}>{record.end_at}</a>
</span>
), ),
} }
], ],
@ -183,7 +202,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,
@ -385,7 +404,7 @@ class Videostatisticscomtwo extends Component {
<Menu> <Menu>
<Menu.Item> <Menu.Item>
<a onClick={() => this.setcourse_groups(null)}> <a onClick={() => this.setcourse_groups(null)}>
<p className="maxnamewidth200s">全部</p> <p className="maxnamewidth200yss">全部</p>
</a> </a>
</Menu.Item> </Menu.Item>
{ {
@ -395,7 +414,7 @@ class Videostatisticscomtwo extends Component {
return ( return (
<Menu.Item> <Menu.Item>
<a onClick={() => this.setcourse_groups(item.id)} key={key}> <a onClick={() => this.setcourse_groups(item.id)} key={key}>
<p className="maxnamewidth200s">{item.name}</p> <p className="maxnamewidth200yss">{item.name}</p>
</a> </a>
</Menu.Item> </Menu.Item>
) )
@ -409,7 +428,7 @@ class Videostatisticscomtwo extends Component {
return ( return (
<React.Fragment> <React.Fragment>
<div className="ws100s"> <div className="ws100s">
<div className="ws100s teacherentrydivs edu-back-white "> <div className="ws100s teacherentrydivss edu-back-white ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws50s sptits">视频名称视频名称</div> <div className="ws50s sptits">视频名称视频名称</div>
<div className="ws50s sptitss xaxisreverseorder font-14" style={{ <div className="ws50s sptitss xaxisreverseorder font-14" style={{
@ -452,15 +471,8 @@ class Videostatisticscomtwo extends Component {
` `
} }
</style> </style>
{
loading === true ? <div className="ws100s ysltableo mt10">
<div style={{
minHeight: "400px",
}} className="ws100s">
<LoadingSpin></LoadingSpin>
</div>
:
<div className="ws100s ysltableo teacherentrydivs">
{ {
data.length === 0 ? data.length === 0 ?
<div style={{ <div style={{
@ -469,17 +481,18 @@ class Videostatisticscomtwo extends Component {
<NoneDatas></NoneDatas> <NoneDatas></NoneDatas>
</div> </div>
: :
<Spin spinning={loading}>
<Table <Table
columns={columnsstu} columns={columnsstu}
dataSource={data} dataSource={data}
pagination={false} pagination={false}
onChange={this.table1handleChange} onChange={this.table1handleChange}
/> />
</Spin>
} }
</div> </div>
}
</div> </div>

@ -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 {Pagination,Table} from 'antd'; import {Pagination,Table,Spin} from 'antd';
import {getImageUrl,sortDirections} from 'educoder'; import {getImageUrl,sortDirections,formatSeconds} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import LoadingSpin from "../../../../common/LoadingSpin"; import LoadingSpin from "../../../../common/LoadingSpin";
import NoneDatas from "../../signin/component/NoneDatas"; import NoneDatas from "../../signin/component/NoneDatas";
@ -34,7 +34,12 @@ class Videostatisticslist extends Component {
className: 'font-14 maxnamewidth150s', className: 'font-14 maxnamewidth150s',
width: '150px', width: '150px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '150px'}} className="maxnamewidth150s">{record.title}</span> <span style={{width: '150px'}} className="maxnamewidth150s">
<a className="maxnamewidth150s" style={{
color:"#333333"
}} title={record.title}>{record.title}</a>
</span>
), ),
}, },
{ {
@ -55,12 +60,17 @@ class Videostatisticslist extends Component {
dataIndex: 'total_time', dataIndex: 'total_time',
key: 'total_time', key: 'total_time',
align: "center", align: "center",
className: 'font-14 maxnamewidth150s', className: 'font-14 maxnamewidth100s',
width: '150px', width: '100px',
sorter: true, sorter: true,
sortDirections: sortDirections, sortDirections: sortDirections,
render: (text, record) => ( render: (text, record) => (
<span style={{width: '150px'}} className="maxnamewidth150s">{record.total_time}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.total_time}>{record.total_time}</a>
</span>
), ),
}, },
{ {
@ -71,7 +81,12 @@ class Videostatisticslist 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">{record.user_name}</span> <span style={{width: '100px'}} className="maxnamewidth100s">
<a className="maxnamewidth100s" style={{
color:"#333333"
}} title={record.user_name}>{record.user_name}</a>
</span>
), ),
}, },
{ {
@ -80,16 +95,16 @@ class Videostatisticslist extends Component {
key: 'id', key: 'id',
align: "center", align: "center",
className: 'font-14', className: 'font-14',
width: '90px', width: '50px',
render: (text, record) => ( render: (text, record) => (
<span style={{width: '90px',color:'#5091FF'}} className="xiaoshou" onClick={()=>this.props.tisticsbools(true,record.id)}>详情</span> <span style={{width: '50px',color:'#5091FF'}} className="xiaoshou" onClick={()=>this.props.tisticsbools(true,record.id)}>详情</span>
), ),
} }
], ],
loading:false, loading:false,
data:[], data:[],
page:1, page:1,
limit:10, limit:20,
members_count:0, members_count:0,
order:undefined, order:undefined,
} }
@ -134,10 +149,10 @@ class Videostatisticslist extends Component {
let datalists = []; let datalists = [];
for (var i = 0; i < response.data.videos.length; i++) { for (var i = 0; i < response.data.videos.length; i++) {
datalists.push({ datalists.push({
number: (parseInt(this.state.spage) - 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,
}) })
@ -235,7 +250,7 @@ class Videostatisticslist extends Component {
<React.Fragment> <React.Fragment>
<div className="ws100s mt20"> <div className="ws100s mt20">
<div className="ws100s edu-back-white"> <div className="ws100s edu-back-white">
<div className="ws100s teacherentrydivs "> <div className="ws100s teacherentrydivss ">
<div className="ws100s sortinxdirection"> <div className="ws100s sortinxdirection">
<div className="ws100s sptits">统计详情</div> <div className="ws100s sptits">统计详情</div>
</div> </div>
@ -250,15 +265,8 @@ class Videostatisticslist extends Component {
` `
} }
</style> </style>
{
loading===true? <div className="ws100s ysltableo teacherentrydivs pdinstop0">
<div style={{
minHeight: "400px",
}} className="ws100s">
<LoadingSpin></LoadingSpin>
</div>
:
<div className="ws100s ysltableo teacherentrydivs">
{ {
data.length===0? data.length===0?
<div style={{ <div style={{
@ -267,6 +275,7 @@ class Videostatisticslist extends Component {
<NoneDatas></NoneDatas> <NoneDatas></NoneDatas>
</div> </div>
: :
<Spin spinning={loading}>
<Table <Table
columns={columnsstu} columns={columnsstu}
dataSource={data} dataSource={data}
@ -274,11 +283,11 @@ class Videostatisticslist extends Component {
onChange={this.table1handleChange} onChange={this.table1handleChange}
/> />
</Spin>
} }
</div> </div>
}
</div> </div>

@ -55,26 +55,30 @@ class AccountImg extends Component {
.newheadphotoblack{ .newheadphotoblack{
position: absolute; position: absolute;
top: 49px; top: 45px;
left: 4px; left: 0px;
text-align: center; text-align: center;
color: #fff; color: #fff;
width: 107px; width: 110px;
height: 23px; height: 23px;
line-height:23px; line-height: 23px;
background: rgba(76,172,255,0.7); background: rgba(76,172,255,0.7);
} }
.borderradiusbox{ .relativeRadiusbox{
border-top-left-radius: 4px; overflow: hidden;
border-top-right-radius: 4px; position: relative;
border-bottom-right-radius: 4px; width: 109px;
border-bottom-left-radius: 4px; border-radius: 50%;
} height: 109px;
}
`}</style> `}</style>
<img alt="头像" id="user_avatar_show" nhname="avatar_image" className={"xiaoshou"} src={`${picUrl}`} onClick={this.editImg} ></img> <div className={"relativeRadiusbox"}>
<div className="newheadphotoblack xiaoshou borderradiusbox" onClick={this.editImg} >修改头像</div> <img alt="头像" id="user_avatar_show" nhname="avatar_image" className={"xiaoshou"} src={`${picUrl}`} onClick={this.editImg} ></img>
<div className="newheadphotoblack xiaoshou" onClick={this.editImg} >修改头像</div>
</div>
</div> </div>
); );
} }

@ -74,7 +74,8 @@ function VideoInReviewItem (props) {
<div className="df buttonRow mb10"> <div className="df buttonRow mb10">
{/* <div className={"play_duration"}>累计学习时长:{play_duration} h</div> */} {/* <div className={"play_duration"}>累计学习时长:{play_duration} h</div> */}
{/* <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 ?<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>}
@ -82,7 +83,7 @@ function VideoInReviewItem (props) {
<div className="df buttonRow"> <div className="df buttonRow">
{/* 2019-09-01 10:00:22 */} {/* 2019-09-01 10:00:22 */}
<span className={"dianjilianicon"}> <span className={"dianjilianicon"}>
{!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>

Loading…
Cancel
Save