|
|
@ -212,7 +212,7 @@ class GraduationTasksSubmitedit extends Component{
|
|
|
|
this.setState({ fileList });
|
|
|
|
this.setState({ fileList });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onAttachmentRemove = (file) => {
|
|
|
|
//onAttachmentRemove = (file) => {
|
|
|
|
|
|
|
|
|
|
|
|
// confirm({
|
|
|
|
// confirm({
|
|
|
|
// title: '确定要删除这个附件吗?',
|
|
|
|
// title: '确定要删除这个附件吗?',
|
|
|
@ -228,14 +228,14 @@ class GraduationTasksSubmitedit extends Component{
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// return false;
|
|
|
|
// return false;
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
// this.setState({
|
|
|
|
Modalstype:true,
|
|
|
|
// Modalstype:true,
|
|
|
|
Modalstopval:'确定要删除这个附件吗?',
|
|
|
|
// Modalstopval:'确定要删除这个附件吗?',
|
|
|
|
ModalSave: ()=>this.deleteAttachment(file),
|
|
|
|
// ModalSave: ()=>this.deleteAttachment(file),
|
|
|
|
ModalCancel:this.cancelAttachment
|
|
|
|
// ModalCancel:this.cancelAttachment
|
|
|
|
})
|
|
|
|
// })
|
|
|
|
return false;
|
|
|
|
// return false;
|
|
|
|
}
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
cancelAttachment=()=>{
|
|
|
|
cancelAttachment=()=>{
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
@ -246,8 +246,8 @@ class GraduationTasksSubmitedit extends Component{
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
deleteAttachment = (file) => {
|
|
|
|
onAttachmentRemove = (file) => {
|
|
|
|
let {attachments}=this.state;
|
|
|
|
let {attachments,fileList}=this.state;
|
|
|
|
const url = `/attachments/${file.uid===undefined?file.id:file.uid}.json`
|
|
|
|
const url = `/attachments/${file.uid===undefined?file.id:file.uid}.json`
|
|
|
|
axios.delete(url, {
|
|
|
|
axios.delete(url, {
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -426,7 +426,7 @@ class GraduationTasksSubmitedit extends Component{
|
|
|
|
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: `${getUrl()}/api/attachments.json`,
|
|
|
|
action: `${getUrl()}/api/attachments.json`,
|
|
|
|
onChange: this.handleChange,
|
|
|
|
onChange: this.handleChange,
|
|
|
|
onRemove: this.onAttachmentRemove,
|
|
|
|
onRemove: this.onAttachmentRemove,
|
|
|
@ -553,7 +553,37 @@ class GraduationTasksSubmitedit extends Component{
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
.maxwidth500{
|
|
|
|
|
|
|
|
max-width:500px;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
color: #05101a;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
|
|
|
<p className="color-grey mt10" key={key} >
|
|
|
|
|
|
|
|
<a className="color-grey fl">
|
|
|
|
|
|
|
|
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
|
|
|
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
<span className="mr12 color9B9B maxwidth500 fl" length="58">
|
|
|
|
|
|
|
|
{item.name}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<span className="color656565 mt2 color-grey-6 font-12 mr8">
|
|
|
|
|
|
|
|
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<i className="font-14 iconfont icon-guanbi "
|
|
|
|
|
|
|
|
id={item.response===undefined?"":item.response.id}
|
|
|
|
|
|
|
|
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|