feat: 完善 ele vxe-table 适配,完善文件和图片上传组件、字典组件、文档组件迁移,完善租户和租户套餐管理页面
This commit is contained in:
46
apps/web-ele/src/components/upload/typing.ts
Normal file
46
apps/web-ele/src/components/upload/typing.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { UploadStatus } from 'element-plus';
|
||||
|
||||
export type UploadListType = 'picture' | 'picture-card' | 'text';
|
||||
|
||||
export type UploadStatus = 'error' | 'removed' | 'success' | 'uploading';
|
||||
|
||||
export enum UploadResultStatus {
|
||||
DONE = 'success',
|
||||
ERROR = 'error',
|
||||
REMOVED = 'removed',
|
||||
SUCCESS = 'success',
|
||||
UPLOADING = 'uploading',
|
||||
}
|
||||
|
||||
export interface CustomUploadFile {
|
||||
uid: number;
|
||||
name: string;
|
||||
status: UploadStatus;
|
||||
url?: string;
|
||||
response?: any;
|
||||
percentage?: number;
|
||||
size?: number;
|
||||
raw?: File;
|
||||
}
|
||||
|
||||
export function convertToUploadStatus(
|
||||
status: UploadResultStatus,
|
||||
): UploadStatus {
|
||||
switch (status) {
|
||||
case UploadResultStatus.DONE: {
|
||||
return 'success';
|
||||
}
|
||||
case UploadResultStatus.ERROR: {
|
||||
return 'error';
|
||||
}
|
||||
case UploadResultStatus.REMOVED: {
|
||||
return 'removed';
|
||||
}
|
||||
case UploadResultStatus.UPLOADING: {
|
||||
return 'uploading';
|
||||
}
|
||||
default: {
|
||||
return 'success';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user