From af6aba0328a27f7b9d956d7e13c1f203f9c51af2 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:49:37 +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 | 2 +-
.../modules/courses/members/studentsList.js | 51 +++++++++++++++++--
.../shixunHomework/ShixunHomeworkPage.js | 4 +-
.../src/modules/modals/DownloadMessage.js | 2 +-
4 files changed, 52 insertions(+), 7 deletions(-)
diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
index f25f02d83..abea627d3 100644
--- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
+++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js
@@ -334,7 +334,7 @@ class Testpapersettinghomepage extends Component{
:""}
diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js
index 00e826a5c..c073abf4f 100644
--- a/public/react/src/modules/courses/members/studentsList.js
+++ b/public/react/src/modules/courses/members/studentsList.js
@@ -13,7 +13,7 @@ import Modals from "../../modals/Modals";
import axios from 'axios'
import _ from 'lodash'
import NoneData from "../coursesPublic/NoneData"
-
+import DownloadMessageysl from "../../modals/DownloadMessageysl";
import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
const Search =Input.Search;
@@ -131,10 +131,49 @@ class studentsList extends Component{
modalsBottomval:"",
modalCancel:"",
n_And_e:1,
- isSpin:false
+ isSpin:false,
+ DownloadType:false,
+ DownloadMessageval:undefined,
}
}
+/// 确认是否下载
+ confirmysl(url){
+ axios.get(url).then((response) => {
+ if(response === undefined){
+ return
+ }
+ 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
+ })
+ }
inputStudent=(e)=>{
this.setState({
@@ -490,6 +529,12 @@ class studentsList extends Component{
exportUrl += paramsString;
return(
+
@@ -525,7 +570,7 @@ class studentsList extends Component{
{ isAdmin && isParent && this.addDir()}>添加分班 }
{ isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 }
{ isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 }
- { isAdmin && 导出成绩 }
+ { isAdmin && this.confirmysl(exportUrl)} >导出成绩 }
{/* */}
}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
index 130410be7..4ff7b2cad 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
@@ -234,10 +234,10 @@ class ShixunHomeworkPage extends Component {
导出
diff --git a/public/react/src/modules/modals/DownloadMessage.js b/public/react/src/modules/modals/DownloadMessage.js
index fe0a0657f..618250e7c 100644
--- a/public/react/src/modules/modals/DownloadMessage.js
+++ b/public/react/src/modules/modals/DownloadMessage.js
@@ -5,7 +5,7 @@ import { Modal} from 'antd';
import axios from 'axios';
class DownloadMessage extends Component {
-
+ //没有修改菜世的 最后复原了
constructor(props) {
super(props);
this.state = {