From 7080485c62b962580bd92e00e0dfa1825206c45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 17 Mar 2020 00:03:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/ListPageIndex.js | 40 +++- .../src/modules/courses/Video/VideoIndex.js | 28 ++- .../courses/common/CourseLayoutComponent.js | 156 ++++++------- .../courses/coursesDetail/CoursesDetail.js | 211 +++++++++--------- .../courses/coursesDetail/CoursesLeftNav.js | 26 ++- 5 files changed, 258 insertions(+), 203 deletions(-) diff --git a/public/react/src/modules/courses/ListPageIndex.js b/public/react/src/modules/courses/ListPageIndex.js index 6743cc3f7..628ee17e8 100644 --- a/public/react/src/modules/courses/ListPageIndex.js +++ b/public/react/src/modules/courses/ListPageIndex.js @@ -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*/}
- this.comyslElearning(i)}/> + this.comyslElearning(i)} myinex={true} Callhomedirectoryornot={(b)=>this.Callhomedirectoryornot(b)}/>
{/*right_concent*/} @@ -261,16 +277,16 @@ class ListPageIndex extends Component{ } > {/*视频列表*/} - () - } - > - () - } - > + () + } + > + () + } + > {/* 教师列表*/} { + 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 ? - this.statisticsy(true)} - >统计 { videoId ? this.editDir(videoData && videoData.category_name, videoId)} className={"ml30 font-16"}>目录重命名 : - 新建目录 + + + this.statisticsy(true)} + >统计 + 新建目录 + + } this.setLinkeVisible(true)}>增加外链 diff --git a/public/react/src/modules/courses/common/CourseLayoutComponent.js b/public/react/src/modules/courses/common/CourseLayoutComponent.js index c88bd8798..80bff60cd 100644 --- a/public/react/src/modules/courses/common/CourseLayoutComponent.js +++ b/public/react/src/modules/courses/common/CourseLayoutComponent.js @@ -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 ( -
-
- {/*头部banner*/} - - -
- -
-
-
-
-
- - {/*left_nav*/} -
- -
- - {/*right_concent*/} -
-
- {childrenWithProps} -
-
- -
-
-
-
-
- -
-
-
- ) - } -} -export default CourseLayoutcomponent; \ No newline at end of file +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 ( +
+
+ {/*头部banner*/} + + +
+ +
+
+
+
+
+ + {/*left_nav*/} +
+ +
+ + {/*right_concent*/} +
+
+ {childrenWithProps} +
+
+ +
+
+
+
+
+ +
+
+
+ ) + } +} +export default CourseLayoutcomponent; diff --git a/public/react/src/modules/courses/coursesDetail/CoursesDetail.js b/public/react/src/modules/courses/coursesDetail/CoursesDetail.js index 8a5519d2e..0c7e49f00 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesDetail.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesDetail.js @@ -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 ( -
-
- {/*头部banner*/} - - -
- -
-
-
-
-
- - {/*left_nav*/} -
- -
- - {/*right_concent*/} -
-
- {/* 毕设选题 */} - {getleftNavid==="graduation"?:""} - - {/*/!*普通作业*!/*/} - {/*{getleftNavid==="common_homework"?:""}*/} - - - {/*{getleftNavid==="shixun_homeworkchild"?:""}*/} - - - {/*/!*问卷*!/*/} - {/*{getleftNavid==="poll"?:""}*/} - {/*/!*试卷*!/*/} - {/*{getleftNavid==="exercise"?:""}*/} - - -
-
- -
-
-
-
-
- -
-
-
- ) - } -} -export default CoursesDetail; \ No newline at end of file +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 ( +
+
+ {/*头部banner*/} + + +
+ +
+
+
+
+
+ + {/*left_nav*/} +
+ +
+ + {/*right_concent*/} +
+
+ {/* 毕设选题 */} + {getleftNavid==="graduation"?:""} + + {/*/!*普通作业*!/*/} + {/*{getleftNavid==="common_homework"?:""}*/} + + + {/*{getleftNavid==="shixun_homeworkchild"?:""}*/} + + + {/*/!*问卷*!/*/} + {/*{getleftNavid==="poll"?:""}*/} + {/*/!*试卷*!/*/} + {/*{getleftNavid==="exercise"?:""}*/} + + +
+
+ +
+
+
+
+
+ +
+
+
+ ) + } +} +export default CoursesDetail; diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 1c53a1efb..409b3bd6c 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -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();//阻止冒泡 } From bc4d06eee56ada0af80ca7fca97c4be2043f7c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 17 Mar 2020 00:24:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E7=AD=BE=E5=88=B0=20=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=20=E7=82=B9=E5=87=BB=E7=9B=AE=E5=BD=95=20?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/Video/VideoIndex.js | 15 ++++++++++----- .../src/modules/courses/signin/css/signincdi.css | 11 +++++++++++ .../courses/signin/teacher/Teachers_signin.js | 12 +++++++++++- .../component/Videostatisticscomtwo.js | 6 +++--- .../component/Videostatisticslist.js | 2 +- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js index d1ac45fe1..d8e600f4c 100644 --- a/public/react/src/modules/courses/Video/VideoIndex.js +++ b/public/react/src/modules/courses/Video/VideoIndex.js @@ -74,13 +74,18 @@ class VideoIndex extends Component { } } componentDidUpdate = (prevProps) => { - if (this.props.homedirectory !== prevProps.homedirectory) { - if(this.props.homedirectory ===true){ - this.setState({ - statistics:false, - }) + try { + if (this.props.homedirectory !== prevProps.homedirectory) { + if(this.props.homedirectory ===true){ + this.setState({ + statistics:false, + }) + } } + }catch (e) { + } + if (this.props.match.params.videoId !== prevProps.match.params.videoId) { this.setState({ upload: false, diff --git a/public/react/src/modules/courses/signin/css/signincdi.css b/public/react/src/modules/courses/signin/css/signincdi.css index bd45185b9..a7fbbb20a 100644 --- a/public/react/src/modules/courses/signin/css/signincdi.css +++ b/public/react/src/modules/courses/signin/css/signincdi.css @@ -188,6 +188,9 @@ padding-top: 20px; padding-bottom: 20px; } +.pdinstop0{ + padding-top: 0px !important; +} .teacherentrydivss{ padding-left: 20px; padding-right: 20px; @@ -414,6 +417,14 @@ white-space:nowrap; cursor: default; } +.maxnamewidth200yss{ + text-align: center; + max-width:200px; + overflow:hidden; + text-overflow:ellipsis; + white-space:nowrap; + cursor: default; +} .maxnamewidth100s{ width: 100px; max-width: 100px; diff --git a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js index bda49fa6a..7d814ac47 100644 --- a/public/react/src/modules/courses/signin/teacher/Teachers_signin.js +++ b/public/react/src/modules/courses/signin/teacher/Teachers_signin.js @@ -49,6 +49,7 @@ class Students_signin extends Component{ page:1, limit:5 } + this.gogetdatas(data); // const query = this.props.location.search; @@ -58,8 +59,17 @@ class Students_signin extends Component{ } componentDidUpdate = (prevProps) => { + try { + if (this.props.homedirectory !== prevProps.homedirectory) { + if(this.props.homedirectory ===true){ + this.setState({ + switchs:false, + }) + } + } + }catch (e) { - + } } callback=(key)=> { diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js index d7773b523..637a2a0fd 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js @@ -404,7 +404,7 @@ class Videostatisticscomtwo extends Component { this.setcourse_groups(null)}> -

全部

+

全部

{ @@ -414,7 +414,7 @@ class Videostatisticscomtwo extends Component { return ( this.setcourse_groups(item.id)} key={key}> -

{item.name}

+

{item.name}

) @@ -472,7 +472,7 @@ class Videostatisticscomtwo extends Component { } -
+
{ data.length === 0 ?
-
+
{ data.length===0?