parent
54226bdf66
commit
8d6aee1f1d
@ -1,100 +1,100 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { SnackbarHOC } from 'educoder';
|
import { SnackbarHOC } from 'educoder';
|
||||||
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
||||||
import Loadable from 'react-loadable';
|
import Loadable from 'react-loadable';
|
||||||
import Loading from '../../Loading';
|
import Loading from '../../Loading';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
||||||
import { CNotificationHOC } from './common/CNotificationHOC'
|
import { CNotificationHOC } from './common/CNotificationHOC'
|
||||||
import "./css/Courses.css"
|
import "./css/Courses.css"
|
||||||
//引入对应跳转的组件
|
//引入对应跳转的组件
|
||||||
const ListPageIndex = Loadable({
|
const ListPageIndex = Loadable({
|
||||||
loader: () => import('./ListPageIndex'),
|
loader: () => import('./ListPageIndex'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
// 讨论
|
// 讨论
|
||||||
const BoardsNew= Loadable({
|
const BoardsNew= Loadable({
|
||||||
loader: () => import('./boards/BoardsNew'),
|
loader: () => import('./boards/BoardsNew'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
const TopicDetail= Loadable({
|
const TopicDetail= Loadable({
|
||||||
loader: () => import('./boards/TopicDetail'),
|
loader: () => import('./boards/TopicDetail'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
// 讨论
|
// 讨论
|
||||||
const Boards= Loadable({
|
const Boards= Loadable({
|
||||||
loader: () => import('./boards'),
|
loader: () => import('./boards'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
class CoursesIndex extends Component{
|
class CoursesIndex extends Component{
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state={
|
this.state={
|
||||||
// coursedata:undefined
|
// coursedata:undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount(){
|
componentDidMount(){
|
||||||
|
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const common = {
|
const common = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
|
|
||||||
{/*课堂讨论*/}
|
{/*课堂讨论*/}
|
||||||
{/* /board/5464/messages/new */}
|
{/* /board/5464/messages/new */}
|
||||||
{/* <Route exact path="/courses/:coursesId/board/:boardId/messages/:topicId/edit"
|
{/* <Route exact path="/classrooms/:coursesId/board/:boardId/messages/:topicId/edit"
|
||||||
render={
|
render={
|
||||||
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
<Route exact path="/courses/:coursesId/board/:boardId/messages/new" component={BoardsNew}
|
<Route exact path="/classrooms/:coursesId/board/:boardId/messages/new" component={BoardsNew}
|
||||||
render={
|
render={
|
||||||
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route> */}
|
></Route> */}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{/*课堂讨论*/}
|
{/*课堂讨论*/}
|
||||||
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId/edit"
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/:topicId/edit"
|
||||||
render={
|
render={
|
||||||
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/boards/:boardId/messages/new"
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/:topicId"
|
||||||
render={
|
render={
|
||||||
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
|
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
|
<Route exact path="/classrooms/:coursesId/boards/:boardId/messages/:topicId"
|
||||||
render={
|
render={
|
||||||
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
|
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/boards/:boardId"
|
<Route exact path="/classrooms/:coursesId/boards/:boardId"
|
||||||
render={
|
render={
|
||||||
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
</Switch>
|
</Switch>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CNotificationHOC() ( SnackbarHOC() ( (CoursesIndex) ));
|
export default CNotificationHOC() ( SnackbarHOC() ( (CoursesIndex) ));
|
||||||
|
@ -1,66 +1,66 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
|
||||||
export function RouteHOC(options = {}) {
|
export function RouteHOC(options = {}) {
|
||||||
return function wrap(WrappedComponent) {
|
return function wrap(WrappedComponent) {
|
||||||
return class Wrapper extends Component {
|
return class Wrapper extends Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
toDetailPage = (_courseId, boardId, topicId) => {
|
toDetailPage = (_courseId, boardId, topicId) => {
|
||||||
if (typeof _courseId == "object") {
|
if (typeof _courseId == "object") {
|
||||||
const topicId = _courseId.topicId
|
const topicId = _courseId.topicId
|
||||||
const boardId = _courseId.boardId
|
const boardId = _courseId.boardId
|
||||||
const courseId = _courseId.coursesId
|
const courseId = _courseId.coursesId
|
||||||
this.props.history.push(`/courses/${courseId}/boards/${boardId}/messages/${topicId}`)
|
this.props.history.push(`/classrooms/${courseId}/boards/${boardId}/messages/${topicId}`)
|
||||||
} else {
|
} else {
|
||||||
this.props.history.push(`/courses/${_courseId}/boards/${boardId}/messages/${topicId}`)
|
this.props.history.push(`/classrooms/${_courseId}/boards/${boardId}/messages/${topicId}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
toEditPage = (_courseId, boardId, topicId) => {
|
toEditPage = (_courseId, boardId, topicId) => {
|
||||||
if (typeof _courseId == "object") {
|
if (typeof _courseId == "object") {
|
||||||
const topicId = _courseId.topicId
|
const topicId = _courseId.topicId
|
||||||
const boardId = _courseId.boardId
|
const boardId = _courseId.boardId
|
||||||
const courseId = _courseId.coursesId
|
const courseId = _courseId.coursesId
|
||||||
this.props.history.push(`/courses/${courseId}/boards/${boardId}/messages/${topicId}/edit`)
|
this.props.history.push(`/classrooms/${courseId}/boards/${boardId}/messages/${topicId}/edit`)
|
||||||
} else {
|
} else {
|
||||||
this.props.history.push(`/courses/${_courseId}/boards/${boardId}/messages/${topicId}/edit`)
|
this.props.history.push(`/classrooms/${_courseId}/boards/${boardId}/messages/${topicId}/edit`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
toNewPage = (courseId, boardId) => {
|
toNewPage = (courseId, boardId) => {
|
||||||
this.props.history.push(`/courses/${courseId}/boards/${boardId}/messages/new`)
|
this.props.history.push(`/classrooms/${courseId}/boards/${boardId}/messages/new`)
|
||||||
}
|
}
|
||||||
toListPage = (_courseId, boardId) => {
|
toListPage = (_courseId, boardId) => {
|
||||||
if (typeof _courseId == "object") {
|
if (typeof _courseId == "object") {
|
||||||
const boardId = _courseId.boardId
|
const boardId = _courseId.boardId
|
||||||
const courseId = _courseId.coursesId
|
const courseId = _courseId.coursesId
|
||||||
this.props.history.push(`/courses/${courseId}/boards/${boardId}`)
|
this.props.history.push(`/classrooms/${courseId}/boards/${boardId}`)
|
||||||
} else {
|
} else {
|
||||||
this.props.history.push(`/courses/${_courseId}/boards${boardId ? '/' + boardId : ''}`)
|
this.props.history.push(`/classrooms/${_courseId}/boards${boardId ? '/' + boardId : ''}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { snackbarOpen} = this.state;
|
const { snackbarOpen} = this.state;
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<WrappedComponent {...this.props}
|
<WrappedComponent {...this.props}
|
||||||
toDetailPage={this.toDetailPage}
|
toDetailPage={this.toDetailPage}
|
||||||
toEditPage={this.toEditPage}
|
toEditPage={this.toEditPage}
|
||||||
toNewPage={this.toNewPage}
|
toNewPage={this.toNewPage}
|
||||||
toListPage={this.toListPage}
|
toListPage={this.toListPage}
|
||||||
>
|
>
|
||||||
|
|
||||||
</WrappedComponent>
|
</WrappedComponent>
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,142 +1,142 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { SnackbarHOC } from 'educoder';
|
import { SnackbarHOC } from 'educoder';
|
||||||
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
||||||
import Loadable from 'react-loadable';
|
import Loadable from 'react-loadable';
|
||||||
import Loading from '../../../Loading';
|
import Loading from '../../../Loading';
|
||||||
import { CNotificationHOC } from '../common/CNotificationHOC'
|
import { CNotificationHOC } from '../common/CNotificationHOC'
|
||||||
import { RouteHOC } from './common'
|
import { RouteHOC } from './common'
|
||||||
import "../css/busyWork.css"
|
import "../css/busyWork.css"
|
||||||
//引入对应跳转的组件
|
//引入对应跳转的组件
|
||||||
const ListPageIndex = Loadable({
|
const ListPageIndex = Loadable({
|
||||||
loader: () => import('../ListPageIndex'),
|
loader: () => import('../ListPageIndex'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
//新建分组/普通作业
|
//新建分组/普通作业
|
||||||
const NewWork = Loadable({
|
const NewWork = Loadable({
|
||||||
loader: () => import('./NewWork'),
|
loader: () => import('./NewWork'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkDetailIndex = Loadable({
|
const CommonWorkDetailIndex = Loadable({
|
||||||
loader: () => import('./CommonWorkDetailIndex'),
|
loader: () => import('./CommonWorkDetailIndex'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkSetting = Loadable({
|
const CommonWorkSetting = Loadable({
|
||||||
loader: () => import('./CommonWorkSetting'),
|
loader: () => import('./CommonWorkSetting'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkList = Loadable({
|
const CommonWorkList = Loadable({
|
||||||
loader: () => import('./CommonWorkList'),
|
loader: () => import('./CommonWorkList'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkQuestion = Loadable({
|
const CommonWorkQuestion = Loadable({
|
||||||
loader: () => import('./CommonWorkQuestion'),
|
loader: () => import('./CommonWorkQuestion'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkAnswer = Loadable({
|
const CommonWorkAnswer = Loadable({
|
||||||
loader: () => import('./CommonWorkAnswer'),
|
loader: () => import('./CommonWorkAnswer'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkAppraise = Loadable({
|
const CommonWorkAppraise = Loadable({
|
||||||
loader: () => import('./CommonWorkAppraise'),
|
loader: () => import('./CommonWorkAppraise'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
const CommonWorkPost = Loadable({
|
const CommonWorkPost = Loadable({
|
||||||
loader: () => import('./CommonWorkPost'),
|
loader: () => import('./CommonWorkPost'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
const CommonWork = Loadable({
|
const CommonWork = Loadable({
|
||||||
loader: () => import('./commonWork'),
|
loader: () => import('./commonWork'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
class CoursesWorkIndex extends Component{
|
class CoursesWorkIndex extends Component{
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
|
|
||||||
{/* --------------------------------------------------------------------- */}
|
{/* --------------------------------------------------------------------- */}
|
||||||
|
|
||||||
{/* 作业设置 */}
|
{/* 作业设置 */}
|
||||||
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
|
{/* http://localhost:3007/classrooms/1309/homework/9300/setting */}
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/setting"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/setting"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 作品列表 */}
|
{/* 作品列表 */}
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/list"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 作业问答 */}
|
{/* 作业问答 */}
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/question"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/question"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/answer"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/answer"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 评阅 */}
|
{/* 评阅 */}
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:studentWorkId/appraise"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/appraise"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 提交作品 */}
|
{/* 提交作品 */}
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/post"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/post"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:studentWorkId/post_edit"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/:studentWorkId/post_edit"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
|
|
||||||
{/* 新建 */}
|
{/* 新建 */}
|
||||||
{/* http://localhost:3007/courses/1309/common_homeworks/9299/edit/1 */}
|
{/* http://localhost:3007/classrooms/1309/common_homeworks/9299/edit/1 */}
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:pageType"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:workId/:pageType"
|
||||||
render={
|
render={
|
||||||
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/common_homeworks/:categroy_id/new"
|
<Route exact path="/classrooms/:coursesId/common_homeworks/:categroy_id/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{/* 作业列表 */}
|
{/* 作业列表 */}
|
||||||
<Route path="/courses/:coursesId/common_homeworks"
|
<Route path="/classrooms/:coursesId/common_homeworks"
|
||||||
render={
|
render={
|
||||||
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* --------------------------------------------------------------------- */}
|
{/* --------------------------------------------------------------------- */}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default RouteHOC() (CNotificationHOC() (SnackbarHOC() ( CoursesWorkIndex) ));
|
export default RouteHOC() (CNotificationHOC() (SnackbarHOC() ( CoursesWorkIndex) ));
|
||||||
|
@ -1,140 +1,140 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { SnackbarHOC } from 'educoder';
|
import { SnackbarHOC } from 'educoder';
|
||||||
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
||||||
import Loadable from 'react-loadable';
|
import Loadable from 'react-loadable';
|
||||||
import Loading from '../../../Loading';
|
import Loading from '../../../Loading';
|
||||||
import { CNotificationHOC } from '../common/CNotificationHOC'
|
import { CNotificationHOC } from '../common/CNotificationHOC'
|
||||||
import { RouteHOC } from './common'
|
import { RouteHOC } from './common'
|
||||||
import "../css/busyWork.css"
|
import "../css/busyWork.css"
|
||||||
//引入对应跳转的组件
|
//引入对应跳转的组件
|
||||||
const ListPageIndex = Loadable({
|
const ListPageIndex = Loadable({
|
||||||
loader: () => import('../ListPageIndex'),
|
loader: () => import('../ListPageIndex'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
//新建分组/普通作业
|
//新建分组/普通作业
|
||||||
const NewWork = Loadable({
|
const NewWork = Loadable({
|
||||||
loader: () => import('./NewWork'),
|
loader: () => import('./NewWork'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkPost = Loadable({
|
const CommonWorkPost = Loadable({
|
||||||
loader: () => import('./CommonWorkPost'),
|
loader: () => import('./CommonWorkPost'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkSetting = Loadable({
|
const CommonWorkSetting = Loadable({
|
||||||
loader: () => import('./CommonWorkSetting'),
|
loader: () => import('./CommonWorkSetting'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkList = Loadable({
|
const CommonWorkList = Loadable({
|
||||||
loader: () => import('./CommonWorkList'),
|
loader: () => import('./CommonWorkList'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkQuestion = Loadable({
|
const CommonWorkQuestion = Loadable({
|
||||||
loader: () => import('./CommonWorkQuestion'),
|
loader: () => import('./CommonWorkQuestion'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkAnswer = Loadable({
|
const CommonWorkAnswer = Loadable({
|
||||||
loader: () => import('./CommonWorkAnswer'),
|
loader: () => import('./CommonWorkAnswer'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
const CommonWorkAppraise = Loadable({
|
const CommonWorkAppraise = Loadable({
|
||||||
loader: () => import('./CommonWorkAppraise'),
|
loader: () => import('./CommonWorkAppraise'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const CommonWork = Loadable({
|
const CommonWork = Loadable({
|
||||||
loader: () => import('./commonWork'),
|
loader: () => import('./commonWork'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
|
|
||||||
const CommonWorkDetailIndex = Loadable({
|
const CommonWorkDetailIndex = Loadable({
|
||||||
loader: () => import('./CommonWorkDetailIndex'),
|
loader: () => import('./CommonWorkDetailIndex'),
|
||||||
loading:Loading,
|
loading:Loading,
|
||||||
})
|
})
|
||||||
class CoursesWorkIndex extends Component{
|
class CoursesWorkIndex extends Component{
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
|
|
||||||
|
|
||||||
{/* --------------------------------------------------------------------- */}
|
{/* --------------------------------------------------------------------- */}
|
||||||
|
|
||||||
{/* --------------------------------------------------------------------- */}
|
{/* --------------------------------------------------------------------- */}
|
||||||
|
|
||||||
{/* 作业设置 */}
|
{/* 作业设置 */}
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/setting"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/setting"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 作品列表 */}
|
{/* 作品列表 */}
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/list"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/list"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 作业问答 */}
|
{/* 作业问答 */}
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/question"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/question"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 参考答案 */}
|
{/* 参考答案 */}
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/answer"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/answer"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 评阅 */}
|
{/* 评阅 */}
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:studentWorkId/appraise"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/appraise"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
|
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/post"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/post"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:studentWorkId/post_edit"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/:studentWorkId/post_edit"
|
||||||
render={
|
render={
|
||||||
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 新建 */}
|
{/* 新建 */}
|
||||||
{/* http://localhost:3007/courses/1309/group_homeworks/9299/edit/1 */}
|
{/* http://localhost:3007/classrooms/1309/group_homeworks/9299/edit/1 */}
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:pageType"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:workId/:pageType"
|
||||||
render={
|
render={
|
||||||
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route exact path="/courses/:coursesId/group_homeworks/:categroy_id/new"
|
<Route exact path="/classrooms/:coursesId/group_homeworks/:categroy_id/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 作业列表 */}
|
{/* 作业列表 */}
|
||||||
<Route path="/courses/:coursesId/group_homeworks"
|
<Route path="/classrooms/:coursesId/group_homeworks"
|
||||||
render={
|
render={
|
||||||
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
|
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
|
|
||||||
</Switch>
|
</Switch>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default RouteHOC() (CNotificationHOC() (SnackbarHOC() ( CoursesWorkIndex) ));
|
export default RouteHOC() (CNotificationHOC() (SnackbarHOC() ( CoursesWorkIndex) ));
|
||||||
|
Loading…
Reference in new issue