From d0153307f8435bbb3e35a5613ce1edc748519e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 30 Jul 2019 23:38:23 +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 --- .../courses/busyWork/CommonWorkDetailIndex.js | 22 +++++++------------ .../exercise/Studentshavecompletedthelist.js | 3 +++ .../exercise/Testpapersettinghomepage.js | 10 +++++++-- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 9989de401..b8a5d450c 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -66,6 +66,7 @@ class CommonWorkDetailIndex extends Component{ this.state = { DownloadType:false, DownloadMessageval:undefined, + donwloading:false, } } initWorkDetailCommonState = (data) => { @@ -104,17 +105,11 @@ class CommonWorkDetailIndex extends Component{ } /// 确认是否下载 - confirmysl(url,child){ - let params = {} - if (isListModule) { - // TODO - if(child!=undefined) { - params = child._getRequestParams() !== undefined ? child._getRequestParams() : {}; - } - } - axios.get(url+ '&export=true',{ - params - }).then((response) => { + confirmysl(url){ + axios.get(url+ '&export=true').then((response) => { + if(response===undefined){ + return + } if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ @@ -138,7 +133,6 @@ class CommonWorkDetailIndex extends Component{ this.setState({ donwloading: true }) downloadFile({ url: url, - params, successCallback: (url) => { this.setState({ donwloading: false }) console.log('successCallback') @@ -324,13 +318,13 @@ class CommonWorkDetailIndex extends Component{
  • this.confirmysl(exportResultUrl,this.child)} + onClick={() => this.confirmysl(exportResultUrl)} >导出成绩
  • this.confirmysl(exportUrl,this.child)} + onClick={() => this.confirmysl(exportUrl)} >导出作品附件
  • diff --git a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js index 3f60710c1..f7a989f79 100644 --- a/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js +++ b/public/react/src/modules/courses/exercise/Studentshavecompletedthelist.js @@ -1990,6 +1990,9 @@ class Studentshavecompletedthelist extends Component { }).then((response) => { // console.log("528"); // console.log(JSON.stringify(response)); + if(response===undefined){ + return + } this.setState({ loadingstate: false, }) diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 243ab98f5..076f6a759 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -19,7 +19,7 @@ import Ecerciseallbackagain from './Ecerciseallbackagain'; const polls_status={1:"未发布",2:"提交中",3:"已截止",4:"已结束"} const start_Value={0:"继续答题",1:"查看答题",2:"开始答题"} - +const qs = require('qs'); //试卷主要设置页面 class Testpapersettinghomepage extends Component{ constructor(props) { @@ -171,8 +171,14 @@ class Testpapersettinghomepage extends Component{ console.log("170"); console.log(params); axios.get(url,{ - params + params, + paramsSerializer: function(params) { + return qs.stringify(params, {arrayFormat: 'brackets'}) + } }).then((response) => { + if(response===undefined){ + return + } if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){