Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 5 years ago
commit 6a9cd9ba15

@ -51,16 +51,16 @@ class EvaluateSuccessEffectDisplay extends Component {
</div> </div>
<div className="clearfix" id="picture-content"> <div className="clearfix" id="picture-content">
<div className="fl with33 mr03precent pt10 mb50"> <div className="fl with33 mr03precent pt10 mb50">
<img alt="Icon" {orignal_picture[0] && <img alt="Icon"
src={orignal_picture[0].pic_url}/> src={ orignal_picture[0].pic_url}/>}
</div> </div>
<div className="fl with33 mr03precent pt10 mb50"> <div className="fl with33 mr03precent pt10 mb50">
<img alt="Icon" {user_picture[0] && <img alt="Icon"
src={user_picture[0].pic_url}/> src={ user_picture[0].pic_url }/>}
</div> </div>
<div className="fl with33 mr03precent pt10 mb50"> <div className="fl with33 mr03precent pt10 mb50">
<img alt="Icon" { answer_picture[0] && <img alt="Icon"
src={answer_picture[0].pic_url}/> src={ answer_picture[0].pic_url}/> }
</div> </div>
</div> </div>
</div> </div>

@ -896,7 +896,7 @@ pop_box_new(htmlvalue, 480, 182);
{/* mb20 加了有样式问题 */} {/* mb20 加了有样式问题 */}
<DialogActions className={""} id="dialog-actions"> <DialogActions className={""} id="dialog-actions">
{ this.isSingleButton ? <div className="task-popup-submit clearfix" { this.isSingleButton ? <div className="task-popup-submit clearfix"
style={{ textAlign: 'center' }}> style={{ textAlign: 'center', 'margin-bottom': '14px'}}>
<a className="task-btn task-btn-orange" <a className="task-btn task-btn-orange"
onClick={this.handleGdialogClose} onClick={this.handleGdialogClose}
>知道啦</a> >知道啦</a>

@ -58,8 +58,9 @@ function buildColumns(that, student_works) {
const isAdminOrStudent = that.props.isAdminOrStudent() const isAdminOrStudent = that.props.isAdminOrStudent()
const isStudent = that.props.isStudent() const isStudent = that.props.isStudent()
const isNiPing = homework_status && homework_status.indexOf('匿评中') != -1 const isNiPing = homework_status && homework_status.indexOf('匿评中') != -1
const isAppeal = homework_status && homework_status.indexOf('申诉中') != -1
// https://www.trustie.net/issues/21450 分组作业作品列表 学时视角,匿评阶段的列表显示信息不正确 // https://www.trustie.net/issues/21450 分组作业作品列表 学时视角,匿评阶段的列表显示信息不正确
const niPingAndIsStudent = isStudent && isNiPing const niPingAndIsStudent = isStudent && (isNiPing || isAppeal)
let columns = [{ let columns = [{
width: 60, width: 60,

@ -1149,7 +1149,8 @@ class CommonWorkSetting extends Component{
<div className={" mb10 ml30"}> <div className={" mb10 ml30"}>
<span>结束时间</span> <span>结束时间</span>
<ConditionToolTip condition={moment(init_late_time) < this.fetchMoment} title={"时间已过,不能再修改"}> {/* <ConditionToolTip condition={moment(init_late_time) < this.fetchMoment} title={""}>
</ConditionToolTip> */}
<span> <span>
<DatePicker <DatePicker
showToday={false} showToday={false}
@ -1163,7 +1164,8 @@ class CommonWorkSetting extends Component{
value={!late_time ? undefined :moment(late_time, dateFormat)} value={!late_time ? undefined :moment(late_time, dateFormat)}
onChange={this.onChangeTimelatetime} onChange={this.onChangeTimelatetime}
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
disabled={!allow_late || noAuth || moment(init_late_time) < moment()} // || moment(init_late_time) < moment()
disabled={!allow_late || noAuth }
// disabledDate={ (late_time) => // disabledDate={ (late_time) =>
// { // {
// const end_time = this.state.end_time // const end_time = this.state.end_time
@ -1172,7 +1174,7 @@ class CommonWorkSetting extends Component{
// } // }
/> />
</span> </span>
</ConditionToolTip>
<span className={"font-14 color-grey-9 ml10"}>学生延时提交作品的时间截点</span> <span className={"font-14 color-grey-9 ml10"}>学生延时提交作品的时间截点</span>
{<div className={"latetimetype color-red "}>{latetimetype}</div>} {<div className={"latetimetype color-red "}>{latetimetype}</div>}
</div> </div>

@ -38,7 +38,8 @@ class NewWork extends Component{
} }
} }
fetchCourseData = (courseId) => { 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, { axios.get(url, {
}) })
.then((response) => { .then((response) => {
@ -369,7 +370,8 @@ class NewWork extends Component{
</p> */} </p> */}
<CBreadcrumb items={[ <CBreadcrumb items={[
{ to: `/courses/${courseId}`, name: this.state.course_name}, { to: `/courses/${courseId}`, name: this.state.course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`, name: moduleName }, { to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`
, name: category && category.category_name },
{ name: `${ this.isEdit ? '编辑' : '新建'}` } { name: `${ this.isEdit ? '编辑' : '新建'}` }
]}></CBreadcrumb> ]}></CBreadcrumb>

@ -0,0 +1,21 @@
import {Base64} from 'js-base64';
import axios from 'axios';
// 导出实习报告批量zip 、xlsx 类型
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)
});
}

@ -5,6 +5,7 @@ import TraineetraininginformationModal from './TraineetraininginformationModal';
import ModulationModal from "../coursesPublic/ModulationModal"; import ModulationModal from "../coursesPublic/ModulationModal";
import HomeworkModal from "../coursesPublic/HomeworkModal"; import HomeworkModal from "../coursesPublic/HomeworkModal";
import {Base64} from 'js-base64'; import {Base64} from 'js-base64';
import {Internshipreportsy} from './Httpdownloads'
import { import {
Form, Form,
Select, Select,
@ -1336,7 +1337,7 @@ class Listofworks extends Component {
}); });
} }
/// 确认是否下 /// 确认是否下
confirmysl(url,type){ confirmysl(url,type){
var struy=""; var struy="";
try { try {
@ -1348,6 +1349,7 @@ class Listofworks extends Component {
} }
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response !== undefined){
if(response.data.status&&response.data.status===-1){ if(response.data.status&&response.data.status===-1){
console.log("1352"); console.log("1352");
console.log(response); console.log(response);
@ -1357,60 +1359,61 @@ class Listofworks extends Component {
console.log(response); console.log(response);
}else { }else {
if(type === 1){ if(type === 1){
this.internshipreport(url,struy) Internshipreportsy(url,struy,".zip",'application/zip');
}else{ }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) => {
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) => { }).catch((error) => {
console.log(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() { render() {
// console.log("Listofworks.js000") // console.log("Listofworks.js000")

@ -79,7 +79,6 @@ class InterestpageComponent extends Component {
if (response.data.status === 402) { if (response.data.status === 402) {
window.location.href = response.data.url; window.location.href = response.data.url;
} else { } else {
broadcastChannelPostMessage('refreshPage')
this.setState({ this.setState({
isRender: false isRender: false
}) })

Loading…
Cancel
Save