|
|
@ -1,10 +1,9 @@
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { getRandomNumber } from 'educoder';
|
|
|
|
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import { Link } from 'react-router-dom';
|
|
|
|
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
|
|
|
|
import { 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 { WordsBtn, MarkdownToHtml, trigger, queryString, getRandomcode } from 'educoder';
|
|
|
|
import { WordsBtn, trigger, queryString, getRandomcode } from 'educoder';
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
import CoursesListType from '../coursesPublic/CoursesListType';
|
|
|
|
import CoursesListType from '../coursesPublic/CoursesListType';
|
|
|
|
import AccessoryModal from "../coursesPublic/AccessoryModal";
|
|
|
|
import AccessoryModal from "../coursesPublic/AccessoryModal";
|
|
|
@ -17,11 +16,6 @@ import { Spin } from 'antd'
|
|
|
|
|
|
|
|
|
|
|
|
//引入对应跳转的组件
|
|
|
|
//引入对应跳转的组件
|
|
|
|
|
|
|
|
|
|
|
|
//新建分组/普通作业
|
|
|
|
|
|
|
|
const NewWork = Loadable({
|
|
|
|
|
|
|
|
loader: () => import('./NewWork'),
|
|
|
|
|
|
|
|
loading:Loading,
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CommonWorkSetting = Loadable({
|
|
|
|
const CommonWorkSetting = Loadable({
|
|
|
|
loader: () => import('./CommonWorkSetting'),
|
|
|
|
loader: () => import('./CommonWorkSetting'),
|
|
|
@ -40,25 +34,9 @@ const CommonWorkAnswer = Loadable({
|
|
|
|
loader: () => import('./CommonWorkAnswer'),
|
|
|
|
loader: () => import('./CommonWorkAnswer'),
|
|
|
|
loading: Loading,
|
|
|
|
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 CommonWorkDetailIndex extends Component {
|
|
|
|
class CommonWorkDetailIndex extends Component {
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props)
|
|
|
|
super(props)
|
|
|
|
this.publishModal = React.createRef();
|
|
|
|
|
|
|
|
this.endModal = React.createRef();
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
DownloadType: false,
|
|
|
|
DownloadType: false,
|
|
|
|
DownloadMessageval: undefined,
|
|
|
|
DownloadMessageval: undefined,
|
|
|
@ -127,20 +105,6 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
this.props.slowDownload(getRandomcode(url))
|
|
|
|
this.props.slowDownload(getRandomcode(url))
|
|
|
|
|
|
|
|
|
|
|
|
// this.props.showNotification(`正在下载中`);
|
|
|
|
|
|
|
|
// this.setState({ donwloading: true })
|
|
|
|
|
|
|
|
// downloadFile({
|
|
|
|
|
|
|
|
// url: url,
|
|
|
|
|
|
|
|
// successCallback: (url) => {
|
|
|
|
|
|
|
|
// this.setState({ donwloading: false })
|
|
|
|
|
|
|
|
// console.log('successCallback')
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// failCallback: (responseHtml, url) => {
|
|
|
|
|
|
|
|
// this.setState({ donwloading: false })
|
|
|
|
|
|
|
|
// console.log('failCallback')
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// window.open("/api"+url, '_blank');
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).catch((error) => {
|
|
|
|
}).catch((error) => {
|
|
|
|
console.log(error)
|
|
|
|
console.log(error)
|
|
|
@ -164,8 +128,6 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cancelConnectionProject = (work) => {
|
|
|
|
cancelConnectionProject = (work) => {
|
|
|
|
let workId=this.props.match.params.workId;
|
|
|
|
|
|
|
|
let courseId=this.props.match.params.coursesId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
|
|
|
|
const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
axios.get(url).then((response) => {
|
|
|
@ -196,7 +158,6 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
const studentWorkId = this.props.match.params.studentWorkId
|
|
|
|
const studentWorkId = this.props.match.params.studentWorkId
|
|
|
|
|
|
|
|
|
|
|
|
const isGroup = this.props.isGroup()
|
|
|
|
const isGroup = this.props.isGroup()
|
|
|
|
const moduleName = !isGroup? "普通作业":"分组作业";
|
|
|
|
|
|
|
|
const moduleEngName = this.props.getModuleName()
|
|
|
|
const moduleEngName = this.props.getModuleName()
|
|
|
|
|
|
|
|
|
|
|
|
const childModuleName = this.state.moduleName
|
|
|
|
const childModuleName = this.state.moduleName
|
|
|
@ -212,19 +173,16 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
// 是列表页
|
|
|
|
// 是列表页
|
|
|
|
let params = {}
|
|
|
|
let params = {}
|
|
|
|
if (isListModule) {
|
|
|
|
if (isListModule) {
|
|
|
|
// TODO
|
|
|
|
|
|
|
|
if (this.child && this.child._getRequestParams) {
|
|
|
|
if (this.child && this.child._getRequestParams) {
|
|
|
|
params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {};
|
|
|
|
params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// console.log("普通作业176176176");
|
|
|
|
|
|
|
|
// console.log(params);
|
|
|
|
|
|
|
|
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
|
|
|
|
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
|
|
|
|
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
|
|
|
|
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
|
|
|
|
document.title = course_name === undefined ? "" : course_name;
|
|
|
|
document.title = course_name === undefined ? "" : course_name;
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
|
|
|
|
<PublishRightnow showActionButton={false} {...this.props} checkBoxValues={[workId]}
|
|
|
|
isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting}
|
|
|
|
isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting}
|
|
|
|
onToPublishClick={this.onToPublishClick}
|
|
|
|
onToPublishClick={this.onToPublishClick}
|
|
|
|
></PublishRightnow>
|
|
|
|
></PublishRightnow>
|
|
|
@ -234,7 +192,7 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
modalCancel={this.Downloadcal}
|
|
|
|
modalCancel={this.Downloadcal}
|
|
|
|
modalsType={this.state.DownloadType}
|
|
|
|
modalsType={this.state.DownloadType}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
|
|
|
|
<PublishRightnow showActionButton={false} {...this.props} checkBoxValues={[workId]}
|
|
|
|
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
|
|
|
|
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -335,7 +293,7 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
float: right;
|
|
|
|
float: right;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`}</style>
|
|
|
|
`}</style>
|
|
|
|
{this.props.isAdmin()? <Spin spinning={this.state.donwloading} style={{ }}>
|
|
|
|
{this.props.isAdmin() ? <Spin spinning={this.state.donwloading} >
|
|
|
|
<li className="li_line drop_down fr color-blue font-16 mt20" style={{ "padding": "0 20px" }}>
|
|
|
|
<li className="li_line drop_down fr color-blue font-16 mt20" style={{ "padding": "0 20px" }}>
|
|
|
|
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
<ul className="drop_down_menu" style={{ "right": "-34px", "left": "unset", "height": "auto" }}>
|
|
|
|
<ul className="drop_down_menu" style={{ "right": "-34px", "left": "unset", "height": "auto" }}>
|
|
|
@ -355,19 +313,12 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
</li>
|
|
|
|
</li>
|
|
|
|
</Spin> : ""}
|
|
|
|
</Spin> : ""}
|
|
|
|
|
|
|
|
|
|
|
|
{/* {isAdmin && <a className={"fr color-blue font-16"} href={exportUrl}>导出作品附件</a>}
|
|
|
|
|
|
|
|
{isAdmin && <a className={"fr color-blue font-16"} href={exportResultUrl}>导出成绩</a>} */}
|
|
|
|
|
|
|
|
{/*<a className={"fr color-blue font-16"}>导出</a>*/}
|
|
|
|
|
|
|
|
{end_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.endModal.current.open() } }>立即截止</a>}
|
|
|
|
|
|
|
|
{publish_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.publishModal.current.open() } } >立即发布</a>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
|
|
|
|
|
|
|
|
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
|
|
|
|
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
|
|
|
|
|
|
|
|
|
|
|
|
{ //
|
|
|
|
{ //
|
|
|
|
work_statuses && work_statuses.indexOf('关联项目') != -1 &&
|
|
|
|
work_statuses && work_statuses.indexOf('关联项目') != -1 &&
|
|
|
|
<React.Fragment>
|
|
|
|
<React.Fragment>
|
|
|
|
<ConnectProject ref="connectProject" {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
|
|
|
|
<ConnectProject {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
|
|
|
|
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.openConnectionProject({ homework_id: workId })}>关联项目</WordsBtn>
|
|
|
|
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.openConnectionProject({ homework_id: workId })}>关联项目</WordsBtn>
|
|
|
|
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.props.toCreateProject()}>创建项目</WordsBtn>
|
|
|
|
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.props.toCreateProject()}>创建项目</WordsBtn>
|
|
|
|
</React.Fragment>
|
|
|
|
</React.Fragment>
|
|
|
@ -429,7 +380,7 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
{/* 作品列表 */}
|
|
|
|
{/* 作品列表 */}
|
|
|
|
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
|
|
|
|
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
|
|
|
|
render={
|
|
|
|
render={
|
|
|
|
(props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>)
|
|
|
|
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler} />)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
></Route>
|
|
|
|
></Route>
|
|
|
|
|
|
|
|
|
|
|
|