From 58eec94296609c4234545b79a7c85a7cfed6bea5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Mon, 22 Jul 2019 14:07:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkDetailIndex.js | 58 ++++++++++++++++--- .../busyWork/common/TabRightComponents.js | 52 +++++++++++++++-- .../courses/graduation/topics/index.js | 47 ++++++++++++++- .../modules/courses/members/studentsList.js | 2 +- .../modules/courses/poll/PollDetailIndex.js | 48 +++++++++++++-- 5 files changed, 188 insertions(+), 19 deletions(-) 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} > + - - +