diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 4598ed2af..0b3c1b338 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2204,8 +2204,13 @@ class Listofworksstudentone extends Component { // } daochushixunbaogao=()=>{ + let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo===undefined ||this.state.course_groupyslstwo===null? "": this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo===undefined||this.state.checkedValuesineinfo===null? "":this.state.checkedValuesineinfo}&search=${this.state.searchtext===undefined||this.state.searchtext===null?"":this.state.searchtext}` + this.confirmysl(url); + } - + daochuzuoye =() =>{ + let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo===undefined||this.state.checkedValuesineinfo===null?"":this.state.checkedValuesineinfo}&search=${this.state.searchtext===undefined||this.state.searchtext=== null?"":this.state.searchtext}` + this.confirmysl(url); } diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index a1f670d03..bc20bb254 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -32,8 +32,6 @@ class ShixunHomeworkPage extends Component { visible: false, showmodel:false, child:undefined, - DownloadType:false, - DownloadMessageval:undefined, } } @@ -86,9 +84,14 @@ class ShixunHomeworkPage extends Component { } - // confirmysl(child,url) { - // confirmysl(url); - // } + confirmysl(child,i) { + if(i===1){ + child.daochushixunbaogao(); + } + if(i===2){ + child.daochuzuoye(); + } + } homeworkendss(child){ child.homeworkends(); @@ -199,10 +202,10 @@ class ShixunHomeworkPage extends Component { 导出 diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index ed399af98..ad71fc6a4 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -3,6 +3,7 @@ import CoursesListType from '../coursesPublic/CoursesListType'; import {WordsBtn,ActionBtn} from 'educoder'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; import HomeworkModal from "../coursesPublic/HomeworkModal"; +import DownloadMessageysl from '../../modals/DownloadMessageysl'; import NoneData from '../coursesPublic/NoneData'; import { Form, @@ -69,6 +70,8 @@ class ShixunStudentWork extends Component { datalist:undefined, showmodel:false, jobsettingsdata:undefined, + DownloadType:false, + DownloadMessageval:undefined } } @@ -507,6 +510,52 @@ class ShixunStudentWork extends Component { ChangeTab=(e)=>{ this.props.ChangeTab(e); } + + daochushixunbaogao=()=>{ + let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`; + this.confirmysl(url); + } + + daochuzuoye =() =>{ + let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`; + this.confirmysl(url); + } + + 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 { data, @@ -596,6 +645,13 @@ class ShixunStudentWork extends Component { issCancel={()=>this.hideshowmodel()} updatas={()=>this.getupdata()} />:""} + {/*{ this.props.ChangeTab(e); } + + daochushixunbaogao=()=>{ + let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`; + this.confirmysl(url); + } + + daochuzuoye =() =>{ + let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`; + this.confirmysl(url); + } + + 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() { @@ -1776,7 +1823,13 @@ class Trainingjobsetting extends Component { {/* {...this.props}*/} {/* ref="DownloadMessage"*/} {/*/>*/} + {/*立即发布*/} { this.props.ChangeTab(e); } + + daochushixunbaogao=()=>{ + let url =`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`; + this.confirmysl(url); + } + + daochuzuoye =() =>{ + let url = `/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`; + this.confirmysl(url); + } + + 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 dateFormat = 'YYYY-MM-DD HH:mm:ss'; let { @@ -352,6 +399,13 @@ class Workquestionandanswer extends Component { {/* ref="DownloadMessage"*/} {/*/>*/} {/*立即发布*/} +