|
|
|
@ -78,8 +78,11 @@ class CompetitionContentsMd extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
handleContentUploadChange = (info) => {
|
|
|
|
|
let contentFileList = info.fileList;
|
|
|
|
|
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
|
|
|
|
|
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
|
|
|
|
let contentFileList = info.fileList;
|
|
|
|
|
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onAttachmentRemove = (file, stateName) => {
|
|
|
|
@ -127,6 +130,10 @@ class CompetitionContentsMd extends Component{
|
|
|
|
|
handleSubmit = () => {
|
|
|
|
|
let {contentFileList}=this.state;
|
|
|
|
|
const mdContnet = this.contentMdRef.current.getValue().trim();
|
|
|
|
|
if(mdContnet.length>10000){
|
|
|
|
|
this.props.showNotification("内容超过10000个字");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let attachment_ids=undefined
|
|
|
|
|
if(contentFileList!=undefined){
|
|
|
|
|
attachment_ids= contentFileList.map(item => {
|
|
|
|
@ -184,7 +191,7 @@ class CompetitionContentsMd extends Component{
|
|
|
|
|
console.log('beforeUpload', file.name);
|
|
|
|
|
const isLt150M = file.size / 1024 / 1024 < 150;
|
|
|
|
|
if (!isLt150M) {
|
|
|
|
|
message.error('文件大小必须小于150MB!');
|
|
|
|
|
this.props.showNotification("文件大小必须小于150MB");
|
|
|
|
|
}
|
|
|
|
|
return isLt150M;
|
|
|
|
|
},
|
|
|
|
@ -203,7 +210,7 @@ class CompetitionContentsMd extends Component{
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
</Tabs>:""}
|
|
|
|
|
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入任务内容说明,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
|
|
|
|
|
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入任务内容说明,最大限制10000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
|
|
|
|
|
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
|
|
|
|
|
{this.props.module_type==="chart"?"":<Upload {...uploadProps} className="upload_1 newWorkUpload">
|
|
|
|
|
<Button className="uploadBtn">
|
|
|
|
|