courseware
杨树林 5 years ago
parent a5ec23163c
commit 7080485c62

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

@ -41,7 +41,6 @@ class VideoIndex extends Component {
liveVisible: false,
statistics: false,
}
}
@ -75,13 +74,22 @@ class VideoIndex extends Component {
}
}
componentDidUpdate = (prevProps) => {
if (this.props.homedirectory !== prevProps.homedirectory) {
if(this.props.homedirectory ===true){
this.setState({
statistics:false,
})
}
}
if (this.props.match.params.videoId !== prevProps.match.params.videoId) {
this.setState({
upload: false
upload: false,
})
const {page} = this.state;
this.checkType("video", page);
}
}
// 获取直播列表
getLiveList = (page) => {
@ -239,9 +247,11 @@ class VideoIndex extends Component {
}
//统计
statisticsy = (bool) => {
this.setState({
statistics: bool
statistics: bool,
})
}
render() {
@ -311,16 +321,20 @@ class VideoIndex extends Component {
{
newOperation ?
<span>
<WordsBtn style="blue" className="ml30 font-16 tongjis"
onClick={() => this.statisticsy(true)}
><i className="iconfont icon-tongji1 mr5"></i></WordsBtn>
{
videoId ?
<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>
<span>
<WordsBtn style="blue" className="ml30 font-16 tongjis"
onClick={() => this.statisticsy(true)}
><i className="iconfont icon-tongji1 mr5"></i></WordsBtn>
<WordsBtn style="blue" className="ml30 font-16" onClick={this.addDir}>新建目录</WordsBtn>
</span>
}
<WordsBtn style="blue" className="ml30 font-16"
onClick={() => this.setLinkeVisible(true)}>增加外链</WordsBtn>

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

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

@ -347,7 +347,16 @@ class Coursesleftnav extends Component{
indexs:index
})
// 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)=>{
@ -359,6 +368,14 @@ class Coursesleftnav extends Component{
})
this.props.updataleftNavfun();
this.props.history.replace(urls);
try {
if(this.props.myinex===true){
this.props.Callhomedirectoryornot(true);
}
}catch (e) {
}
e.stopPropagation();//阻止冒泡
}
@ -885,6 +902,13 @@ class Coursesleftnav extends Component{
url:urls,
indexs:index
})
try {
if(this.props.myinex===true){
this.props.Callhomedirectoryornot(true);
}
}catch (e) {
}
this.props.history.replace(urls);
e.stopPropagation();//阻止冒泡
}

Loading…
Cancel
Save