forked from p96170835/amis
优化多文件上传和文件名超长问题
This commit is contained in:
parent
c6582133e5
commit
59f6fa7494
|
@ -78,6 +78,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&-itemInfoText {
|
||||||
|
white-space: nowrap;
|
||||||
|
max-width: 180px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
&-clear {
|
&-clear {
|
||||||
float: right;
|
float: right;
|
||||||
color: #999;
|
color: #999;
|
||||||
|
@ -100,6 +109,8 @@
|
||||||
transform: translateY(-3px);
|
transform: translateY(-3px);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
>span {
|
>span {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
@ -116,6 +127,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&-progress {
|
&-progress {
|
||||||
height: 5px;
|
height: 5px;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
|
@ -705,7 +705,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||||
fd.append(config.fieldName || 'file', blob, file.name);
|
fd.append(config.fieldName || 'file', blob, file.name);
|
||||||
|
|
||||||
return self
|
return self
|
||||||
._send(reciever, fd, {}, progress => updateProgress(task.partNumber, progress))
|
._send(api, fd, {}, progress => updateProgress(task.partNumber, progress))
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
state.loaded++;
|
state.loaded++;
|
||||||
callback(null, {
|
callback(null, {
|
||||||
|
@ -854,7 +854,9 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<Icon icon="file" className="icon" />
|
<Icon icon="file" className="icon" />
|
||||||
{file.name || (file as FileValue).filename}
|
<span className={cx('FileControl-itemInfoText')}>
|
||||||
|
{file.name || (file as FileValue).filename}
|
||||||
|
</span>
|
||||||
{file.state === 'invalid' || file.state === 'error' ? (
|
{file.state === 'invalid' || file.state === 'error' ? (
|
||||||
<Icon icon="fail" className="icon" />
|
<Icon icon="fail" className="icon" />
|
||||||
) : null}
|
) : null}
|
||||||
|
@ -876,7 +878,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||||
width: `${
|
width: `${
|
||||||
file.state === 'uploaded'
|
file.state === 'uploaded'
|
||||||
? 100
|
? 100
|
||||||
: file.progress * 100
|
: (file.progress || 0) * 100
|
||||||
}%`
|
}%`
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -11,6 +11,7 @@ import {buildApi} from '../../utils/api';
|
||||||
import {createObject, qsstringify} from '../../utils/helper';
|
import {createObject, qsstringify} from '../../utils/helper';
|
||||||
import {Icon} from '../../components/icons';
|
import {Icon} from '../../components/icons';
|
||||||
import Button from '../../components/Button';
|
import Button from '../../components/Button';
|
||||||
|
// @ts-ignore
|
||||||
import accepts from 'attr-accept';
|
import accepts from 'attr-accept';
|
||||||
|
|
||||||
let id = 1;
|
let id = 1;
|
||||||
|
@ -137,7 +138,7 @@ export default class ImageControl extends React.Component<ImageProps, ImageState
|
||||||
};
|
};
|
||||||
|
|
||||||
cropper = React.createRef<Cropper>();
|
cropper = React.createRef<Cropper>();
|
||||||
dropzone = React.createRef<DropZone>();
|
dropzone = React.createRef<any>();
|
||||||
current: FileValue | FileX | null = null;
|
current: FileValue | FileX | null = null;
|
||||||
resolve?: (value?: any) => void;
|
resolve?: (value?: any) => void;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue