ERP-node/frontend/lib/api/screenFile.ts

50 lines
1.3 KiB
TypeScript
Raw Normal View History

2025-09-26 17:12:03 +09:00
import { apiClient } from './client';
export interface ScreenFileInfo {
objid: string;
savedFileName: string;
realFileName: string;
fileSize: number;
fileExt: string;
filePath: string;
docType: string;
docTypeName: string;
targetObjid: string;
parentTargetObjid?: string;
writer: string;
regdate: string;
status: string;
}
export interface ScreenComponentFilesResponse {
success: boolean;
componentFiles: { [componentId: string]: ScreenFileInfo[] };
totalFiles: number;
componentCount: number;
}
export interface ComponentFilesResponse {
success: boolean;
files: ScreenFileInfo[];
componentId: string;
screenId: string;
}
export const ScreenFileAPI = {
/**
*
*/
async getScreenComponentFiles(screenId: number): Promise<ScreenComponentFilesResponse> {
const response = await apiClient.get(`/screen-files/screens/${screenId}/components/files`);
return response.data;
},
/**
*
*/
async getComponentFiles(screenId: number, componentId: string): Promise<ComponentFilesResponse> {
const response = await apiClient.get(`/screen-files/screens/${screenId}/components/${componentId}/files`);
return response.data;
}
};