chromesetting
杨树林 5 years ago
parent 4867ee118a
commit 58ef9161f8

File diff suppressed because one or more lines are too long

@ -483,8 +483,8 @@ class GraduationTasksnew extends Component {
</style> </style>
<Upload {...uploadProps} className="upload_1 ml5"> <Upload {...uploadProps} className="upload_1 ml5">
<Button className="uploadBtn"> <Button className="uploadBtn">
<Icon type="upload"/> 上传附件 <Icon type="upload"/> 上传附件
</Button> </Button>
(单个文件150M以内) (单个文件150M以内)
</Upload> </Upload>

@ -7,7 +7,7 @@ import TPMRightSection from './component/TPMRightSection';
import TPMNav from './component/TPMNav'; import TPMNav from './component/TPMNav';
import axios from 'axios'; import axios from 'axios';
import './tpmmodel/tpmmodel.css' import './tpmmodel/tpmmodel.css'
import {getUploadActionUrl} from 'educoder'; import {getUploadActionUrl,appendFileSizeToUploadFileAll} from 'educoder';
import moment from 'moment'; import moment from 'moment';
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -260,40 +260,26 @@ class TPMDataset extends Component {
if (index % 2 === 1) className = 'dark-row'; if (index % 2 === 1) className = 'dark-row';
return className; return className;
} }
// 附件相关 START
handleChange = (info) => { handleChange = (info) => {
console.log("handleChange"); if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
console.log(info); let fileList = info.fileList;
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList} = this.state; // for(var list of fileList ){
// console.log(list)
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { // }
console.log("handleChange1fileLists"); this.setState({
// if(fileList.length===0){ fileList: appendFileSizeToUploadFileAll(fileList),
let fileLists = info.fileList; });
// console.log(fileLists);
this.setState({
// fileList:appendFileSizeToUploadFileAll(fileList),
fileList: fileLists,
deleteisnot: false
});
}
if(info.file.status === 'done'){ if(info.file.status === 'done'){
//done 成功就会调用这个方法 //done 成功就会调用这个方法
this.getdatas(); this.getdatas();
// this.props.showNotification(`上传文件成功`); // this.props.showNotification(`上传文件成功`);
}else if(info.file.status === 'removed'){
// this.props.showNotification(`上传文件失败`);
}else if(info.file.status === 'uploading'){
// this.props.showNotification(`正在上传文件中`);
} }
} }
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
// debugger // debugger
if(!file.percent || file.percent == 100){ if(!file.percent || file.percent == 100){
@ -405,51 +391,27 @@ class TPMDataset extends Component {
width: 600, width: 600,
fileList, fileList,
data:{ data:{
attachtype: 2, attachtype: 2,
container_id:this.props.match.params.shixunId, container_id:this.props.match.params.shixunId,
container_type: "Shixun", container_type: "Shixun",
}, },
multiple: true, multiple: true,
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false, // showUploadList: false,
action: `${getUploadActionUrl()}`, action: `${getUploadActionUrl()}`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
beforeUpload: (file, fileList) => { beforeUpload: (file) => {
console.log("beforeUpload"); console.log('beforeUpload', file.name);
console.log(this.state.fileList); const isLt150M = file.size / 1024 / 1024 < 150;
console.log(this.state.fileList.length);
if (this.state.fileList.length >= 1) {
return false
}
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
if (!isLt150M) { if (!isLt150M) {
// this.props.showNotification(`文件大小必须小于50MB`); this.props.showNotification('文件大小必须小于150MB!');
notification.open(
{
message: '提示',
description:
'文件大小必须小于50MB',
}
)
}
if(this.state.file !== undefined){
console.log("763")
this.setState({
file:file
})
}else {
this.setState({
file:file
})
} }
return isLt150M; return isLt150M;
}, },
} };
return ( return (
<React.Fragment> <React.Fragment>
<div className="tpmComment educontent clearfix mt30 mb80"> <div className="tpmComment educontent clearfix mt30 mb80">
@ -481,7 +443,7 @@ class TPMDataset extends Component {
` `
} }
</style> </style>
<div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest"> <div className="deletebuttom intermediatecenter "> <Upload {...uploadProps}><p className="deletebuttomtest" type="upload">
上传文件</p> </Upload></div> 上传文件</p> </Upload></div>
{ {

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

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

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