export interface imgItem {
|
fileId: string;
|
name: string;
|
thumbUrl: string;
|
url: string;
|
}
|
export interface fileItem extends imgItem {
|
fileExtension?: string;
|
fileSize: number | string;
|
fileVersionId?: string;
|
}
|
|
export const units = {
|
GB: 1024 * 1024 * 1024,
|
KB: 1024,
|
MB: 1024 * 1024,
|
};
|
const uploadBaseProps = {
|
detailed: { default: false, type: Boolean },
|
disabled: { default: false, type: Boolean },
|
fileSize: { default: 10, type: Number },
|
folder: { default: '', type: String },
|
limit: { default: 0, type: Number },
|
pathType: { default: 'defaultPath', type: String },
|
showTip: { default: false, type: Boolean },
|
showUploadList: { default: true, type: Boolean },
|
simple: { default: false, type: Boolean },
|
sizeUnit: { default: 'MB', type: String },
|
sortRule: { default: () => [], type: Object },
|
timeFormat: { default: 'YYYY', type: String },
|
tipText: { default: '', type: String },
|
};
|
|
export const uploadImgProps = {
|
...uploadBaseProps,
|
accept: { default: 'image/*', type: String },
|
buttonText: { default: '', type: String },
|
// card,button,dragger
|
showType: { default: 'card', type: String },
|
type: { default: 'annexpic', type: String },
|
value: { type: Array as PropType<imgItem[]> },
|
};
|
export const uploadFileProps = {
|
...uploadBaseProps,
|
accept: { default: '*', type: String },
|
buttonText: { default: '点击上传', type: String },
|
showDownload: { default: true, type: Boolean },
|
showAllDownload: { default: true, type: Boolean },
|
showIcon: { default: true, type: Boolean },
|
showView: { default: true, type: Boolean },
|
type: { default: 'annex', type: String },
|
value: { default: [], type: Array as PropType<fileItem[]> },
|
};
|
export const uploadImgSingleProps = {
|
accept: { default: 'image/*', type: String },
|
action: { default: '', type: String },
|
actionPrefix: { default: '', type: String },
|
disabled: { default: false, type: Boolean },
|
fileSize: { default: 10, type: Number },
|
sizeUnit: { default: 'MB', type: String },
|
subTipText: { default: '', type: String },
|
tipText: { default: '', type: String },
|
type: { default: 'annexpic', type: String },
|
value: { default: '', type: String },
|
};
|