diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index dd8c7691d..144f1b967 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -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} > + - - +