diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index fee6eb724..332e8ea73 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,11 +42,11 @@ if (isDev) { window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } // 超管 -debugType="admin"; +// debugType="admin"; // 老师 // debugType="teacher"; // 学生 -// debugType="student"; +debugType="student"; diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js index e2b3a0841..d808ee787 100644 --- a/public/react/src/modules/courses/Video/VideoIndex.js +++ b/public/react/src/modules/courses/Video/VideoIndex.js @@ -12,7 +12,7 @@ import Videostatistics from '../videostatistics/Videostatistics'; import './video.css'; import '../css/Courses.css'; import '../publicNav/nav.css'; - +import Videostatisticscomtwo from '../videostatistics/component/Videostatisticscomtwo'; const PAGE_SIZE = 15; const LIVE_PAGE_SIZE = 10; const $ = window.$; @@ -378,7 +378,12 @@ class VideoIndex extends Component { : - this.statisticsy(b)}> + ( + isAdmin? + this.statisticsy(b)}> + : + + ) } { statistics === false ? diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js index 637a2a0fd..51673aa38 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticscomtwo.js @@ -126,6 +126,7 @@ class Videostatisticscomtwo extends Component { course_groups: [], fbbool: false, groupsid: null, + none_group_member_count:0, } } @@ -164,9 +165,9 @@ class Videostatisticscomtwo extends Component { let url = `/courses/${CourseId}/course_groups.json`; axios.get(url).then((response) => { if (response) { - console.log("分班"); - console.log("response"); - console.log(response); + // console.log("分班"); + // console.log("response"); + // console.log(response); this.setState({ course_groups: response.data.course_groups, current_group_id: response.data.current_group_id, @@ -202,7 +203,7 @@ class Videostatisticscomtwo extends Component { number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1), user_name: response.data.data[i].user_name, is_finished: response.data.data[i].is_finished, - total_duration: response.data.data[i].total_duration?formatSeconds(response.data.data[i].total_duration):0, + total_duration: response.data.data[i].total_duration, feq: response.data.data[i].feq, start_at: response.data.data[i].start_at, end_at: response.data.data[i].end_at, @@ -398,7 +399,7 @@ class Videostatisticscomtwo extends Component { render() { let {loading, data, page, limit, members_count, columnsstu, fbbool, course_groups} = this.state; - const isAdmin = this.props.isAdmin(); + const isAdmin = this.props&& this.props.isAdmin(); const menu = ( @@ -423,6 +424,16 @@ class Videostatisticscomtwo extends Component { : "" } + { + this.state.none_group_member_count&&this.state.none_group_member_count>0? + + this.setcourse_groups(0)}> +

未分班

+
+
+ : + "" + }
); return ( @@ -435,9 +446,14 @@ class Videostatisticscomtwo extends Component { color: "#5091FF", lineHeight: "42px", }}> -
this.props.tisticsbools(false, null)}> - 视频统计总览 -
+ { + isAdmin === true ? +
this.props.tisticsbools(false, null)}> + 视频统计总览 +
+ :"" + } + { isAdmin === true ?
this.fenbanone()}> diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js index 4a0667e5b..7fe655aeb 100644 --- a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js +++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js @@ -152,7 +152,7 @@ class Videostatisticslist extends Component { number: (parseInt(this.state.page) - 1) * parseInt(this.state.limit) + (i + 1), title: response.data.videos[i].title, people_num: response.data.videos[i].people_num, - total_time: response.data.videos[i].total_time?formatSeconds(response.data.videos[i].total_time):0, + total_time: response.data.videos[i].total_time, user_name: response.data.videos[i].user_name, id: response.data.videos[i].id, })