dev_forum
杨树林 5 years ago
parent f102b5a8ad
commit 96970811d4

@ -1336,10 +1336,8 @@ class Listofworks extends Component {
});
}
// 导出实习报告批量
internshipreport = (url)=>{
console.log("internshipreport");
/// 确认是否下砸
confirmysl(url,type){
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
@ -1349,70 +1347,66 @@ class Listofworks extends Component {
console.log(e);
}
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1350");
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
console.log("1352");
console.log(response);
if(response.status&&response.status===-1){
}else if(response.status&&response.status===-2){
}else if(response.data.status&&response.data.status===-2){
console.log("1356");
console.log(response);
}else {
if(type === 1){
this.internshipreport(url,struy)
}else{
// window.location.href("/api"+url);
// console.log("开始下载zip文件")
this.Classstudentachievement(url,struy);
}
}
}).catch((error) => {
console.log(error)
});
}
// 导出实习报告批量
internshipreport = (url,struy)=>{
console.log("internshipreport");
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1350");
console.log(response);
const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
const blob = new Blob([response.data], { type: type });
const downloadElement = document.createElement('a');
const href = window.URL.createObjectURL(blob);
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
downloadElement.href = href;
downloadElement.download = string+struy+".zip";
document.body.appendChild(downloadElement);
downloadElement.click();
document.body.removeChild(downloadElement) ;// 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => {
console.log(error)
});
}
// 课堂学生成绩的导出下载
Classstudentachievement=(url)=>{
Classstudentachievement=(url,struy)=>{
console.log("Classstudentachievement");
// console.log();
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1397);
console.log(e);
}
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1374");
console.log(response);
if(response.status&&response.status===-1){
}else if(response.status&&response.status===-2){
}else{
const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
const blob = new Blob([response.data], { type: type });
const downloadElement = document.createElement('a');
const href = window.URL.createObjectURL(blob);
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
downloadElement.href = href;
downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
document.body.appendChild(downloadElement);
downloadElement.click();
document.body.removeChild(downloadElement); // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => {
console.log(error)
});
@ -1566,8 +1560,8 @@ class Listofworks extends Component {
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.internshipreport(`/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={()=>this.Classstudentachievement(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)} >学生成绩</a></li>
<li><a onClick={()=>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}`,1)}>实训报告</a></li>
<li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`,2)} >学生成绩</a></li>
</ul>
</li>:""}

@ -459,8 +459,16 @@ class ShixunStudentWork extends Component {
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid;
// let url = "/zip/shixun_report";
console.log("internshipreport");
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1347);
console.log(e);
}
axios.get(url).then((response) => {
console.log("326");
console.log(response);
@ -474,19 +482,10 @@ class ShixunStudentWork extends Component {
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
var now="";
try {
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
console.log(now);
} catch (e) {
console.log("1376");
}
downloadElement.download = string+now+".zip"
downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
@ -501,8 +500,16 @@ class ShixunStudentWork extends Component {
// 课堂学生成绩的导出下载
Classstudentachievement = (url) => {
console.log("Classstudentachievement");
// const course_id = this.props.match.params.coursesId;
// let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx";
// console.log();
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1397);
console.log(e);
}
axios.get(url).then((response) => {
console.log("1374");
console.log(response);
@ -516,21 +523,10 @@ class ShixunStudentWork extends Component {
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名
// console.log("1409");
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
var now="";
try {
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
console.log("1422");
console.log(now);
} catch (e) {
console.log("1432");
}
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
downloadElement.download =string+now+".xlsx";
downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素

@ -33,40 +33,39 @@ class ShixunWorkReport extends Component {
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid;
// let url = "/zip/shixun_report";
axios.get(url).then((response) => {
console.log("326");
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1347);
console.log(e);
}
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1350");
console.log(response);
if(response.data.status&&response.data.status===-1){
if(response.status&&response.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else if(response.status&&response.status===-2){
}else{
// window.location.href("/api"+url);
// console.log("开始下载zip文件")
const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
var now="";
try {
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
console.log(now);
} catch (e) {
console.log("1376");
}
downloadElement.download = string+now+".zip"
downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => {
console.log(error)
});

@ -1612,40 +1612,39 @@ class Trainingjobsetting extends Component {
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid;
// let url = "/zip/shixun_report";
axios.get(url).then((response) => {
console.log("326");
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1347);
console.log(e);
}
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1350");
console.log(response);
if(response.data.status&&response.data.status===-1){
if(response.status&&response.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else if(response.status&&response.status===-2){
}else{
// window.location.href("/api"+url);
// console.log("开始下载zip文件")
const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
var now="";
try {
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
console.log(now);
} catch (e) {
console.log("1376");
}
downloadElement.download = string+now+".zip"
downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => {
console.log(error)
});
@ -1654,41 +1653,38 @@ class Trainingjobsetting extends Component {
// 课堂学生成绩的导出下载
Classstudentachievement = (url) => {
console.log("Classstudentachievement");
// const course_id = this.props.match.params.coursesId;
// let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx";
axios.get(url).then((response) => {
// console.log();
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1397);
console.log(e);
}
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1374");
console.log(response);
if(response.data.status&&response.data.status===-1){
if(response.status&&response.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else if(response.status&&response.status===-2){
}else{
const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名
// console.log("1409");
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
var now="";
try {
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
console.log("1422");
console.log(now);
} catch (e) {
console.log("1432");
}
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
downloadElement.download =string+now+".xlsx";
downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => {
console.log(error)

@ -323,40 +323,39 @@ class Workquestionandanswer extends Component {
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid;
// let url = "/zip/shixun_report";
axios.get(url).then((response) => {
console.log("326");
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1347);
console.log(e);
}
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1350");
console.log(response);
if(response.data.status&&response.data.status===-1){
if(response.status&&response.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else if(response.status&&response.status===-2){
}else{
// window.location.href("/api"+url);
// console.log("开始下载zip文件")
const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
var now="";
try {
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
console.log(now);
} catch (e) {
console.log("1376");
}
downloadElement.download = string+now+".zip"
downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => {
console.log(error)
});
@ -365,41 +364,38 @@ class Workquestionandanswer extends Component {
// 课堂学生成绩的导出下载
Classstudentachievement = (url) => {
console.log("Classstudentachievement");
// const course_id = this.props.match.params.coursesId;
// let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx";
axios.get(url).then((response) => {
// console.log();
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
struy=struy.replace(/-/g,"");
}catch (e) {
console.log(1397);
console.log(e);
}
axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1374");
console.log(response);
if(response.data.status&&response.data.status===-1){
if(response.status&&response.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else if(response.status&&response.status===-2){
}else{
const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名
// console.log("1409");
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
var now="";
try {
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
console.log("1422");
console.log(now);
} catch (e) {
console.log("1432");
}
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
downloadElement.download =string+now+".xlsx";
downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => {
console.log(error)

@ -62,6 +62,8 @@ class EducoderLogin extends Component {
this.state = {
showbool: 3,
logini:3,
namezh:"",
passmm:""
}
}else {
if(props.match.url === "/login"){
@ -69,6 +71,8 @@ class EducoderLogin extends Component {
showbool: 1,
loginstatus:true,
logini:1,
namezh:"",
passmm:""
}
}else if(props.match.url === "/register"){
@ -76,11 +80,15 @@ class EducoderLogin extends Component {
showbool: 1,
loginstatus:false,
logini:2,
namezh:"",
passmm:""
}
}else{
this.state = {
showbool: 1,
logini:1,
namezh:"",
passmm:""
}
}
@ -101,14 +109,16 @@ class EducoderLogin extends Component {
})
}
Setshowbool = (e) => {
Setshowbool = (e,name,pass) => {
if (e===1) {
this.setState({
showbool: 1
})
} else if(e===2) {
this.setState({
showbool: 2
showbool: 2,
namezh:name,
passmm:pass,
})
}else if(e===3){
this.setState({

@ -25,6 +25,8 @@ class InterestpageComponent extends Component {
gouxuans: 0,
gouxuans2:0,
gouxuans3:[{id:1,name:"前端开发",bool:false,url:qdkf},{id:2,name:"后端开发",bool:false,url:hdkf},{id:3,name:"移动开发",bool:false,url:ydkf},{id:4,name:"数据库",bool:false,url:sjk},{id:5,name:"云计算和大数据",bool:false,url:ysj},{id:6,name:"运维与测试",bool:false,url:yunwei},{id:7,name:"人工智能",bool:false,url:rgzn},{id:8,name:"其他",bool:false,url:qita}],
namezh:this.props.namezh,
passmm:this.props.passmm,
}
}
Clickteacher=(e)=>{
@ -63,6 +65,34 @@ class InterestpageComponent extends Component {
})
}
//跳转然后登入
Jumptotheinterestpage=(username,password)=>{
var url = "/accounts/login.json";
axios.post(url, {
login: username,
password: password,
}).then((response) => {
if (response === undefined) {
return
}
if (response.status === 200) {
if (response.data.status === 402) {
window.location.href = response.data.url;
} else {
broadcastChannelPostMessage('refreshPage')
this.setState({
isRender: false
})
window.location.href = "/"
}
}
}).catch((error) => {
})
}
render() {
const {
gouxuans,

@ -344,8 +344,8 @@ class LoginRegisterComponent extends Component {
passwords: "",
Agreetotheterms: "",
})
this.props.history.push(result.data.redirect_uri);
//this.props.Setshowbool(2);
// this.props.history.push(result.data.redirect_uri);
this.props.Setshowbool(2,this.state.logins,this.state.passwords);
} catch (e) {
}
@ -662,7 +662,7 @@ class LoginRegisterComponent extends Component {
<div className="left_right mt25 font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a onClick={this.StudyMakeMoney}
<a onClick={()=>this.StudyMakeMoney()}
className="mr3 color-grey-9 mt3 font-12">找回密码</a>
</div>

Loading…
Cancel
Save