dev_forum
杨树林 6 years ago
parent 77a893d7a6
commit 397b8cbd1b

@ -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? <li className="li_line drop_down fr color-blue font-15" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.experiment(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li>
<li><a onClick={()=>this.experiment(`/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li>
<li><a onClick={()=>this.experiment(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}>学生答题试卷</a></li>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li>
<li><a onClick={()=>this.confirmysl(`/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li>
<li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}>学生答题试卷</a></li>
</ul>
</li>:""}
</div>
@ -345,6 +381,12 @@ class Testpapersettinghomepage extends Component{
</div>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
{
// 教师列表
parseInt(tab[0])==0 && <Studentshavecompletedthelist {...this.props} {...this.state} setcourse_groupysls={(value)=>this.setcourse_groupysls(value)} current_status = {this.state.current_status}></Studentshavecompletedthelist>

@ -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")
@ -1427,10 +1396,6 @@ class Listofworks extends Component {
updatas={() => this.isupdatas()}
/> : ""}
<DownloadMessage
{...this.props}
ref="DownloadMessage"
/>
{visibles === true ?
<div>

@ -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 {
</style>
{visibles === true ?
<div>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<style>
{
`
@ -1041,6 +1050,13 @@ class Listofworksstudentone extends Component {
:
// 学生能查看别人的
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
{visibles === true ?
<TraineetraininginformationModal
homeworkid={this.props.match.params.homeworkid}

@ -19,6 +19,7 @@ import CoursesListType from '../coursesPublic/CoursesListType';
import ShixunStudentWork from "./ShixunStudentWork";
import Startshixuntask from "../coursesPublic/Startshixuntask";
import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor";
import DownloadMessageysl from "../../modals/DownloadMessageysl";
class ShixunHomeworkPage extends Component {
constructor(props) {
super(props);
@ -32,6 +33,8 @@ class ShixunHomeworkPage extends Component {
visible: false,
showmodel:false,
child:undefined,
DownloadType:false,
DownloadMessageval:undefined,
}
}
@ -84,9 +87,9 @@ class ShixunHomeworkPage extends Component {
}
confirmysl(child,url) {
child.confirmysl(url);
}
// confirmysl(child,url) {
// confirmysl(url);
// }
homeworkendss(child){
child.homeworkends();
@ -99,7 +102,41 @@ class ShixunHomeworkPage extends Component {
workshowmodels(child){
child.workshowmodel();
}
/// 确认是否下载
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
})
}
bindRef = ref => { this.child = ref }
///////////////教师截止
@ -197,10 +234,10 @@ class ShixunHomeworkPage extends Component {
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a
onClick={(child) => this.confirmysl(this.child,`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a>
onClick={(url) => this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a>
</li>
<li><a
onClick={(child) => this.confirmysl(this.child,`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>学生成绩</a>
onClick={(url) => this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>学生成绩</a>
</li>
</ul>
@ -237,7 +274,12 @@ class ShixunHomeworkPage extends Component {
</div>
</div>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
{
// 教师列表
parseInt(tab) === 0 ? (isAdmin === true ?

@ -4,7 +4,6 @@ import {WordsBtn,ActionBtn} from 'educoder';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import NoneData from '../coursesPublic/NoneData';
import DownloadMessage from '../../modals/DownloadMessage';
import {
Form,
Select,
@ -474,8 +473,8 @@ class ShixunStudentWork extends Component {
}
// 导出实习报告批量
/// 确认是否下载
confirmysl(url){
this.refs.DownloadMessage.confirmysl(url);
// confirmysl(url){
// this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
@ -501,7 +500,7 @@ class ShixunStudentWork extends Component {
// }).catch((error) => {
// console.log(error)
// });
}
// }
ChangeTab=(e)=>{
this.props.ChangeTab(e);
}
@ -595,10 +594,10 @@ class ShixunStudentWork extends Component {
updatas={()=>this.getupdata()}
/>:""}
<DownloadMessage
{...this.props}
refs="DownloadMessage"
/>
{/*<DownloadMessage*/}
{/* {...this.props}*/}
{/* refs="DownloadMessage"*/}
{/*/>*/}
{/*立即发布*/}
<HomeworkModal
modaltype={this.state.modaltype}

@ -7,8 +7,8 @@ import ConclusionEvaluation from './shixunreport/ConclusionEvaluation';
import OfficialAcademicTranscript from './shixunreport/OfficialAcademicTranscript';
import Coursesshixundetails from './shixunreport/Coursesshixundetails';
import Shixunechart from './shixunreport/Shixunechart';
import DownloadMessageysl from "../../modals/DownloadMessageysl";
import {UnControlled as CodeMirror} from 'react-codemirror2';
import DownloadMessage from '../../modals/DownloadMessage';
import 'codemirror/mode/cmake/cmake';
import 'codemirror/mode/xml/xml';
import 'codemirror/mode/javascript/javascript';
@ -25,41 +25,48 @@ class ShixunWorkReport extends Component {
super(props);
this.state = {
data:undefined,
spinning:true
spinning:true,
DownloadType:false,
DownloadMessageval:undefined,
}
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
this.refs.DownloadMessage.confirmysl(url);
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
// 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.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
})
}
componentDidMount() {
this.setState({
@ -105,7 +112,14 @@ class ShixunWorkReport extends Component {
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}><div className="newMain clearfix ">
<div className={"educontent mb20" }>
<div className="educontent">
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<p className="clearfix mt20">
<WordsBtn to={"/courses/"+this.props.match.params.coursesId+"/students"} className="fl color-grey-9" style="btn colorgrey fl hovercolorblue">
<span className={"color-grey-9"}> {data&&data.course_name}</span>
</WordsBtn>
@ -119,10 +133,6 @@ class ShixunWorkReport extends Component {
<WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p>
</div>
<DownloadMessage
{...this.props}
ref="DownloadMessage"
/>
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname">{data&&data.shixun_name}</p>
{/*{this.props.isAdmin()?<a className=" fr font-14 ml30 mt10 mr20 color-grey-9 ">导出实训报告数据</a>:""}*/}

@ -26,7 +26,6 @@ import '../poll/pollStyle.css'
import moment from 'moment';
import 'moment/locale/zh-cn';
import Modals from "../../modals/Modals";
import DownloadMessage from '../../modals/DownloadMessage';
import Startshixuntask from "../coursesPublic/Startshixuntask";
const RadioGroup = Radio.Group;
@ -1714,35 +1713,6 @@ class Trainingjobsetting 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)
// });
}
testscripttip =(e)=>{
if(e === 0){
@ -1802,10 +1772,10 @@ class Trainingjobsetting extends Component {
issCancel={()=>this.hideshowmodel()}
/>:""}
<DownloadMessage
{...this.props}
ref="DownloadMessage"
/>
{/*<DownloadMessage*/}
{/* {...this.props}*/}
{/* ref="DownloadMessage"*/}
{/*/>*/}
{/*立即发布*/}
<HomeworkModal

@ -34,7 +34,6 @@ import CommonReply from "../common/comments/CommonReply";
import Homeworddescription from "../shixunHomework/Homeworddescription";
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import DownloadMessage from '../../modals/DownloadMessage';
import Startshixuntask from "../coursesPublic/Startshixuntask";
const TextArea = Input.TextArea
@ -317,34 +316,6 @@ class Workquestionandanswer 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);
}
@ -376,10 +347,10 @@ class Workquestionandanswer extends Component {
issCancel={() => this.hideshowmodel()}
updatas={() => this.isupdatas()}
/> : ""}
<DownloadMessage
{...this.props}
ref="DownloadMessage"
/>
{/*<DownloadMessage*/}
{/* {...this.props}*/}
{/* ref="DownloadMessage"*/}
{/*/>*/}
{/*立即发布*/}
<HomeworkModal
modaltype={this.state.modaltype}

@ -5,6 +5,7 @@ import { Modal} from 'antd';
import axios from 'axios';
class DownloadMessage extends Component {
constructor(props) {
super(props);
this.state = {
@ -20,12 +21,6 @@ class DownloadMessage extends Component {
window.open(`/users/${this.props.user.login}/private_messages`)
}
DownloadType=()=>{
this.setState({
DownloadType:false,
DownloadMessageval:undefined
})
}
Downloadcal=()=>{
this.setState({
DownloadType:false,

@ -0,0 +1,50 @@
import React, { Component } from 'react';
import { Modal} from 'antd';
class DownloadMessageysl extends Component {
constructor(props) {
super(props);
this.state = {
funmodalsType:false,
istype:false
}
}
setDownload=()=>{
this.props.modalCancel();
window.open(`/users/${this.props.user.login}/private_messages`)
}
render() {
return(
<Modal
keyboard={false}
title="提示"
visible={this.props.modalsType===undefined?false:this.props.modalsType}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width="530px"
>
<div className="task-popup-content">
{this.props.value===500?<p>
<p className="task-popup-text-center font-16">因附件资料超过500M您可以通过检索分批下载</p>
<p className="task-popup-text-center font-16 mt5">或者通过微信或者QQ联系管理员辅助您打包下载</p>
</p>:this.props.value===100?
<p>
<p className="task-popup-text-center font-16">已超出文件导出的上限数量 <span className={"color-orange-tip"}>100</span> </p>
<p className="task-popup-text-center font-16 mt20">1.通过检索分批次下载</p>
<p className="task-popup-text-center font-16 mt5">2.联系管理员辅助下载</p>
</p>
:""}
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.modalCancel}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.setDownload}>立即联系</a>
</div>
</div>
</Modal>
)
}
}
export default DownloadMessageysl;
Loading…
Cancel
Save