From e3e0a6873a44d21f89d8c3ac135223204c69c023 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 12 Jul 2019 09:20:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=80=E6=9C=89=E5=AF=BC=E5=87=BA=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tasks/GraduationTaskssetting.js | 65 +++++++++---------- .../tasks/GraduationTaskssettingquestions.js | 55 ++++++++-------- .../modules/courses/poll/PollDetailIndex.js | 9 ++- .../courses/shixunHomework/Listofworks.js | 55 ++++++++-------- .../shixunHomework/ShixunStudentWork.js | 55 ++++++++-------- .../shixunHomework/ShixunWorkReport.js | 53 +++++++-------- .../shixunHomework/Trainingjobsetting.js | 53 ++++++++------- .../shixunHomework/Workquestionandanswer.js | 53 ++++++++------- 8 files changed, 198 insertions(+), 200 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 27aa34e21..2ed3ebc84 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -891,37 +891,34 @@ class GraduationTaskssettingapp 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 - }) + + this.refs.DownloadMessage.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) + // }); } render(){ const { getFieldDecorator } = this.props.form; @@ -998,10 +995,8 @@ class GraduationTaskssettingapp extends Component{ {/*skipTop={this.skipTop}*/} {/*/>*/} { - 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) - }); + this.refs.DownloadMessage.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({ @@ -256,9 +257,7 @@ class GraduationTasksquestions extends Component{ {/*/>*/} +

{this.props.coursedata.name} @@ -152,7 +159,7 @@ class PollDetailIndex extends Component{ :"" } */} - 导出统计 + this.confirmysl("/polls/"+this.props.match.params.pollId+"/commit_result.xlsx")} href="javascript:void(0);">导出统计 } { diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 26c175847..c8c77dfbd 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -1333,31 +1333,32 @@ class Listofworks 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) - }); + this.refs.DownloadMessage.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=()=>{ @@ -1397,9 +1398,7 @@ class Listofworks extends Component { {visibles === true ? diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index f288bd836..73e793532 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -473,31 +473,32 @@ class ShixunStudentWork 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) - }); + this.refs.DownloadMessage.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=()=>{ @@ -601,9 +602,7 @@ class ShixunStudentWork extends Component { {/*立即发布*/} { - if(response.data.status&&response.data.status===-1){ - }else if(response.data.status&&response.data.status===-2){ - if(response.data.messages === "100"){ - // 已超出文件导出的上限数量(100 ),建议: + this.refs.DownloadMessage.confirmysl(url); + + // axios.get(url).then((response) => { + // if(response.data.status&&response.data.status===-1){ - 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) - }); + // }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) + // }); } @@ -124,9 +127,7 @@ class ShixunWorkReport extends Component {

{data&&data.shixun_name}

diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 91e199c2e..16adaaa1d 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1677,30 +1677,31 @@ class Trainingjobsetting 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) - }); + this.refs.DownloadMessage.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=()=>{ @@ -1767,9 +1768,7 @@ class Trainingjobsetting extends Component { {/*立即发布*/} diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index fc1b4ebd6..8ff9ef25a 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -317,30 +317,31 @@ class Workquestionandanswer 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) - }); + this.refs.DownloadMessage.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({ @@ -381,9 +382,7 @@ class Workquestionandanswer extends Component { /> : ""} {/*立即发布*/}