+ style={{ textAlign: 'center', 'margin-bottom': '14px'}}>
知道啦
From 96970811d44d7a8d8f3a357373995e8c3718815c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 6 Jul 2019 14:06:47 +0800
Subject: [PATCH 02/34] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/shixunHomework/Listofworks.js | 98 ++++++-----
.../shixunHomework/ShixunStudentWork.js | 52 +++---
.../shixunHomework/ShixunWorkReport.js | 35 ++--
.../shixunHomework/Trainingjobsetting.js | 152 +++++++++---------
.../shixunHomework/Workquestionandanswer.js | 70 ++++----
.../react/src/modules/login/EducoderLogin.js | 14 +-
public/react/src/modules/user/Interestpage.js | 30 ++++
.../modules/user/LoginRegisterComponent.js | 6 +-
8 files changed, 239 insertions(+), 218 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index 5dd049441..a9c783994 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -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");
- console.log(response);
- if(response.status&&response.status===-1){
-
+ axios.get(url).then((response) => {
+ if(response.data.status&&response.data.status===-1){
+ console.log("1352");
+ console.log(response);
- }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{
+ this.Classstudentachievement(url,struy);
+ }
+ }
+ }).catch((error) => {
+ console.log(error)
+ });
+ }
+ // 导出实习报告批量
+ internshipreport = (url,struy)=>{
+ console.log("internshipreport");
- }else{
- // window.location.href("/api"+url);
- // console.log("开始下载zip文件")
+ 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{
+ console.log("1374");
+ console.log(response);
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()?
导出
:""}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index 3ac1b0bd2..992a957cf 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -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) // 下载完成移除元素
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
index 9c6ea2421..0d9b4de8f 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
@@ -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)
});
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index f7f7c80e5..97e8d9aa9 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -1611,88 +1611,84 @@ 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");
- console.log(response);
- if(response.data.status&&response.data.status===-1){
-
-
- }else if(response.data.status&&response.data.status===-2){
-
- }else{
- 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]);
- 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"
- document.body.appendChild(downloadElement)
- downloadElement.click()
- document.body.removeChild(downloadElement) // 下载完成移除元素
- window.URL.revokeObjectURL(href) // 释放掉blob对象
- }
-
- }).catch((error) => {
- console.log(error)
- });
+ 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),{responseType: 'blob'}).then((response) => {
+ console.log("1350");
+ console.log(response);
+ if(response.status&&response.status===-1){
+
+
+ }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)
+ 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) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放掉blob对象
+ }
+ }).catch((error) => {
+ console.log(error)
+ });
}
// 课堂学生成绩的导出下载
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("1374");
- console.log(response);
- if(response.data.status&&response.data.status===-1){
-
-
- }else if(response.data.status&&response.data.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");
- }
- downloadElement.href = href
- downloadElement.download =string+now+".xlsx";
- document.body.appendChild(downloadElement)
- downloadElement.click()
- document.body.removeChild(downloadElement) // 下载完成移除元素
- window.URL.revokeObjectURL(href) // 释放掉blob对象
-
- }
- }).catch((error) => {
- console.log(error)
- });
+ 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 string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ console.log(response.headers['content-disposition'].split('=')[1]);
+ downloadElement.href = href
+ 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)
+ });
}
diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
index 5137351d2..63fa30370 100644
--- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
+++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
@@ -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)
diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js
index 10d792aa2..7d9a0be9d 100644
--- a/public/react/src/modules/login/EducoderLogin.js
+++ b/public/react/src/modules/login/EducoderLogin.js
@@ -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({
diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js
index 0d01ab563..c8ffa266d 100644
--- a/public/react/src/modules/user/Interestpage.js
+++ b/public/react/src/modules/user/Interestpage.js
@@ -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,
diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js
index 54185c9ed..5b8fc025b 100644
--- a/public/react/src/modules/user/LoginRegisterComponent.js
+++ b/public/react/src/modules/user/LoginRegisterComponent.js
@@ -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 {
From 034e725fd1d51480768e85168d95a6bc15f9fbb1 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Sat, 6 Jul 2019 14:17:39 +0800
Subject: [PATCH 03/34] =?UTF-8?q?=E7=BB=93=E6=9D=9F=E6=97=B6=E9=97=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/modules/courses/busyWork/CommonWorkSetting.js | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js
index 56eabb375..056f58574 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js
@@ -1149,7 +1149,8 @@ class CommonWorkSetting extends Component{
结束时间:
-
+ {/*
+ */}
// {
// const end_time = this.state.end_time
@@ -1172,7 +1174,7 @@ class CommonWorkSetting extends Component{
// }
/>
-
+
(学生“延时”提交作品的时间截点)
{
{latetimetype}
}
From aab2c160e53931ab9f805da937b563466cd4be85 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Sat, 6 Jul 2019 14:22:54 +0800
Subject: [PATCH 04/34] =?UTF-8?q?=E9=9D=A2=E5=8C=85=E5=B1=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/courses/busyWork/NewWork.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/NewWork.js b/public/react/src/modules/courses/busyWork/NewWork.js
index 462bebaa1..3bb77dfb5 100644
--- a/public/react/src/modules/courses/busyWork/NewWork.js
+++ b/public/react/src/modules/courses/busyWork/NewWork.js
@@ -38,7 +38,8 @@ class NewWork extends Component{
}
}
fetchCourseData = (courseId) => {
- const url = `/courses/${courseId}/homework_commons/new.json?type=1`
+ const isGroup = this.props.isGroup()
+ const url = `/courses/${courseId}/homework_commons/new.json?type=${isGroup ? 3 : 1}`
axios.get(url, {
})
.then((response) => {
@@ -369,7 +370,8 @@ class NewWork extends Component{
*/}
From 153e0de4c97901c25abb148df33c34f4a63c293c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 6 Jul 2019 14:36:33 +0800
Subject: [PATCH 05/34] b
---
.../courses/shixunHomework/Httpdownloads.js | 21 ++++
.../courses/shixunHomework/Listofworks.js | 102 +++++++++---------
public/react/src/modules/user/Interestpage.js | 1 -
3 files changed, 73 insertions(+), 51 deletions(-)
create mode 100644 public/react/src/modules/courses/shixunHomework/Httpdownloads.js
diff --git a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js
new file mode 100644
index 000000000..0ec5032c8
--- /dev/null
+++ b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js
@@ -0,0 +1,21 @@
+import {Base64} from 'js-base64';
+import axios from 'axios';
+
+
+// 导出实习报告批量zip 类型
+export function Internshipreportsy (url,struy,types,stingtype){
+ axios.get((url),{responseType: 'blob'}).then((response) => {
+ const blob = new Blob([response.data], { type: stingtype });
+ const downloadElement = document.createElement('a');
+ const href = window.URL.createObjectURL(blob);
+ const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ downloadElement.href = href;
+ downloadElement.download = string+struy+types;
+ document.body.appendChild(downloadElement);
+ downloadElement.click();
+ document.body.removeChild(downloadElement) ;// 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放掉blob对象
+ }).catch((error) => {
+ console.log(error)
+ });
+}
\ No newline at end of file
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index a9c783994..fd96ea25e 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -5,6 +5,7 @@ import TraineetraininginformationModal from './TraineetraininginformationModal';
import ModulationModal from "../coursesPublic/ModulationModal";
import HomeworkModal from "../coursesPublic/HomeworkModal";
import {Base64} from 'js-base64';
+import {Internshipreportsy} from './Httpdownloads'
import {
Form,
Select,
@@ -1336,7 +1337,7 @@ class Listofworks extends Component {
});
}
- /// 确认是否下砸
+ /// 确认是否下载
confirmysl(url,type){
var struy="";
try {
@@ -1348,6 +1349,7 @@ class Listofworks extends Component {
}
axios.get(url).then((response) => {
+ console.log(response);
if(response.data.status&&response.data.status===-1){
console.log("1352");
console.log(response);
@@ -1357,60 +1359,60 @@ class Listofworks extends Component {
console.log(response);
}else {
if(type === 1){
- this.internshipreport(url,struy)
+ Internshipreportsy(url,struy,".zip",'application/zip');
}else{
- this.Classstudentachievement(url,struy);
+ Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
}
}
- }).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 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) ;// 下载完成移除元素
- window.URL.revokeObjectURL(href) // 释放掉blob对象
- }).catch((error) => {
+ }).catch((error) => {
console.log(error)
- });
- }
- // 课堂学生成绩的导出下载
- Classstudentachievement=(url,struy)=>{
- console.log("Classstudentachievement");
- axios.get((url),{responseType: 'blob'}).then((response) => {
- console.log("1374");
- console.log(response);
- 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 string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
- console.log(response.headers['content-disposition'].split('=')[1]);
- downloadElement.href = href;
- 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)
- });
+ });
}
+ // 导出实习报告批量
+ // internshipreport = (url,struy,types,stingtype)=>{
+ // 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: stingtype });
+ // 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+types;
+ // document.body.appendChild(downloadElement);
+ // downloadElement.click();
+ // document.body.removeChild(downloadElement) ;// 下载完成移除元素
+ // window.URL.revokeObjectURL(href) // 释放掉blob对象
+ // }).catch((error) => {
+ // console.log(error)
+ // });
+ // }
+ // // 课堂学生成绩的导出下载
+ // Classstudentachievement=(url,struy)=>{
+ // console.log("Classstudentachievement");
+ // axios.get((url),{responseType: 'blob'}).then((response) => {
+ // console.log("1374");
+ // console.log(response);
+ // 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 string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ // console.log(response.headers['content-disposition'].split('=')[1]);
+ // downloadElement.href = href;
+ // 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)
+ // });
+ // }
render() {
// console.log("Listofworks.js000")
diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js
index c8ffa266d..d058d5881 100644
--- a/public/react/src/modules/user/Interestpage.js
+++ b/public/react/src/modules/user/Interestpage.js
@@ -79,7 +79,6 @@ class InterestpageComponent extends Component {
if (response.data.status === 402) {
window.location.href = response.data.url;
} else {
- broadcastChannelPostMessage('refreshPage')
this.setState({
isRender: false
})
From febb2002439508523c5bd39977a1ee21985884c9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 6 Jul 2019 14:40:33 +0800
Subject: [PATCH 06/34] b
---
.../courses/shixunHomework/Httpdownloads.js | 2 +-
.../courses/shixunHomework/Listofworks.js | 31 ++++++++++---------
2 files changed, 17 insertions(+), 16 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js
index 0ec5032c8..11bd91f6b 100644
--- a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js
+++ b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js
@@ -2,7 +2,7 @@ import {Base64} from 'js-base64';
import axios from 'axios';
-// 导出实习报告批量zip 类型
+// 导出实习报告批量zip 、xlsx 类型
export function Internshipreportsy (url,struy,types,stingtype){
axios.get((url),{responseType: 'blob'}).then((response) => {
const blob = new Blob([response.data], { type: stingtype });
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index fd96ea25e..f09256230 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -1349,21 +1349,22 @@ class Listofworks extends Component {
}
axios.get(url).then((response) => {
- console.log(response);
- if(response.data.status&&response.data.status===-1){
- console.log("1352");
- console.log(response);
-
- }else if(response.data.status&&response.data.status===-2){
- console.log("1356");
- console.log(response);
- }else {
- if(type === 1){
- Internshipreportsy(url,struy,".zip",'application/zip');
- }else{
- Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
- }
- }
+ if(response !== undefined){
+ if(response.data.status&&response.data.status===-1){
+ console.log("1352");
+ console.log(response);
+
+ }else if(response.data.status&&response.data.status===-2){
+ console.log("1356");
+ console.log(response);
+ }else {
+ if(type === 1){
+ Internshipreportsy(url,struy,".zip",'application/zip');
+ }else{
+ Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+ }
+ }
+ }
}).catch((error) => {
console.log(error)
});
From 458d026f858297d52c6fc90e2cb8e65118bb43fe Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Sat, 6 Jul 2019 14:42:54 +0800
Subject: [PATCH 07/34] isAppeal
---
public/react/src/modules/courses/busyWork/CommonWorkList.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index 3dd3f8d7d..67da6c549 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -58,8 +58,9 @@ function buildColumns(that, student_works) {
const isAdminOrStudent = that.props.isAdminOrStudent()
const isStudent = that.props.isStudent()
const isNiPing = homework_status && homework_status.indexOf('匿评中') != -1
+ const isAppeal = homework_status && homework_status.indexOf('申诉中') != -1
// https://www.trustie.net/issues/21450 分组作业作品列表 学时视角,匿评阶段的列表显示信息不正确
- const niPingAndIsStudent = isStudent && isNiPing
+ const niPingAndIsStudent = isStudent && (isNiPing || isAppeal)
let columns = [{
width: 60,
From da7b009af429fcbdb0cdc2f2b2b5b6a1bd1ab4ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 6 Jul 2019 14:54:21 +0800
Subject: [PATCH 08/34] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../shixunHomework/ShixunhomeWorkItem.js | 4 +-
.../tpm/challengesnew/TPMchallengesnew.js | 192 +-----
.../modules/tpm/shixuns/ShixunSearchBar.js | 612 +++++++++---------
.../src/modules/tpm/shixuns/ShixunsIndex.js | 16 +-
4 files changed, 334 insertions(+), 490 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
index 3a2366848..459a88e5e 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
@@ -356,9 +356,9 @@ class ShixunhomeWorkItem extends Component{
`
}
- {this.props.isAdmin?
+ {this.props.isAdmin?
:""}
diff --git a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js
index 465454128..7923f0702 100644
--- a/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js
+++ b/public/react/src/modules/tpm/challengesnew/TPMchallengesnew.js
@@ -6,6 +6,8 @@ import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
// import "antd/dist/antd.css";
+import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
+
import axios from 'axios';
import './css/TPMchallengesnew.css';
@@ -28,129 +30,10 @@ const Option = Select.Option;
const RadioGroup = Radio.Group;
-// 恢复数据
-function md_rec_data(k,mdu,id, editor){
- if(window.sessionStorage.getItem(k+mdu) !== null){
- editor.setValue(window.sessionStorage.getItem(k+mdu));
- md_clear_data(k,mdu,id);
- }
-}
-
-// 保存数据
-function md_add_data(k,mdu,d){
- window.sessionStorage.setItem(k+mdu,d);
-}
-
-// 清空保存的数据
-function md_clear_data(k,mdu,id){
- window.sessionStorage.removeItem(k+mdu);
- var id1 = "#e_tip_"+id;
- var id2 = "#e_tips_"+id;
- if(k == 'content'){
- $(id2).html("");
- }else{
- $(id1).html("");
- }
-}
-
-function md_elocalStorage(editor,mdu,id){
- if (window.sessionStorage){
- var oc = window.sessionStorage.getItem('content'+mdu);
- if(oc !== null ){
-
- $("#e_tips_"+id).data('editor', editor);
- var h = '您上次有已保存的数据,是否
恢复 ? /
不恢复';
- $("#e_tips_"+id).html(h);
- }
- setInterval(function() {
- var d = new Date();
- var h = d.getHours();
- var m = d.getMinutes();
- var s = d.getSeconds();
- h = h < 10 ? '0' + h : h;
- m = m < 10 ? '0' + m : m;
- s = s < 10 ? '0' + s : s;
- if(editor.getValue().trim() != ""){
- md_add_data("content",mdu,editor.getValue());
- var id1 = "#e_tip_"+id;
- var id2 = "#e_tips_"+id;
-
- $(id1).html(" 数据已于 " + h + ':' + m + ':' + s +" 保存 ");
- $(id2).html("");
- }
- },10000);
-
- }else{
- $("#e_tip_"+id).after('您的浏览器不支持localStorage.无法开启自动保存草稿服务,请升级浏览器!');
- }
-}
-
-
-function create_editorMD(id, width, high, placeholder, imageUrl, callback) {
- var editorName = window.editormd(id, {
- width: width,
- height: high,
- path: path, // "/editormd/lib/"
-
- syncScrolling: "single",
- tex: true,
- tocm: true,
- emoji: true,
- taskList: true,
- codeFold: true,
- searchReplace: true,
- htmlDecode: "style,script,iframe",
- sequenceDiagram: true,
- autoFocus: false,
- toolbarIcons: function () {
- // Or return editormd.toolbarModes[name]; // full, simple, mini
- // Using "||" set icons align right.
- return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear"]
- },
- toolbarCustomIcons: {
- testIcon: "
",
- testIcon1: "
"
- },
- //这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
- saveHTMLToTextarea: true,
- // 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
- dialogMaskOpacity: 0.6,
- placeholder: placeholder,
- imageUpload: true,
- imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
- imageUploadURL: imageUrl,//url
- onload: function () {
- // this.previewing();
- $("#" + id + " [type=\"latex\"]").bind("click", function () {
- editorName.cm.replaceSelection("```latex");
- editorName.cm.replaceSelection("\n");
- editorName.cm.replaceSelection("\n");
- editorName.cm.replaceSelection("```");
- var __Cursor = editorName.cm.getDoc().getCursor();
- editorName.cm.setCursor(__Cursor.line - 1, 0);
- });
-
- $("#" + id + " [type=\"inline\"]").bind("click", function () {
- editorName.cm.replaceSelection("$$$$");
- var __Cursor = editorName.cm.getDoc().getCursor();
- editorName.cm.setCursor(__Cursor.line, __Cursor.ch - 2);
- editorName.cm.focus();
- });
- $("[type=\"inline\"]").attr("title", "行内公式");
- $("[type=\"latex\"]").attr("title", "多行公式");
-
- md_elocalStorage(editorName, `exercise__${id}`, "Memochallengesnew");
-
- callback && callback()
- }
- });
- return editorName;
-}
-
-
export default class TPMchallengesnew extends Component {
constructor(props) {
super(props)
+ this.exercisememoMDRef=React.createRef();
this.state = {
choice_url: undefined,
practice_url: undefined,
@@ -180,52 +63,6 @@ export default class TPMchallengesnew extends Component {
}
- exerciseMD(initValue, id) {
-
- this.contentChanged = false;
- const placeholder = "";
- // amp;
- // 编辑时要传memoId
- const imageUrl = `/api/attachments.json`;
- // 创建editorMd
-
- const exercise_editormd = create_editorMD(id, '100%', 400, placeholder, imageUrl, () => {
- setTimeout(() => {
- exercise_editormd.resize()
- exercise_editormd.cm && exercise_editormd.cm.refresh()
- }, 500)
-
- if (initValue != undefined) {
- exercise_editormd.setValue(initValue)
- }
- exercise_editormd.cm.on("change", (_cm, changeObj) => {
- console.log('....contentChanged')
- this.contentChanged = true;
- })
- });
- this.exercise_editormd = exercise_editormd;
- window.exercise_editormd = exercise_editormd;
-
- }
-
- formatSearch = (url) => {
- if (typeof url !== "undefined") {
- url = url.substr(1); //从起始索引号提取字符串中指定数目的字符
- var arr = url.split("&"), //把字符串分割为字符串数组
- obj = {},
- newarr = [];
- arr.forEach(function (v, i) { //数组遍历
- // console.log(v);
- // console.log(i);
- newarr = v.split("=");
- if (typeof obj[newarr[0]] === "undefined") {
- obj[newarr[0]] = newarr[1];
- }
- });
- return obj;
- }
- ;
- }
componentDidMount() {
let id = this.props.match.params.shixunId;
let checkpointId=this.props.match.params.checkpointId;
@@ -244,9 +81,11 @@ export default class TPMchallengesnew extends Component {
position: response.data.position,
task_pass_default: response.data.task_pass_default,
submit_url: response.data.submit_url,
- checkpointId:checkpointId
+ checkpointId:checkpointId,
+ exercisememoMDRefval:response.data.task_pass_default
})
- this.exerciseMD(response.data.task_pass_default, "exercisememoMD");
+
+ this.exercisememoMDRef.current.setValue(response.data.task_pass_default||'')
}).catch((error) => {
console.log(error)
});
@@ -296,11 +135,13 @@ export default class TPMchallengesnew extends Component {
exec_time:response.data.exec_time,
tab2url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=2",
tab3url: "/shixuns/" + id + "/challenges/"+checkpointId+"/tab=3",
+ exercisememoMDRefval:response.data.task_pass
})
if(response.data.power===false){
this.props.showSnackbar("你没有权限修改");
}
- this.exerciseMD(response.data.task_pass, "exercisememoMD");
+
+ this.exercisememoMDRef.current.setValue(response.data.task_pass||'')
}).catch((error) => {
console.log(error)
});
@@ -372,8 +213,7 @@ export default class TPMchallengesnew extends Component {
return
}
- const exercise_editormdvalue = this.exercise_editormd.getValue();
-
+ const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
let id = this.props.match.params.shixunId;
let url = "/shixuns/" + id + "/challenges.json";
@@ -457,7 +297,7 @@ export default class TPMchallengesnew extends Component {
let {shixunCreatePractice, shixunCreatePracticeGroup, onshixunsmarkvalue, shixunsskillvaluelist,checkpointId,exec_time} = this.state;
- const exercise_editormdvalue = this.exercise_editormd.getValue();
+ const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
let id = this.props.match.params.shixunId;
@@ -631,11 +471,9 @@ export default class TPMchallengesnew extends Component {
过关任务
-
+
+
diff --git a/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js b/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js
index 1f0e46d92..b05732e31 100644
--- a/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js
+++ b/public/react/src/modules/tpm/shixuns/ShixunSearchBar.js
@@ -1,306 +1,306 @@
-import React, { Component } from 'react';
-
-import { Select, Input } from 'antd';
-
-import 'antd/lib/style/index.css';
-
-import 'antd/lib/select/style/index.css';
-
-import 'antd/lib/input/style/index.css';
-
-import './shixunCss/ShixunSearchBar.css';
-
-import axios from 'axios';
-
-const $ = window.$;
-
-const Option = Select.Option;
-
-const Search = Input.Search;
-
-
-class ShixunSearchBar extends Component {
-
- constructor(props) {
- super(props)
- this.state = {
- status: undefined,
- diff: undefined,
- InputValue: undefined,
- shixunhoverData: [],
- shixunchildValues:'',
- shixunsearchAllvalue:"a",
- openStatus:false,
- openLevel:false
- }
-}
-
- //状态筛选
- status_search = (value) => {
- let newvalue = value;
- if (newvalue === "0") {
- newvalue = " "
- } else if (newvalue === "1") {
- newvalue = 2
- } else if (newvalue === "2") {
- newvalue = 1
- } else if (newvalue === "3") {
- newvalue = 3
- }
-
- this.setState({
- status: newvalue,
- openStatus:false
- })
- let list = [{'type': 1}, {'value': newvalue}];
- this.props.StatusEnquiry(list);
-}
-
- //难度筛选
-diff_search = (value) => {
- this.setState({
- diff: value,
- openLevel:false
- })
- let list=[{'type':2},{'value':value}];
- this.props.StatusEnquiry(list);
-}
-
- //输入框搜索
-Input_search = (value) => {
- this.setState({
- InputValue: value
- })
- this.props.OnSearchInput(value);
-}
- //查询
-shixunsearchAll = (e) => {
- let{shixunsearchAllvalue}=this.state;
- let id = e.target.value;
-
- if(shixunsearchAllvalue===id){
- return
- }
- if(id===0){
- id=" "
- this.setState({
- InputValue: " "
- })
- this.props.OnSearchInput("");
- }
- let list=[{'tag_level':1},{'tag_id':id}];
- if(id!=undefined){
- this.setState({
- shixunsearchAllvalue:id,
- shixunchildValues:""
- })
- this.props.Updatasearchlist(list);
- }
-
-}
-
- shixunsearchall=(e)=>{
- let{shixunsearchAllvalue}=this.state;
- let id = "a";
-
- if(shixunsearchAllvalue===id){
- return
- }
- this.setState({
- shixunsearchAllvalue:"a",
- shixunchildValues:""
- })
- this.props.allUpdatashixunlist();
- }
-
- //选择Tab页详情
-getshixunchildValue = (e) => {
- let id = e.target.name;
- let newid=e.target.id;
- let list=[{'tag_level':2},{'tag_id':id}];
- if(id!=undefined||newid!=undefined){
- this.setState({
- shixunsearchAllvalue:newid
- })
- this.props.Updatasearchlist(list);
- }
-}
-
-getshixunchildValues = (e) => {
- let id = e.target.id;
- let newid=e.target.name;
- let list=[{'tag_level':3},{'tag_id':id}];
- if(id!=undefined||newid!=undefined){
- this.setState({
- shixunchildValues:id,
- shixunsearchAllvalue:newid
- })
- this.props.Updatasearchlist(list);
- }
-
-}
-
-componentDidMount() {
- let hoverUrlArr = [];
- let hoverUrl = `/shixuns/menus.json`;
- axios.get(hoverUrl
- ).then((response) => {
- hoverUrlArr = response.data;
- hoverUrlArr.reverse();
- this.setState({
- shixunhoverData: hoverUrlArr
- })
- }).catch((error) => {
- console.log(error)
- })
-}
-
-
- // componentWillReceiveProps(nextProps) {
- // console.log(nextProps.parsedid)
- // if(nextProps.newtag_level===1){
- // this.setState({
- // InputValue: this.props.keyword,
- // shixunsearchAllvalue:nextProps.parsedid
- //
- // })
- // }else if(nextProps.newtag_level===2){
- // this.setState({
- // InputValue: this.props.keyword,
- // shixunsearchAllvalue:nextProps.newpalce,
- // shixunchildValues:nextProps.parsedid
- //
- // })
- // }else if(nextProps.newtag_level===3){
- // this.setState({
- // InputValue: this.props.keyword,
- // shixunsearchAllvalue:nextProps.newpalce,
- // shixunchildValues:nextProps.parsedid
- //
- // })
- // }
- //
- //
- // }
- openStatusOption=()=>{
- this.setState({
- openLevel:false,
- openStatus:true
- })
- }
- openLevelOption=()=>{
- this.setState({
- openLevel:true,
- openStatus:false
- })
- }
- openStatusOptions=()=>{
- this.setState({
- openLevel:false,
- openStatus:false
- })
- }
-
- Input_searchs = (e) => {
- this.setState({
- InputValue: e.target.value
- })
- }
-render() {
- let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state;
- let {typepvisible} = this.props;
- //实训首页筛选的移入和点击事件
- $(".shaiItem").hover(function(){
- var hei=parseInt($(".shaiAllItem").height())-2;
- $(this).find(".subshaicontent").css("top", '34px');
- $(this).find(".subshaicontent").show();
- },function(){
- $(this).find(".subshaicontent").hide();
- });
-
- $(".shaiItem").live("click",function(){
- $(".shaiItem").removeClass("active");
- $(this).addClass("active");
- $(".subshaicontent").hide();
- });
-
- $(".subshaicontent").live("click", function(event){
- $(".subshaicontent").hide();
- event.stopPropagation();
- });
- return (
-
-
-
-
-
方向:
-
-
全部
- {
- shixunhoverData.map((item,key)=>{
- return(
-
- {item.name}
-
- {
- item.sub_repertoires.map((list,k)=>{
- return(
-
- )
- })
- }
-
-
- )
- })
- }
-
-
-
-
筛选:
-
- {/**/}
-
-
- {/*
*/}
- {/* this.Input_search(value)}*/}
- {/*enterButton*/}
- {/*/>*/}
- {/*
*/}
-
-
-
-
- );
-}
-}
-
-export default ShixunSearchBar;
+import React, { Component } from 'react';
+
+import { Select, Input } from 'antd';
+
+import 'antd/lib/style/index.css';
+
+import 'antd/lib/select/style/index.css';
+
+import 'antd/lib/input/style/index.css';
+
+import './shixunCss/ShixunSearchBar.css';
+
+import axios from 'axios';
+
+const $ = window.$;
+
+const Option = Select.Option;
+
+const Search = Input.Search;
+
+
+class ShixunSearchBar extends Component {
+
+ constructor(props) {
+ super(props)
+ this.state = {
+ status: undefined,
+ diff: undefined,
+ InputValue: undefined,
+ shixunhoverData: [],
+ shixunchildValues:'',
+ shixunsearchAllvalue:"a",
+ openStatus:false,
+ openLevel:false
+ }
+}
+
+ //状态筛选
+ status_search = (value) => {
+ let newvalue = value;
+ if (newvalue === "0") {
+ newvalue = " "
+ } else if (newvalue === "1") {
+ newvalue = 2
+ } else if (newvalue === "2") {
+ newvalue = 1
+ } else if (newvalue === "3") {
+ newvalue = 3
+ }
+
+ this.setState({
+ status: newvalue,
+ openStatus:false
+ })
+ let list = [{'type': 1}, {'value': newvalue}];
+ this.props.StatusEnquiry(list);
+}
+
+ //难度筛选
+diff_search = (value) => {
+ this.setState({
+ diff: value,
+ openLevel:false
+ })
+ let list=[{'type':2},{'value':value}];
+ this.props.StatusEnquiry(list);
+}
+
+ //输入框搜索
+Input_search = (value) => {
+ this.setState({
+ InputValue: value
+ })
+ this.props.OnSearchInput(value);
+}
+ //查询
+shixunsearchAll = (e) => {
+ let{shixunsearchAllvalue}=this.state;
+ let id = e.target.value;
+
+ if(shixunsearchAllvalue===id){
+ return
+ }
+ if(id===0){
+ id=" "
+ this.setState({
+ InputValue: " "
+ })
+ this.props.OnSearchInput("");
+ }
+ let list=[{'tag_level':1},{'tag_id':id}];
+ if(id!=undefined){
+ this.setState({
+ shixunsearchAllvalue:id,
+ shixunchildValues:""
+ })
+ this.props.Updatasearchlist(list);
+ }
+
+}
+
+ shixunsearchall=(e)=>{
+ let{shixunsearchAllvalue}=this.state;
+ let id = "a";
+
+ if(shixunsearchAllvalue===id){
+ return
+ }
+ this.setState({
+ shixunsearchAllvalue:"a",
+ shixunchildValues:""
+ })
+ this.props.allUpdatashixunlist();
+ }
+
+ //选择Tab页详情
+ getshixunchildValue = (e) => {
+ let id = e.target.name;
+ let newid=e.target.id;
+ let list=[{'tag_level':2},{'tag_id':id}];
+ if(id!=undefined||newid!=undefined){
+ this.setState({
+ shixunsearchAllvalue:newid
+ })
+ this.props.Updatasearchlist(list);
+ }
+ }
+
+getshixunchildValues = (e) => {
+ let id = e.target.id;
+ let newid=e.target.name;
+ let list=[{'tag_level':3},{'tag_id':id}];
+ if(id!=undefined||newid!=undefined){
+ this.setState({
+ shixunchildValues:id,
+ shixunsearchAllvalue:newid
+ })
+ this.props.Updatasearchlist(list);
+ }
+
+}
+
+componentDidMount() {
+ let hoverUrlArr = [];
+ let hoverUrl = `/shixuns/menus.json`;
+ axios.get(hoverUrl
+ ).then((response) => {
+ hoverUrlArr = response.data;
+ hoverUrlArr.reverse();
+ this.setState({
+ shixunhoverData: hoverUrlArr
+ })
+ }).catch((error) => {
+ console.log(error)
+ })
+}
+
+
+ // componentWillReceiveProps(nextProps) {
+ // console.log(nextProps.parsedid)
+ // if(nextProps.newtag_level===1){
+ // this.setState({
+ // InputValue: this.props.keyword,
+ // shixunsearchAllvalue:nextProps.parsedid
+ //
+ // })
+ // }else if(nextProps.newtag_level===2){
+ // this.setState({
+ // InputValue: this.props.keyword,
+ // shixunsearchAllvalue:nextProps.newpalce,
+ // shixunchildValues:nextProps.parsedid
+ //
+ // })
+ // }else if(nextProps.newtag_level===3){
+ // this.setState({
+ // InputValue: this.props.keyword,
+ // shixunsearchAllvalue:nextProps.newpalce,
+ // shixunchildValues:nextProps.parsedid
+ //
+ // })
+ // }
+ //
+ //
+ // }
+ openStatusOption=()=>{
+ this.setState({
+ openLevel:false,
+ openStatus:true
+ })
+ }
+ openLevelOption=()=>{
+ this.setState({
+ openLevel:true,
+ openStatus:false
+ })
+ }
+ openStatusOptions=()=>{
+ this.setState({
+ openLevel:false,
+ openStatus:false
+ })
+ }
+
+ Input_searchs = (e) => {
+ this.setState({
+ InputValue: e.target.value
+ })
+ }
+render() {
+ let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state;
+ let {typepvisible} = this.props;
+ //实训首页筛选的移入和点击事件
+ $(".shaiItem").hover(function(){
+ var hei=parseInt($(".shaiAllItem").height())-2;
+ $(this).find(".subshaicontent").css("top", '34px');
+ $(this).find(".subshaicontent").show();
+ },function(){
+ $(this).find(".subshaicontent").hide();
+ });
+
+ $(".shaiItem").live("click",function(){
+ $(".shaiItem").removeClass("active");
+ $(this).addClass("active");
+ $(".subshaicontent").hide();
+ });
+
+ $(".subshaicontent").live("click", function(event){
+ $(".subshaicontent").hide();
+ event.stopPropagation();
+ });
+ return (
+
+
+
+
+
方向:
+
+
全部
+ {
+ shixunhoverData.map((item,key)=>{
+ return(
+
+ {item.name}
+
+ {
+ item.sub_repertoires.map((list,k)=>{
+ return(
+
+ )
+ })
+ }
+
+
+ )
+ })
+ }
+
+
+
+
筛选:
+
+ {/**/}
+
+
+ {/*
*/}
+ {/* this.Input_search(value)}*/}
+ {/*enterButton*/}
+ {/*/>*/}
+ {/*
*/}
+
+
+
+
+ );
+}
+}
+
+export default ShixunSearchBar;
diff --git a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js
index 2eab88053..5efd31c3b 100644
--- a/public/react/src/modules/tpm/shixuns/ShixunsIndex.js
+++ b/public/react/src/modules/tpm/shixuns/ShixunsIndex.js
@@ -41,7 +41,7 @@ class ShixunsIndex extends Component {
parsedid:undefined,
newtag_level:undefined,
newpalce:undefined,
- sort:undefined
+ sort:"desc"
}
}
componentDidMount(){
@@ -100,6 +100,8 @@ class ShixunsIndex extends Component {
}
allUpdatashixunlist=()=>{
+ let{sort}=this.state;
+
this.setState({
order_by: 'publish_time',
tag_level: 1,
@@ -109,8 +111,8 @@ class ShixunsIndex extends Component {
keyword:'',
status: 0,
diff: 0,
-
})
+
let params={
order_by: 'publish_time',
tag_level: 1,
@@ -120,6 +122,7 @@ class ShixunsIndex extends Component {
keyword:'',
status: 0,
diff: 0,
+ sort:sort
}
this.shixunresultend(params)
}
@@ -135,7 +138,7 @@ class ShixunsIndex extends Component {
typepvisible:true
})
- let {order_by, page, limit, keyword, status, diff} = this.state;
+ let {order_by, sort, limit, keyword, status, diff} = this.state;
let params={
order_by:order_by,
@@ -146,6 +149,7 @@ class ShixunsIndex extends Component {
keyword:keyword,
status:status,
diff:diff,
+ sort:sort
}
this.shixunresultend(params)
@@ -192,7 +196,7 @@ class ShixunsIndex extends Component {
typepvisible:true,
pages:1
})
- let {order_by, tag_level, tag_id, page, limit, status, diff} = this.state;
+ let {order_by, tag_level, tag_id, sort, limit, status, diff} = this.state;
let params= {
order_by:order_by,
tag_level:tag_level,
@@ -202,6 +206,7 @@ class ShixunsIndex extends Component {
keyword:value,
status:status,
diff:diff,
+ sort:sort
}
this.shixunresultend(params)
}else{
@@ -247,7 +252,7 @@ class ShixunsIndex extends Component {
typepvisible:true,
pages:value
})
- let {order_by, tag_level, tag_id, limit, keyword, status, diff} = this.state;
+ let {order_by, tag_level, tag_id, limit, keyword, status, diff,sort} = this.state;
let params= {
order_by:order_by,
tag_level:tag_level,
@@ -257,6 +262,7 @@ class ShixunsIndex extends Component {
keyword:keyword,
status:status,
diff:diff,
+ sort:sort
}
let Url=`/shixuns.json`;
From 9cc0edfd4b940a4a47ebed212182848edb66ac45 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Sat, 6 Jul 2019 14:54:26 +0800
Subject: [PATCH 09/34] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/user/Interestpage.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js
index d058d5881..562d77adf 100644
--- a/public/react/src/modules/user/Interestpage.js
+++ b/public/react/src/modules/user/Interestpage.js
@@ -2,6 +2,7 @@ import React, {Component} from 'react';
import {Button} from 'antd';
+import {broadcastChannelPostMessage} from 'educoder';
import axios from 'axios';
import './common.css'
import mytc from './img/mytc.png';
@@ -17,6 +18,7 @@ import ysj from './img/ysj.png';
import yunwei from './img/yunwei.png';
import rgzn from './img/rgzn.png';
import qita from './img/qita.png';
+
//父组件 EducoderLogin.js
class InterestpageComponent extends Component {
constructor(props) {
@@ -65,12 +67,14 @@ class InterestpageComponent extends Component {
})
}
+
+
//跳转然后登入
- Jumptotheinterestpage=(username,password)=>{
+ Jumptotheinterestpage=()=>{
var url = "/accounts/login.json";
axios.post(url, {
- login: username,
- password: password,
+ login: this.props.login,
+ password: this.props.password,
}).then((response) => {
if (response === undefined) {
return
@@ -79,6 +83,7 @@ class InterestpageComponent extends Component {
if (response.data.status === 402) {
window.location.href = response.data.url;
} else {
+ broadcastChannelPostMessage('refreshPage')
this.setState({
isRender: false
})
From 2950466dcececf4c2d3f532d9ebcd7f35be34f62 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Sat, 6 Jul 2019 14:57:11 +0800
Subject: [PATCH 10/34] - that.application_list.length
---
public/react/src/modules/courses/members/teacherList.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js
index 9e20bd64d..b741d6b12 100644
--- a/public/react/src/modules/courses/members/teacherList.js
+++ b/public/react/src/modules/courses/members/teacherList.js
@@ -37,7 +37,7 @@ function buildColumns(that) {
dataIndex: 'name',
key: 'index',
render: (content, item, index) => {
- return
{(that.state.page - 1) * 20 + index + 1}
+ return item.isApply == true ? '' :
{(that.state.page - 1) * 20 + index + 1 - that.application_list.length}
}
}
// ,{
@@ -546,6 +546,7 @@ class studentsList extends Component{
const combineArray = teachers.slice(0)
if (page == 1) {
this.state.application_list && this.state.application_list.slice(0).reverse().forEach(item => {
+ item.isApply = true
combineArray.unshift(item)
})
}
From c3d4478a4aef62738ea27b7b7e4e9d1fa271caf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 6 Jul 2019 15:14:20 +0800
Subject: [PATCH 11/34] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/public/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/public/index.html b/public/react/public/index.html
index 4925affe5..9871e341e 100755
--- a/public/react/public/index.html
+++ b/public/react/public/index.html
@@ -67,7 +67,7 @@
-
+