From 2308454f427f266269afac7d73fee69724ff470c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 8 Jul 2019 16:49:36 +0800 Subject: [PATCH 1/3] del --- .../react/src/modules/tpm/challengesnew/TPManswer2.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/tpm/challengesnew/TPManswer2.js b/public/react/src/modules/tpm/challengesnew/TPManswer2.js index 98c615065..b5e1b43a6 100644 --- a/public/react/src/modules/tpm/challengesnew/TPManswer2.js +++ b/public/react/src/modules/tpm/challengesnew/TPManswer2.js @@ -195,10 +195,10 @@ export default class TPManswer extends Component { this.setState({ answers: newAnswers}) } answerOnChange = (val, index) => { - // if (!this.state.answers[index]) { - // // 1、2、3删除2会走到这里 - // return; - // } + if (!this.state.answers[index]) { + // 1、2、3删除2会走到这里 + return; + } const newAnswer = Object.assign({}, this.state.answers[index]) newAnswer.contents = val const newAnswers = this.state.answers.slice(0) @@ -314,7 +314,7 @@ export default class TPManswer extends Component { { answers.map((answer, index) => { - return
+ return
*

级别{index + 1}

this.delanswers(index)}> From cb6587f393f400299c2bd6cd6ed0135d6aea237b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 8 Jul 2019 17:19:27 +0800 Subject: [PATCH 2/3] markdown-body --- .../src/modules/courses/shixunHomework/Workquestionandanswer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 170051ca6..5cb496847 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -557,7 +557,7 @@ class Workquestionandanswer extends Component { description={jobsettingsdata === undefined ? "" : jobsettingsdata === null ? "" : jobsettingsdata === "null" ? "" : jobsettingsdata.data.explanation === undefined ? "" : jobsettingsdata.data.explanation === null ? "" : jobsettingsdata.data.explanation}>
: -
+
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" : jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" :
Date: Mon, 8 Jul 2019 20:37:09 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/package.json | 2 +- .../tasks/GraduationTaskssetting.js | 47 ++++++++++++-- .../tasks/GraduationTaskssettinglist.js | 62 +++++++++++++++++-- .../tasks/GraduationTaskssettingquestions.js | 47 +++++++++++++- 4 files changed, 146 insertions(+), 12 deletions(-) diff --git a/public/react/package.json b/public/react/package.json index f3565cf45..d2b6a23ea 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -6,7 +6,7 @@ "@flatten/array": "^1.1.7", "@icedesign/base": "^0.2.5", "@novnc/novnc": "^1.1.0", - "antd": "^3.20.1", + "antd": "^3.6.5", "array-flatten": "^2.1.2", "autoprefixer": "7.1.6", "axios": "^0.18.0", diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index 24fbaad81..ba80918dc 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -5,6 +5,7 @@ import locale from 'antd/lib/date-picker/locale/zh_CN'; import { WordsBtn,getUrl ,handleDateString} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; +import DownloadMessage from '../../../modals/DownloadMessage'; import CoursesListType from '../../coursesPublic/CoursesListType'; import PublishModals from "../../coursesPublic/PublishModals"; import HomeworkModal from "../../coursesPublic/HomeworkModal"; @@ -894,7 +895,40 @@ 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 + }) + } render(){ const { getFieldDecorator } = this.props.form; const dateFormat = 'YYYY-MM-DD HH:mm'; @@ -969,7 +1003,12 @@ class GraduationTaskssettingapp extends Component{ {/*course_groups={course_groups}*/} {/*skipTop={this.skipTop}*/} {/*/>*/} - + 导出 :""} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 5d0515535..517c2ec0b 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -6,7 +6,7 @@ import axios from 'axios'; import moment from 'moment'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; import Modals from '../../../modals/Modals'; - +import DownloadMessage from '../../../modals/DownloadMessage'; import CoursesListType from '../../coursesPublic/CoursesListType'; import ModulationModal from "../../coursesPublic/ModulationModal"; @@ -612,7 +612,51 @@ class GraduationTaskssettinglist extends Component{ this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pageNumber); } + /// 确认是否下载 + confirmysl(url){ + + let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state; + axios.get(url,{ + teacher_comment:teacher_comment, + task_status:task_status, + course_group:course_group, + cross_comment:cross_comment, + order:order, + b_order:b_order, + search:search, + }).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 {coursename,coursesearch,taskname,taskid,taskslistdata,data,page,limit,teacher_comment,task_status,cross_comment,search,loadingstate, @@ -959,7 +1003,17 @@ class GraduationTaskssettinglist extends Component{ Cancel={this.Cancelvisible} categoryid={taskslistdata.work_id} setupdate={this.setupdate} - />:""} {taskslistdata&&taskslistdata? + />:""} + + + + + {taskslistdata&&taskslistdata? // 教师列表 this.props.isAdmin()?
@@ -1025,8 +1079,8 @@ class GraduationTaskssettinglist extends Component{ {this.props.isAdmin()?
  • 导出
  • :""} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index 4e807fde4..7c1a1474a 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js @@ -4,6 +4,7 @@ import {Link} from 'react-router-dom'; import { WordsBtn,markdownToHTML} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; +import DownloadMessage from '../../../modals/DownloadMessage'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; import CoursesListType from '../../coursesPublic/CoursesListType'; import moment from 'moment'; @@ -187,6 +188,41 @@ class GraduationTasksquestions extends Component{ course_groupslist:id }) } + + /// 确认是否下载 + 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 { Modalstype,Modalstopval,ModalCancel,ModalSave,questionslist} =this.state; @@ -218,7 +254,12 @@ class GraduationTasksquestions extends Component{ {/*modalSave={ModalSave}*/} {/*loadtype={Loadtype}*/} {/*/>*/} - + 导出 :""}