import { UofxCADViewStatus, UofxFileModel, UofxFileViewStatus } from '@uofx/app-components/file-helper'; /** 由UofxFileModel轉換成上傳元件所需的model */ export interface UofxFileUploadFileItem { id?: string; /** 檔案url */ url?: string; /** 圖片 url */ imgUrl?: string; /** [前端專用]下載url */ downloadUrl?: string; /** 是否為新上傳還沒submit的檔案 */ isNewUpload?: boolean; /** 檔案名稱 */ fileName: string; fileSize: number; /** [前端專用]上傳回傳的錯誤訊息 */ errorMessage?: string; /** 上傳進度 */ uploadProgressValue?: number; /** 上傳部門 & 人 */ uploadBy?: string; /** 下載進度 */ downloadProgressValue?: number; /** 下載後的存放位置 */ downloadLocalPath?: string; /** 上傳的檔案超過系統總容量 */ uploadOverLimit?: boolean; /** 開啟viewer預覽的url */ pdfUrl?: string; /** 綁token的下載url */ rawUrl?: string; /** 縮圖 */ screenShotUrl?: string; /** 檔案icon */ fileIcon?: string; /** 轉檔失敗的traceId */ traceId?: string; /** [前端專用] 是否為檔案url */ isFileUrl?: boolean; /** 開cad viewer需要的base64 */ cadUrl?: string; /** cad檔案轉檔失敗後的traceId */ cadTraceId?: string; /** 透過cad按鈕上傳的檔案 */ isFromCad?: boolean; /** cad檔案轉檔狀態 */ cadViewStatus?: UofxCADViewStatus; /** 檔案轉檔狀態 */ viewStatus?: UofxFileViewStatus; /** 上傳中事件 */ onUploadProgress?: (p: number) => void; onDownLoadProgress?: (p: number) => void; } /** 檔案列表 */ export interface UofxFileGroupModel { /** file group id(Id allow null) */ id?: string; /** 檔案上傳的大小限制 (單位: byte) */ fileGroupLimits?: number; /** 已使用的檔案大小 (單位: byte) */ fileGroupUsedSize?: number; /** 上傳檔案的模組 */ module: string; /** 上傳檔案的子分類 */ sub: string; /** 檔案清單 */ files: Array; } /** 檔案動作類型 */ export declare enum UofxFileActionType { /** 新增 */ Add = 0, /** 下載 */ Download = 1, /** 觀看 */ View = 2, /** 更新 */ Update = 3 } /** 上傳模組 */ export declare enum UofxFileUploadModuleType { Base = "Base", Bpm = "Bpm", Eip = "Eip", Plugin = "Plugin", External = "External" } /** 點擊檔案時的事件 */ export declare enum UofxFileClickAction { /** 點擊刪除以外的地方 */ File = "file", /** 點擊刪除 */ Delete = "delete" } /** 檢查特定檔案是否轉檔完成的response model */ export interface UofxCheckFileConvertModel { /** 拋給後端檢查的檔案是否都轉檔完成 (只要檔案是成功或失敗,都視為轉檔完成,後端回傳true) */ convertCompleted: boolean; /** * 拋給後端檢查的檔案結果 (若檔案轉檔完成一定會拿到pdfUrl跟traceId其中一個) * - * 1. 成功:會有pdfUrl * 2. 失敗:會有traceId */ files: Array; } export type UofxFileButtonType = 'default'; export interface UofxFileButtons { [key: string]: UofxFileButton; } export interface UofxFileButton { text: string; icon?: string; }