|
|
|
@ -2,7 +2,7 @@ import React, {Component} from 'react';
|
|
|
|
|
|
|
|
|
|
import {TPMIndexHOC} from '../TPMIndexHOC';
|
|
|
|
|
|
|
|
|
|
import {SnackbarHOC,appendFileSizeToUploadFileAll} from 'educoder';
|
|
|
|
|
import {SnackbarHOC,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder';
|
|
|
|
|
|
|
|
|
|
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification,Tooltip} from 'antd';
|
|
|
|
|
|
|
|
|
@ -757,19 +757,19 @@ class Newshixuns extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 附件相关 START
|
|
|
|
|
handleChange = (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("handleChange1");
|
|
|
|
|
if(fileList.length===0){
|
|
|
|
|
// if(fileList.length===0){
|
|
|
|
|
let fileLists = info.fileList;
|
|
|
|
|
this.setState({
|
|
|
|
|
// fileList:appendFileSizeToUploadFileAll(fileList),
|
|
|
|
|
fileList:fileLists,
|
|
|
|
|
deleteisnot:false});
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -872,10 +872,14 @@ class Newshixuns extends Component {
|
|
|
|
|
// https://github.com/ant-design/ant-design/issues/15505
|
|
|
|
|
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
|
|
|
|
|
// showUploadList: false,
|
|
|
|
|
action: `${getUrl()}/api/attachments.json`,
|
|
|
|
|
action: `${getUploadActionUrl()}`,
|
|
|
|
|
onChange: this.handleChange,
|
|
|
|
|
onRemove: this.onAttachmentRemove,
|
|
|
|
|
beforeUpload: (file) => {
|
|
|
|
|
beforeUpload: (file, fileList) => {
|
|
|
|
|
|
|
|
|
|
if (this.state.fileList.length >= 1) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
// console.log('beforeUpload', file.name);
|
|
|
|
|
const isLt150M = file.size / 1024 / 1024 < 50;
|
|
|
|
|
if (!isLt150M) {
|
|
|
|
|