|
|
|
@ -1,160 +1,208 @@
|
|
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import { SnackbarHOC } from 'educoder';
|
|
|
|
|
import { Route, Switch } from 'react-router-dom';
|
|
|
|
|
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
|
|
|
|
import { withRouter } from 'react-router'
|
|
|
|
|
import { Loadable } from 'educoder';
|
|
|
|
|
import Loading from '../../Loading';
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
import TPMIndexHOC from '../tpm/TPMIndexHOC';
|
|
|
|
|
import CNotificationHOC from './common/CNotificationHOC'
|
|
|
|
|
import TPMIndexHOC from '../tpm/TPMIndexHOC';
|
|
|
|
|
import CNotificationHOC from './common/CNotificationHOC'
|
|
|
|
|
import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC'
|
|
|
|
|
import "./css/Courses.css"
|
|
|
|
|
//引入对应跳转的组件
|
|
|
|
|
//里面有资源
|
|
|
|
|
const ListPageIndex = Loadable({
|
|
|
|
|
loader: () => import('./ListPageIndex'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
loader: () => import('./ListPageIndex'),
|
|
|
|
|
loading:Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//课堂首页
|
|
|
|
|
const CoursesHome = Loadable({
|
|
|
|
|
loader: () => import('./coursesHome/CoursesHome'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
loader: () => import('./coursesHome/CoursesHome'),
|
|
|
|
|
loading:Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//课堂详情页
|
|
|
|
|
const CoursesDetail = Loadable({
|
|
|
|
|
loader: () => import('./coursesDetail/CoursesDetail'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const CoursesDetail= Loadable({
|
|
|
|
|
loader: () => import('./coursesDetail/CoursesDetail'),
|
|
|
|
|
loading:Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 课堂讨论
|
|
|
|
|
const BoardIndex = Loadable({
|
|
|
|
|
loader: () => import('./BoardIndex'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
loader: () => import('./BoardIndex'),
|
|
|
|
|
loading:Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const GraduationTopicsDetail = Loadable({
|
|
|
|
|
loader: () => import('./graduation/topics/GraduateTopicDetail'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const GraduationTopics= Loadable({
|
|
|
|
|
loader: () => import('./graduation/topics'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const GraduateTopicPostWorksNew = Loadable({
|
|
|
|
|
loader: () => import('./graduation/topics/GraduateTopicPostWorksNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTopicsDetail= Loadable({
|
|
|
|
|
loader: () => import('./graduation/topics/GraduateTopicDetail'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const GraduateTopicNew = Loadable({
|
|
|
|
|
loader: () => import('./graduation/topics/GraduateTopicNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduateTopicPostWorksNew= Loadable({
|
|
|
|
|
loader: () => import('./graduation/topics/GraduateTopicPostWorksNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const GraduateTopicNew= Loadable({
|
|
|
|
|
loader: () => import('./graduation/topics/GraduateTopicNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const GraduationTasks= Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 资源
|
|
|
|
|
const Resourcelist= Loadable({
|
|
|
|
|
loader: () => import('./Resource/index'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//新建实训
|
|
|
|
|
const WrappedCoursesNewApp = Loadable({
|
|
|
|
|
loader: () => import('./new/CoursesNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const WrappedCoursesNewApp= Loadable({
|
|
|
|
|
loader: () => import('./new/CoursesNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//新建精品课堂
|
|
|
|
|
const WrappedCoursesNewAppGoldclass = Loadable({
|
|
|
|
|
const WrappedCoursesNewAppGoldclass= Loadable({
|
|
|
|
|
loader: () => import('./new/Goldsubject'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const ShixunHomeworkPage = Loadable({
|
|
|
|
|
const ShixunHomeworkPage =Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/ShixunHomeworkPage'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//实训作业
|
|
|
|
|
const ShixunHomework = Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/shixunHomework'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const ShixunHomework= Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/shixunHomework'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//实训作业设置
|
|
|
|
|
const Trainingjobsetting= Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/Trainingjobsetting'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//实训作业列表教师
|
|
|
|
|
|
|
|
|
|
// //实训作业列表学生未完成的
|
|
|
|
|
// const Studentnotcompleted= Loadable({
|
|
|
|
|
// loader: () => import('./shixunHomework/Listofworksstudentone'),
|
|
|
|
|
// loading: Loading,
|
|
|
|
|
// })
|
|
|
|
|
//实训作业列表完成的
|
|
|
|
|
const Studenthascompleted= Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/Listofworksstudentone'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//实训作业提交总结
|
|
|
|
|
const CommitSummary = Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/CommitSummary'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const CommitSummary = Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/CommitSummary'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//实训作业设置
|
|
|
|
|
const Workquestionandanswer= Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/Workquestionandanswer'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//实训报告
|
|
|
|
|
const ShixunWorkReport = Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/ShixunWorkReport'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const ShixunWorkReport= Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/ShixunWorkReport'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//实训查重
|
|
|
|
|
const ShixunStudentWork = Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/ShixunStudentWork'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const ShixunStudentWork= Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/ShixunStudentWork'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//实训查重详情
|
|
|
|
|
const ShixunWorkDetails = Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/ShixunWorkDetails'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const ShixunWorkDetails= Loadable({
|
|
|
|
|
loader: () => import('./shixunHomework/ShixunWorkDetails'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//问卷
|
|
|
|
|
const Poll = Loadable({
|
|
|
|
|
loader: () => import('./poll/Poll'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const Poll= Loadable({
|
|
|
|
|
loader: () => import('./poll/Poll'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//问卷新建
|
|
|
|
|
const PollNew = Loadable({
|
|
|
|
|
loader: () => import('./poll/PollNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const PollNew= Loadable({
|
|
|
|
|
loader: () => import('./poll/PollNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//问卷答题
|
|
|
|
|
const PollInfo = Loadable({
|
|
|
|
|
loader: () => import('./poll/PollInfo'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const PollInfo= Loadable({
|
|
|
|
|
loader: () => import('./poll/PollInfo'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//问卷详情
|
|
|
|
|
const PollDetail = Loadable({
|
|
|
|
|
loader: () => import('./poll/PollDetailIndex'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const PollDetail= Loadable({
|
|
|
|
|
loader: () => import('./poll/PollDetailIndex'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const Testpapersettinghomepage = Loadable({
|
|
|
|
|
loader: () => import('./exercise/Testpapersettinghomepage'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
|
|
|
|
//试卷
|
|
|
|
|
const Exercise= Loadable({
|
|
|
|
|
loader: () => import('./exercise/Exercise'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const ExerciseNew = Loadable({
|
|
|
|
|
loader: () => import('./exercise/ExerciseNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const Testpapersettinghomepage =Loadable({
|
|
|
|
|
loader: () => import('./exercise/Testpapersettinghomepage'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const ExerciseReviewAndAnswer = Loadable({
|
|
|
|
|
loader: () => import('./exercise/ExerciseReviewAndAnswer'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const ExerciseNew =Loadable({
|
|
|
|
|
loader: () => import('./exercise/ExerciseNew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const ExerciseReviewAndAnswer=Loadable({
|
|
|
|
|
loader:() => import('./exercise/ExerciseReviewAndAnswer'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//学生列表
|
|
|
|
|
const Studentshavecompletedthelist = Loadable({
|
|
|
|
|
loader: () => import('./exercise/Studentshavecompletedthelist'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const Studentshavecompletedthelist = Loadable({
|
|
|
|
|
loader: () => import('./exercise/Studentshavecompletedthelist'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//教师列表
|
|
|
|
|
const TeacherList = Loadable({
|
|
|
|
|
loader: () => import('./members/teacherList'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const TeacherList= Loadable({
|
|
|
|
|
loader: () => import('./members/teacherList'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
//学生列表
|
|
|
|
|
const StudentsList = Loadable({
|
|
|
|
|
loader: () => import('./members/studentsList'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const StudentsList= Loadable({
|
|
|
|
|
loader: () => import('./members/studentsList'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//普通作业
|
|
|
|
|
const CommonWork = Loadable({
|
|
|
|
|
loader: () => import('./busyWork/Index'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const CommonWork= Loadable({
|
|
|
|
|
loader: () => import('./busyWork/Index'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
const GroupWork = Loadable({
|
|
|
|
|
loader: () => import('./busyWork/IndexGroup'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GroupWork= Loadable({
|
|
|
|
|
loader: () => import('./busyWork/IndexGroup'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
@ -165,150 +213,149 @@ const GroupWork = Loadable({
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
//毕设任务列表新建
|
|
|
|
|
const GraduationTaskseditApp = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksedit'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTaskseditApp= Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksedit'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//毕设任务列表编辑
|
|
|
|
|
const GraduationTasksnewApp = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksnew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTasksnewApp= Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksnew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//毕设任务列表设置
|
|
|
|
|
const GraduationTasksquestions = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTaskssettingquestions'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTasksquestions= Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTaskssettingquestions'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//毕设任务列表
|
|
|
|
|
|
|
|
|
|
const GraduationTaskssettinglist = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTaskDetail'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTaskssettinglist= Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTaskDetail'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//毕业任务设置
|
|
|
|
|
|
|
|
|
|
const GraduationTaskssetting = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTaskssetting'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTaskssetting=Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTaskssetting'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 评阅列表
|
|
|
|
|
|
|
|
|
|
const GraduationTasksappraise = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksappraise'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTasksappraise=Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksappraise'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//创建作品
|
|
|
|
|
|
|
|
|
|
const GraduationTasksSubmitnewApp = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksSubmitnew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTasksSubmitnewApp=Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksSubmitnew'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//修改作品
|
|
|
|
|
|
|
|
|
|
const GraduationTasksSubmiteditApp = Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksSubmitedit'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const GraduationTasksSubmiteditApp=Loadable({
|
|
|
|
|
loader: () => import('./graduation/tasks/GraduationTasksSubmitedit'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//排序
|
|
|
|
|
const Ordering = Loadable({
|
|
|
|
|
loader: () => import('../../modules/courses/ordering/Ordering'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
const Ordering=Loadable({
|
|
|
|
|
loader: () => import('../../modules/courses/ordering/Ordering'),
|
|
|
|
|
loading: Loading,
|
|
|
|
|
});
|
|
|
|
|
class CoursesIndex extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
coursesids: undefined,
|
|
|
|
|
coursesidsfun: this.coursesidsfun,
|
|
|
|
|
updataleftNavfun: this.updataleftNav,
|
|
|
|
|
course_modules: undefined,
|
|
|
|
|
hidden_modules: [],
|
|
|
|
|
is_teacher: false,
|
|
|
|
|
isaloadtype: true,
|
|
|
|
|
coursesidtype: undefined,
|
|
|
|
|
locationNavfun: this.locationNav,
|
|
|
|
|
unlocationNavfun: this.unlocationNavfun
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
coursesidsfun = (id, type) => {
|
|
|
|
|
this.setState({
|
|
|
|
|
coursesids: id,
|
|
|
|
|
coursesidtype: type
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
// this.updataleftNav()
|
|
|
|
|
this.historyArray = [window.location.pathname];
|
|
|
|
|
|
|
|
|
|
this.props.history.listen(location => {
|
|
|
|
|
this.historyArray.unshift(window.location.pathname);
|
|
|
|
|
this.historyArray.length = 2;
|
|
|
|
|
//Do your stuff here
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//更新左边课堂导航
|
|
|
|
|
updataleftNav = () => {
|
|
|
|
|
let query = this.props.location.pathname
|
|
|
|
|
let { isaloadtype } = this.state;
|
|
|
|
|
let types = isaloadtype === false ? true : false
|
|
|
|
|
const type = query.split('/');
|
|
|
|
|
let id = parseInt(type[2])
|
|
|
|
|
if (isNaN(id)) {
|
|
|
|
|
return
|
|
|
|
|
class CoursesIndex extends Component{
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props)
|
|
|
|
|
this.state={
|
|
|
|
|
coursesids: undefined,
|
|
|
|
|
coursesidsfun:this.coursesidsfun,
|
|
|
|
|
updataleftNavfun:this.updataleftNav,
|
|
|
|
|
course_modules:undefined,
|
|
|
|
|
hidden_modules:[],
|
|
|
|
|
is_teacher:false,
|
|
|
|
|
isaloadtype:true,
|
|
|
|
|
coursesidtype:undefined,
|
|
|
|
|
locationNavfun:this.locationNav,
|
|
|
|
|
unlocationNavfun:this.unlocationNavfun
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const querys = this.props.location.search;
|
|
|
|
|
var dataqueryss = {}
|
|
|
|
|
try {
|
|
|
|
|
var foqus = this.foo(querys);
|
|
|
|
|
if (JSON.stringify(foqus) === "{}") {
|
|
|
|
|
this.setState({
|
|
|
|
|
dataquerys: {},
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
coursesidsfun=(id,type)=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
dataquerys: foqus,
|
|
|
|
|
});
|
|
|
|
|
dataqueryss = foqus;
|
|
|
|
|
}
|
|
|
|
|
} catch (e) {
|
|
|
|
|
this.setState({
|
|
|
|
|
dataquerys: {},
|
|
|
|
|
})
|
|
|
|
|
coursesids:id,
|
|
|
|
|
coursesidtype:type
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
// let id=this.props.match.params.coursesId;
|
|
|
|
|
let url = "/courses/" + id + "/left_banner.json"
|
|
|
|
|
axios.get(url,
|
|
|
|
|
{
|
|
|
|
|
params:
|
|
|
|
|
dataqueryss
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if (response != undefined) {
|
|
|
|
|
if (response.data && response.data) {
|
|
|
|
|
|
|
|
|
|
componentDidMount(){
|
|
|
|
|
// this.updataleftNav()
|
|
|
|
|
this.historyArray = [window.location.pathname];
|
|
|
|
|
|
|
|
|
|
this.props.history.listen( location => {
|
|
|
|
|
this.historyArray.unshift(window.location.pathname);
|
|
|
|
|
this.historyArray.length = 2;
|
|
|
|
|
//Do your stuff here
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//更新左边课堂导航
|
|
|
|
|
updataleftNav=()=>{
|
|
|
|
|
let query=this.props.location.pathname
|
|
|
|
|
let {isaloadtype}=this.state;
|
|
|
|
|
let types=isaloadtype===false?true:false
|
|
|
|
|
const type = query.split('/');
|
|
|
|
|
let id=parseInt(type[2])
|
|
|
|
|
if(isNaN(id)){
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const querys = this.props.location.search;
|
|
|
|
|
var dataqueryss={}
|
|
|
|
|
try {
|
|
|
|
|
var foqus=this.foo(querys);
|
|
|
|
|
if(JSON.stringify(foqus) ==="{}"){
|
|
|
|
|
this.setState({
|
|
|
|
|
course_modules: response.data.course_modules,
|
|
|
|
|
hidden_modules: response.data.hidden_modules,
|
|
|
|
|
is_teacher: response.data.is_teacher,
|
|
|
|
|
isaloadtype: types
|
|
|
|
|
})
|
|
|
|
|
this.locationNav(response.data.course_modules)
|
|
|
|
|
dataquerys:{},
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
this.setState({
|
|
|
|
|
dataquerys:foqus,
|
|
|
|
|
});
|
|
|
|
|
dataqueryss=foqus;
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
this.setState({
|
|
|
|
|
dataquerys:{},
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
foo = (url) => {
|
|
|
|
|
// let id=this.props.match.params.coursesId;
|
|
|
|
|
let url ="/courses/"+id+"/left_banner.json"
|
|
|
|
|
axios.get(url,
|
|
|
|
|
{params:
|
|
|
|
|
dataqueryss
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if(response!=undefined){
|
|
|
|
|
if(response.data&&response.data){
|
|
|
|
|
this.setState({
|
|
|
|
|
course_modules:response.data.course_modules,
|
|
|
|
|
hidden_modules:response.data.hidden_modules,
|
|
|
|
|
is_teacher:response.data.is_teacher,
|
|
|
|
|
isaloadtype:types
|
|
|
|
|
})
|
|
|
|
|
this.locationNav(response.data.course_modules)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
};
|
|
|
|
|
foo=(url)=> {
|
|
|
|
|
var json = {};
|
|
|
|
|
var regExp = /[\?\&](\w+)(=?)(\w*)/g;
|
|
|
|
|
var arr;
|
|
|
|
@ -330,43 +377,45 @@ class CoursesIndex extends Component {
|
|
|
|
|
return json;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
locationNav = (list) => {
|
|
|
|
|
if (list) {
|
|
|
|
|
let url = this.props.location.pathname;
|
|
|
|
|
const type = url.split('/');
|
|
|
|
|
let filesId = parseInt(type[4]);
|
|
|
|
|
// let urls=this.props.match.url
|
|
|
|
|
locationNav=(list)=>{
|
|
|
|
|
if(list){
|
|
|
|
|
let url=this.props.location.pathname;
|
|
|
|
|
const type = url.split('/');
|
|
|
|
|
let filesId=parseInt(type[4]);
|
|
|
|
|
// let urls=this.props.match.url
|
|
|
|
|
|
|
|
|
|
var lists = list;
|
|
|
|
|
var lists=list;
|
|
|
|
|
|
|
|
|
|
lists.forEach((item, index) => {
|
|
|
|
|
lists.forEach((item,index)=>{
|
|
|
|
|
|
|
|
|
|
if (url === item.category_url) {
|
|
|
|
|
this.setState({
|
|
|
|
|
indexs: index,
|
|
|
|
|
mainurl: item.category_url
|
|
|
|
|
})
|
|
|
|
|
this.coursesidsfun(item.id, "node")
|
|
|
|
|
} else {
|
|
|
|
|
if (item.second_category != undefined && item.second_category.length != 0) {
|
|
|
|
|
item.second_category.forEach((iem, key) => {
|
|
|
|
|
if (url === iem.second_category_url) {
|
|
|
|
|
|
|
|
|
|
if (parseInt(filesId) === iem.category_id || parseInt(filesId) === item.id) {
|
|
|
|
|
this.setState({
|
|
|
|
|
indexs: index,
|
|
|
|
|
url: url,
|
|
|
|
|
mainurl: item.category_url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.coursesidsfun(item.id, "child")
|
|
|
|
|
}
|
|
|
|
|
if(url===item.category_url){
|
|
|
|
|
this.setState({
|
|
|
|
|
indexs:index,
|
|
|
|
|
mainurl:item.category_url
|
|
|
|
|
})
|
|
|
|
|
this.coursesidsfun(item.id,"node")
|
|
|
|
|
}else{
|
|
|
|
|
if(item.second_category!=undefined&&item.second_category.length!=0){
|
|
|
|
|
item.second_category.forEach((iem,key)=>{
|
|
|
|
|
if(url===iem.second_category_url){
|
|
|
|
|
|
|
|
|
|
if( parseInt(filesId)===iem.category_id||parseInt(filesId)===item.id){
|
|
|
|
|
this.setState({
|
|
|
|
|
indexs:index,
|
|
|
|
|
url:url,
|
|
|
|
|
mainurl:item.category_url
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.coursesidsfun(item.id,"child")
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unlocationNavfun=(val)=>{
|
|
|
|
@ -525,13 +574,6 @@ class CoursesIndex extends Component {
|
|
|
|
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
|
|
|
|
|
}></Route>
|
|
|
|
|
|
|
|
|
|
{/*————————————————————————————————————————————————————————————————————————————————————*/}
|
|
|
|
|
{/* 作品评阅 https://www.trustie.net/issues/19981 */}
|
|
|
|
|
<Route path="/classrooms/:coursesId/graduation_tasks/:category_id/appraise"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/*————————————————————————————————————————————————————————————————————————————————————*/}
|
|
|
|
|
{/* 作品评阅 https://www.trustie.net/issues/19981 */}
|
|
|
|
@ -555,7 +597,7 @@ class CoursesIndex extends Component {
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/* 设置毕设任务 https://www.trustie.net/issues/19981 */}
|
|
|
|
|
{/* 设置毕设任务 https://www.trustie.net/issues/19981 */}
|
|
|
|
|
|
|
|
|
|
{/* <Route path="/classrooms/:coursesId/graduation_tasks/:category_id/:task_Id/setting"
|
|
|
|
|
render={
|
|
|
|
@ -584,12 +626,6 @@ class CoursesIndex extends Component {
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/* 修改毕设任务 https://www.trustie.net/issues/19981 */}
|
|
|
|
|
<Route path="/courses/:coursesId/graduation_tasks/:category_id/edit"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/* 新建毕设任务 https://www.trustie.net/issues/19981 */}
|
|
|
|
|
<Route path="/classrooms/:coursesId/graduation_tasks/:category_id/new"
|
|
|
|
@ -598,12 +634,6 @@ class CoursesIndex extends Component {
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/* 新建毕设任务 https://www.trustie.net/issues/19981 */}
|
|
|
|
|
<Route path="/courses/:coursesId/graduation_tasks/:category_id/new"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
|
|
|
|
|
<Route path="/classrooms/:coursesId/graduation_tasks/:Id" exact
|
|
|
|
@ -735,24 +765,6 @@ class CoursesIndex extends Component {
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/* 问卷新建 */}
|
|
|
|
|
<Route path="/classrooms/:coursesId/polls/:pollid/:news"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<PollNew {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*/!* 问卷编辑 *!/*/}
|
|
|
|
|
{/*<Route path="/classrooms/:coursesId/polls/:pollid/:news"*/}
|
|
|
|
|
{/*render={*/}
|
|
|
|
|
{/*(props) => (<PollNew {...this.props} {...props} {...this.state} {...common} />)*/}
|
|
|
|
|
{/*}*/}
|
|
|
|
|
{/*></Route>*/}
|
|
|
|
|
{/* 问卷 */}
|
|
|
|
|
<Route path="/classrooms/:coursesId/polls/:Id"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/* 试卷查看/评阅 */}
|
|
|
|
|
<Route exact path="/classrooms/:coursesId/exercises/:Id/users/:userId"
|
|
|
|
@ -774,18 +786,7 @@ class CoursesIndex extends Component {
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/*试卷新建 */}
|
|
|
|
|
<Route exact path="/classrooms/:coursesId/exercises/new"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*试卷新建 */}
|
|
|
|
|
<Route exact path="/classrooms/:coursesId/exercises/:Id/edit"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*试卷设置主页*/}
|
|
|
|
|
|
|
|
|
|
<Route path="/classrooms/:coursesId/exercises/:Id/student_exercise_list"
|
|
|
|
|
render={
|
|
|
|
@ -793,11 +794,6 @@ class CoursesIndex extends Component {
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
<Route path="/classrooms/:coursesId/exercises/:Id/student_exercise_list"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/*学生完成列表*/}
|
|
|
|
|
<Route
|
|
|
|
@ -967,32 +963,7 @@ class CoursesIndex extends Component {
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/*新建课堂*/}
|
|
|
|
|
<Route path="/classrooms/new"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*新建精品课堂*/}
|
|
|
|
|
{/*coursesId 课堂id */}
|
|
|
|
|
{/*id 是否是私有或者公有*/}
|
|
|
|
|
<Route path="/classrooms/news/:subjectid/newgold/:id"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*修改精品课堂*/}
|
|
|
|
|
<Route path="/classrooms/:coursesId/newgolds/settings"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*修改课堂*/}
|
|
|
|
|
<Route path="/classrooms/:coursesId/settings"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*课堂统计列表2019.10.29 */}
|
|
|
|
|
|
|
|
|
|
<Route path="/classrooms/:coursesId/statistics"
|
|
|
|
|
render={
|
|
|
|
@ -1022,30 +993,9 @@ class CoursesIndex extends Component {
|
|
|
|
|
></Route>
|
|
|
|
|
{/*<Route exact path="/classrooms" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/}
|
|
|
|
|
|
|
|
|
|
<Route path="/classrooms/:coursesId/statistics"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/*/!*实训作业and课堂详情页*!/*/}
|
|
|
|
|
<Route path="/classrooms/:coursesId"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
{/*课堂首页*/}
|
|
|
|
|
<Route path="/classrooms"
|
|
|
|
|
render={
|
|
|
|
|
(props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
}
|
|
|
|
|
></Route>
|
|
|
|
|
{/*<Route exact path="/classrooms" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/}
|
|
|
|
|
|
|
|
|
|
</Switch>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
</Switch>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default withRouter(ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) ))));
|
|
|
|
|