|
|
|
@ -14,10 +14,9 @@ import Modals from '../../modals/Modals';
|
|
|
|
|
import CoursesListType from '../coursesPublic/CoursesListType';
|
|
|
|
|
import AccessoryModal from "../coursesPublic/AccessoryModal";
|
|
|
|
|
import PublishRightnow from './PublishRightnow'
|
|
|
|
|
import DownloadMessage from '../../modals/DownloadMessage';
|
|
|
|
|
|
|
|
|
|
import '../css/Courses.css'
|
|
|
|
|
import CBreadcrumb from '../common/CBreadcrumb'
|
|
|
|
|
import DownloadMessageysl from "../../modals/DownloadMessageysl";
|
|
|
|
|
|
|
|
|
|
//引入对应跳转的组件
|
|
|
|
|
|
|
|
|
@ -63,7 +62,8 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
|
this.publishModal = React.createRef();
|
|
|
|
|
this.endModal = React.createRef();
|
|
|
|
|
this.state = {
|
|
|
|
|
|
|
|
|
|
DownloadType:false,
|
|
|
|
|
DownloadMessageval:undefined,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
initWorkDetailCommonState = (data) => {
|
|
|
|
@ -100,6 +100,45 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
|
doWhenSuccess = () => {
|
|
|
|
|
trigger('commonwork_fetch_all')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// 确认是否下载
|
|
|
|
|
confirmysl(url){
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
if(response.data.status&&response.data.status===-1){
|
|
|
|
|
|
|
|
|
|
}else if(response.data.status&&response.data.status===-2){
|
|
|
|
|
if(response.data.messages === "100"){
|
|
|
|
|
// 已超出文件导出的上限数量(100 ),建议:
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
DownloadType:true,
|
|
|
|
|
DownloadMessageval:100
|
|
|
|
|
})
|
|
|
|
|
}else {
|
|
|
|
|
//因附件资料超过500M
|
|
|
|
|
this.setState({
|
|
|
|
|
DownloadType:true,
|
|
|
|
|
DownloadMessageval:500
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}else {
|
|
|
|
|
this.props.showNotification(`正在下载中`);
|
|
|
|
|
window.open("/api"+url, '_blank');
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Downloadcal=()=>{
|
|
|
|
|
this.setState({
|
|
|
|
|
DownloadType:false,
|
|
|
|
|
DownloadMessageval:undefined
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let {course_name, homework_name, homework_status, noTab
|
|
|
|
|
, view_answer, author_name, category, work_id
|
|
|
|
@ -139,11 +178,16 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
|
isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting}
|
|
|
|
|
onToPublishClick={this.onToPublishClick}
|
|
|
|
|
></PublishRightnow>
|
|
|
|
|
<DownloadMessageysl
|
|
|
|
|
{...this.props}
|
|
|
|
|
value={this.state.DownloadMessageval}
|
|
|
|
|
modalCancel={this.Downloadcal}
|
|
|
|
|
modalsType={this.state.DownloadType}
|
|
|
|
|
/>
|
|
|
|
|
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
|
|
|
|
|
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
|
|
|
|
|
|
|
|
|
|
<DownloadMessage ref="DownloadMessage" {...this.props} />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="newMain clearfix worklist1">
|
|
|
|
|
<div className={"educontent mt20"}>
|
|
|
|
|
<style>{`
|
|
|
|
@ -241,10 +285,10 @@ class CommonWorkDetailIndex extends Component{
|
|
|
|
|
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
|
|
|
|
|
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
|
|
|
|
|
<li><a href={"javascript:void(0)"} className="color-dark"
|
|
|
|
|
onClick={() => this.refs.DownloadMessage.confirmysl(exportResultUrl, exportParams)}
|
|
|
|
|
onClick={() => this.confirmysl(exportResultUrl, exportParams)}
|
|
|
|
|
>导出成绩</a></li>
|
|
|
|
|
<li><a href={"javascript:void(0)"} className="color-dark"
|
|
|
|
|
onClick={() => this.refs.DownloadMessage.confirmysl(exportUrl, exportParams)}
|
|
|
|
|
onClick={() => this.confirmysl(exportUrl, exportParams)}
|
|
|
|
|
>导出作品附件</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</li>:""}
|
|
|
|
|