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