dev_forum
杨树林 6 years ago
parent 9b7feb29da
commit af6aba0328

@ -334,7 +334,7 @@ class Testpapersettinghomepage extends Component{
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<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}/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(`/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> <li><a onClick={()=>this.confirmysl(`/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval===null||this.state.groupyslsval===undefined?null:this.state.groupyslsval}`)}>学生答题试卷</a></li>
</ul> </ul>
</li>:""} </li>:""}
</div> </div>

@ -13,7 +13,7 @@ import Modals from "../../modals/Modals";
import axios from 'axios' import axios from 'axios'
import _ from 'lodash' import _ from 'lodash'
import NoneData from "../coursesPublic/NoneData" import NoneData from "../coursesPublic/NoneData"
import DownloadMessageysl from "../../modals/DownloadMessageysl";
import CreateGroupByImportModal from './modal/CreateGroupByImportModal' import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
const Search =Input.Search; const Search =Input.Search;
@ -131,10 +131,49 @@ class studentsList extends Component{
modalsBottomval:"", modalsBottomval:"",
modalCancel:"", modalCancel:"",
n_And_e:1, n_And_e:1,
isSpin:false isSpin:false,
DownloadType:false,
DownloadMessageval:undefined,
}
} }
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response === undefined){
return
} }
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
})
}
inputStudent=(e)=>{ inputStudent=(e)=>{
this.setState({ this.setState({
@ -490,6 +529,12 @@ class studentsList extends Component{
exportUrl += paramsString; exportUrl += paramsString;
return( return(
<React.Fragment > <React.Fragment >
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<Titlesearchsection <Titlesearchsection
title={isParent ? "学生列表" : title={isParent ? "学生列表" :
<React.Fragment> <React.Fragment>
@ -525,7 +570,7 @@ class studentsList extends Component{
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> } { isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> } { isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> } { isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="" href={`${exportUrl}`}>导出成绩</WordsBtn> } { isAdmin && <WordsBtn style="blue" className="" onClick={()=>this.confirmysl(exportUrl)} >导出成绩</WordsBtn> }
{/* */} {/* */}
</React.Fragment> </React.Fragment>
} }

@ -234,10 +234,10 @@ class ShixunHomeworkPage extends Component {
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}> <ul className="drop_down_menu" style={{"right": "-0px", "left": "unset", "height": "auto"}}>
<li><a <li><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> onClick={(url) => this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo===undefined ||this.state.course_groupyslstwo===null? null: this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo===undefined||this.state.checkedValuesineinfo===null? null:his.state.checkedValuesineinfo}&search=${this.state.searchtext===undefined||this.state.searchtext===null?null:this.state.searchtext}`)}>实训报告</a>
</li> </li>
<li><a <li><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> onClick={(url) => this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo===undefined||this.state.checkedValuesineinfo===null?null:this.state.checkedValuesineinfo}&search=${this.state.searchtext===undefined||this.state.searchtext=== null?null:this.state.searchtext}`)}>学生成绩</a>
</li> </li>
</ul> </ul>

@ -5,7 +5,7 @@ import { Modal} from 'antd';
import axios from 'axios'; import axios from 'axios';
class DownloadMessage extends Component { class DownloadMessage extends Component {
//没有修改菜世的 最后复原了
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {

Loading…
Cancel
Save