From 2f478edc4a85cd6834ed4f16ef1635f976e1b851 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 6 Jul 2019 10:49:07 +0800 Subject: [PATCH 1/6] css --- .../src/context/EvaluateSuccessEffectDisplay.js | 12 ++++++------ public/react/src/context/TPIContextProvider.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/react/src/context/EvaluateSuccessEffectDisplay.js b/public/react/src/context/EvaluateSuccessEffectDisplay.js index 8390ca77d..f09b6d2f2 100644 --- a/public/react/src/context/EvaluateSuccessEffectDisplay.js +++ b/public/react/src/context/EvaluateSuccessEffectDisplay.js @@ -51,16 +51,16 @@ class EvaluateSuccessEffectDisplay extends Component {
- Icon + {orignal_picture[0] && Icon}
- Icon + {user_picture[0] && Icon}
- Icon + { answer_picture[0] && Icon }
diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index 3cb725c34..938d3b60c 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -896,7 +896,7 @@ pop_box_new(htmlvalue, 480, 182); {/* mb20 加了有样式问题 */} { this.isSingleButton ?
+ style={{ textAlign: 'center', 'margin-bottom': '14px'}}> 知道啦 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 2/6] =?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 3/6] =?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 4/6] 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 5/6] 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 6/6] 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,