Home > SYS_FileManager > getPanelLibraryFileByPanelLibraryUuid
SYS_FileManager.getPanelLibraryFileByPanelLibraryUuid() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Use panel library UUID get panel library file
Signature
function getPanelLibraryFileByPanelLibraryUuid(
panelLibraryUuid: string | Array<string>,
libraryUuid?: string,
fileType?: 'elibz' | 'elibz2',
): Promise<File | undefined>;2
3
4
5
Parameters
Parameter | Type | Description |
|---|---|---|
panelLibraryUuid | string | Array<string> | Panel library UUID or panel library UUID list |
libraryUuid | string | (Optional) Library UUID. It can be obtained using the APIs in LIB_LibrariesList. If not passed in, it is the system library |
fileType | 'elibz' | 'elibz2' | (Optional) |
Returns
Promise<File | undefined>
Panel library file data, undefined indicates that the data retrieval failed
Remarks
You can use SYS_FileSystem.saveFile() API export the file to the local file system
Note: This API requires the **Team Library > Download Library** permission. Calling it without permission will always throw Error
Example
// 1. 列出系统库面板库,取第一个的 UUID
const panelList = await eda.lib_PanelLibrary.search('', undefined, undefined, 5);
const panel = panelList[0];
// 2. 按面板库 UUID 获取面板库文件
const panelFile = await eda.sys_FileManager.getPanelLibraryFileByPanelLibraryUuid(panel.uuid);
// 3. 输出面板库与文件信息(size 单位为字节)
console.log('面板库名:', panel.name);
console.log('文件名:', panelFile.name);
console.log('文件大小:', panelFile.size);2
3
4
5
6
7
8
9
10
11