Browse Source

fix: should show all the uploaded files, close: #3113 (#3117)

pull/3128/head
Benjy Cui 8 years ago
committed by 偏右
parent
commit
50e978de53
  1. 24
      components/upload/uploadList.tsx

24
components/upload/uploadList.tsx

@ -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>
);
}
}

Loading…
Cancel
Save