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?
  • 导出
  • :""} @@ -345,6 +381,12 @@ class Testpapersettinghomepage extends Component{ + { // 教师列表 parseInt(tab[0])==0 && this.setcourse_groupysls(value)} current_status = {this.state.current_status}> diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js index 68730b0fe..7bdb731e0 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworks.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js @@ -4,7 +4,6 @@ import {WordsBtn, ActionBtn} from 'educoder'; import TraineetraininginformationModal from './TraineetraininginformationModal'; import ModulationModal from "../coursesPublic/ModulationModal"; import HomeworkModal from "../coursesPublic/HomeworkModal"; -import DownloadMessage from '../../modals/DownloadMessage'; import { Form, Select, @@ -1369,39 +1368,9 @@ class Listofworks extends Component { }); } - /// 确认是否下载 - confirmysl(url){ - 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) - // }); - } - ChangeTab=(e)=>{ - this.props.ChangeTab(e); - } + + render() { // console.log("Listofworks.js000") @@ -1426,11 +1395,7 @@ class Listofworks extends Component { issCancel={() => this.hideshowmodel()} updatas={() => this.isupdatas()} /> : ""} - - + {visibles === true ?
    diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 7d3c37704..a2343abf8 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -13,6 +13,7 @@ import '../css/busyWork.css' import '../poll/pollStyle.css' import {getImageUrl} from 'educoder'; import TraineetraininginformationModal from "./TraineetraininginformationModal"; +import DownloadMessageysl from '../../modals/DownloadMessageysl'; import Startshixuntask from "../coursesPublic/Startshixuntask"; @@ -63,6 +64,8 @@ class Listofworksstudentone extends Component { }, student_works: [], startbtn: false, + DownloadType:false, + DownloadMessageval:undefined, columns: [ { title: '序号', @@ -335,8 +338,9 @@ class Listofworksstudentone extends Component { console.log("Listofworksstudentone"); console.log("componentDidMount"); this.props.triggerRef(this); - var homeworkid = this.props.match.params.homeworkid; - this.Getalistofworks(homeworkid); + // var homeworkid = this.props.match.params.homeworkid; + // this.Getalistofworks(homeworkid); + this.Getalistofworkstwo("", "", "", "", 1, 20); let query = this.props.location.pathname; const type = query.split('/'); this.setState({ @@ -857,16 +861,15 @@ class Listofworksstudentone extends Component { axios.get(url).then((response) => { this.props.showNotification(`${response.data.message}`); - var homeworkid = this.props.match.params.homeworkid; - this.Getalistofworks(homeworkid); + // var homeworkid = this.props.match.params.homeworkid; + // this.Getalistofworks(homeworkid); + this.Getalistofworkstwo("", "", "", "", 1, 20); }).catch((error) => { console.log(error) }); } - ChangeTab=(e)=>{ - this.props.ChangeTab(e); - } + render() { let {visibles, game_list,columns, limit,experience, boolgalist,viewtrainingdata, teacherdata, page, data, jobsettingsdata, styletable, datas, order, loadingstate,computeTimetype} = this.state; // console.log(this.state.data); @@ -920,6 +923,12 @@ class Listofworksstudentone extends Component { {visibles === true ?
    +