From 397b8cbd1b7a1b0d0daf88973e18afc83743d4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 18 Jul 2019 10:15:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/Testpapersettinghomepage.js | 50 +++++- .../courses/shixunHomework/Listofworks.js | 41 +---- .../shixunHomework/Listofworksstudentone.js | 30 +++- .../shixunHomework/ShixunHomeworkPage.js | 54 ++++++- .../shixunHomework/ShixunStudentWork.js | 15 +- .../shixunHomework/ShixunWorkReport.js | 76 +++++---- .../shixunHomework/Trainingjobsetting.js | 38 +---- .../shixunHomework/Workquestionandanswer.js | 37 +---- .../src/modules/modals/DownloadMessage.js | 145 +++++++++--------- .../src/modules/modals/DownloadMessageysl.js | 50 ++++++ 10 files changed, 298 insertions(+), 238 deletions(-) create mode 100644 public/react/src/modules/modals/DownloadMessageysl.js diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 398a45228..f25f02d83 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -7,7 +7,7 @@ import '../css/members.css'; import '../css/busyWork.css'; import axios from 'axios'; import Modals from '../../modals/Modals'; -import DownloadMessage from '../../modals/DownloadMessage'; +import DownloadMessageysl from "../../modals/DownloadMessageysl"; import Studentshavecompletedthelist from './Studentshavecompletedthelist'; import WrappedExercisesetting from './Exercisesetting'; import ExerciseDisplay from './ExerciseDisplay' @@ -30,6 +30,8 @@ class Testpapersettinghomepage extends Component{ visible:false, groupyslsval:"", current_status:undefined, + DownloadType:false, + DownloadMessageval:undefined, } } //切换tab @@ -159,7 +161,41 @@ class Testpapersettinghomepage extends Component{ } } + /// 确认是否下载 + 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 + }) + } cancelmodel=()=>{ this.setState({ Modalstype:false, @@ -296,9 +332,9 @@ class Testpapersettinghomepage extends Component{ {isAdmin === true?