|
|
@ -59,14 +59,14 @@ export default class UploadList extends React.Component<UploadListProps, any> { |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
const { prefixCls } = this.props; |
|
|
|
let list = this.props.items.map(file => { |
|
|
|
const { prefixCls, items, listType } = this.props; |
|
|
|
const list = items.map(file => { |
|
|
|
let progress; |
|
|
|
let icon = <Icon type="paper-clip" />; |
|
|
|
|
|
|
|
if (this.props.listType === 'picture' || this.props.listType === 'picture-card') { |
|
|
|
if (listType === 'picture' || listType === 'picture-card') { |
|
|
|
if (file.status === 'uploading' || (!file.thumbUrl && !file.url)) { |
|
|
|
if (this.props.listType === 'picture-card') { |
|
|
|
if (listType === 'picture-card') { |
|
|
|
icon = <div className={`${prefixCls}-list-item-uploading-text`}>文件上传中</div>; |
|
|
|
} else { |
|
|
|
icon = <Icon className={`${prefixCls}-list-item-thumbnail`} type="picture" />; |
|
|
@ -121,7 +121,7 @@ export default class UploadList extends React.Component<UploadListProps, any> { |
|
|
|
) |
|
|
|
} |
|
|
|
{ |
|
|
|
this.props.listType === 'picture-card' && file.status !== 'uploading' |
|
|
|
listType === 'picture-card' && file.status !== 'uploading' |
|
|
|
? ( |
|
|
|
<span> |
|
|
|
<a |
|
|
@ -143,14 +143,16 @@ export default class UploadList extends React.Component<UploadListProps, any> { |
|
|
|
}); |
|
|
|
const listClassNames = classNames({ |
|
|
|
[`${prefixCls}-list`]: true, |
|
|
|
[`${prefixCls}-list-${this.props.listType}`]: true, |
|
|
|
[`${prefixCls}-list-${listType}`]: true, |
|
|
|
}); |
|
|
|
return ( |
|
|
|
<div className={listClassNames}> |
|
|
|
<Animate transitionName={`${prefixCls}-margin-top`} component=""> |
|
|
|
{list} |
|
|
|
</Animate> |
|
|
|
</div> |
|
|
|
<Animate |
|
|
|
transitionName={`${prefixCls}-margin-top`} |
|
|
|
component="div" |
|
|
|
className={listClassNames} |
|
|
|
> |
|
|
|
{list} |
|
|
|
</Animate> |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|