You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
101 lines
3.4 KiB
101 lines
3.4 KiB
import React, { Component } from 'react';
|
|
import { SnackbarHOC } from 'educoder';
|
|
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
|
import Loadable from 'react-loadable';
|
|
import Loading from '../../Loading';
|
|
import axios from 'axios';
|
|
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
|
import { CNotificationHOC } from './common/CNotificationHOC'
|
|
import "./css/Courses.css"
|
|
//引入对应跳转的组件
|
|
const ListPageIndex = Loadable({
|
|
loader: () => import('./ListPageIndex'),
|
|
loading:Loading,
|
|
})
|
|
// 讨论
|
|
const BoardsNew= Loadable({
|
|
loader: () => import('./boards/BoardsNew'),
|
|
loading: Loading,
|
|
})
|
|
const TopicDetail= Loadable({
|
|
loader: () => import('./boards/TopicDetail'),
|
|
loading: Loading,
|
|
})
|
|
|
|
// 讨论
|
|
const Boards= Loadable({
|
|
loader: () => import('./boards'),
|
|
loading: Loading,
|
|
})
|
|
|
|
|
|
class CoursesIndex extends Component{
|
|
constructor(props) {
|
|
super(props)
|
|
this.state={
|
|
// coursedata:undefined
|
|
}
|
|
}
|
|
|
|
componentDidMount(){
|
|
|
|
}
|
|
render() {
|
|
const common = {
|
|
|
|
}
|
|
|
|
return (
|
|
<Switch {...this.props}>
|
|
|
|
{/*课堂讨论*/}
|
|
{/* /board/5464/messages/new */}
|
|
{/* <Route exact path="/classrooms/:coursesId/board/:boardId/messages/:topicId/edit"
|
|
render={
|
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
|
}
|
|
></Route>
|
|
|
|
<Route exact path="/classrooms/:coursesId/board/:boardId/messages/new" component={BoardsNew}
|
|
render={
|
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
|
}
|
|
></Route> */}
|
|
|
|
|
|
|
|
|
|
{/*课堂讨论*/}
|
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/:topicId/edit"
|
|
render={
|
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
|
}
|
|
></Route>
|
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/new"
|
|
render={
|
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
|
}
|
|
></Route>
|
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/:topicId"
|
|
render={
|
|
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
|
|
}
|
|
></Route>
|
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/:topicId"
|
|
render={
|
|
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
|
|
}
|
|
></Route>
|
|
<Route exact path="/classrooms/:coursesId/boards/:boardId"
|
|
render={
|
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
|
|
}
|
|
></Route>
|
|
|
|
</Switch>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default CNotificationHOC() ( SnackbarHOC() ( (CoursesIndex) ));
|