Merge remote-tracking branch 'origin/dev_jupyter' into dev_jupyter

chromesetting
杨树明 5 years ago
commit ea091baab0

File diff suppressed because one or more lines are too long

@ -109,15 +109,15 @@ export function initAxiosInterceptors(props) {
}
//
// console.log(config);
if (config.method === "post") {
if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// console.log(config);
// console.log(JSON.parse(config));
// console.log(config.url);
// console.log("被阻止了是重复请求=================================");
return false;
}
}
// if (config.method === "post") {
// if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// // console.log(config);
// // console.log(JSON.parse(config));
// // console.log(config.url);
// // console.log("被阻止了是重复请求=================================");
// return false;
// }
// }
// 非file_update请求
if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true;

@ -7,7 +7,7 @@ import TPMRightSection from './component/TPMRightSection';
import TPMNav from './component/TPMNav';
import axios from 'axios';
import './tpmmodel/tpmmodel.css'
import {getUploadActionUrl} from 'educoder';
import {getUploadActionUrl,appendFileSizeToUploadFileAll} from 'educoder';
import moment from 'moment';
const confirm = Modal.confirm;
@ -260,40 +260,26 @@ class TPMDataset extends Component {
if (index % 2 === 1) className = 'dark-row';
return className;
}
// 附件相关 START
handleChange = (info) => {
console.log("handleChange");
console.log(info);
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList} = this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1fileLists");
// if(fileList.length===0){
let fileLists = info.fileList;
// console.log(fileLists);
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList;
// for(var list of fileList ){
// console.log(list)
// }
this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList),
fileList: fileLists,
deleteisnot: false
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
if(info.file.status === 'done'){
//done 成功就会调用这个方法
this.getdatas();
// this.props.showNotification(`上传文件成功`);
}else if(info.file.status === 'removed'){
// this.props.showNotification(`上传文件失败`);
}else if(info.file.status === 'uploading'){
// this.props.showNotification(`正在上传文件中`);
}
}
}
onAttachmentRemove = (file) => {
// debugger
if(!file.percent || file.percent == 100){
@ -416,36 +402,16 @@ class TPMDataset extends Component {
action: `${getUploadActionUrl()}`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: (file, fileList) => {
if (this.state.fileList.length >= 1) {
return false
}
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
// this.props.showNotification(`文件大小必须小于50MB`);
notification.open(
{
message: '提示',
description:
'文件大小必须小于50MB',
}
)
}
if(this.state.file !== undefined){
console.log("763")
this.setState({
file:file
})
}else {
this.setState({
file:file
})
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},
}
};
return (
<React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80">
@ -477,7 +443,7 @@ class TPMDataset extends Component {
`
}
</style>
<div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest">
<div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest" type="upload">
上传文件</p> </Upload></div>
{

@ -244,6 +244,8 @@ class Challengesjupyter extends Component {
display: flex;
flex-direction:row-reverse;
}
;
}
`
}
</style>
@ -256,7 +258,7 @@ class Challengesjupyter extends Component {
<div className="sortinxdirection mt60">
<div className="renwuxiangssi sortinxdirection">
<div><p className="renwuxiangqdiv">任务详情</p></div>
<div><p className="renwuxiangqdivtest ml24">请将实训题目写在下方</p></div>
<div><p className="renwuxiangqdivtest ml24 shixunbingbaocun">请将实训题目写在下方并保存</p></div>
</div>
<div className="renwuxiangssit xaxisreverseorder">
<div className="challenbaocun" onClick={() => this.modifyjupyter(this.state)}><p

@ -75,3 +75,7 @@
font-size: 12px;
cursor:default
}
.shixunbingbaocun{
font-size:14px;
color:#888888;
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save