Home > DMT_Folder > getAllFoldersUuid
DMT_Folder.getAllFoldersUuid() method
获取所有文件夹的 UUID
签名
typescript
function getAllFoldersUuid(teamUuid: string): Promise<Array<string>>;1
参数名
参数 | 类型 | 描述 |
|---|---|---|
teamUuid | string | 团队 UUID |
返回值
Promise<Array<string>>
文件夹 UUID 数组
备注
本接口忽略层级信息,将会返回所有层级的文件夹的 UUID 并放置于一维数组中
示例
javascript
// 1. 取当前工程所属团队
const projectInfo = await eda.dmt_Project.getCurrentProjectInfo();
const teamUuid = projectInfo.teamUuid;
// 2. 创建一个测试文件夹,保证列表里有新近创建的对象
const folderUuid = await eda.dmt_Folder.createFolder('嘉立创示例_盘点', teamUuid);
await new Promise(r => setTimeout(r, 1500));
// 3. 获取所有文件夹 UUID,确认测试文件夹在列
const allUuids = await eda.dmt_Folder.getAllFoldersUuid(teamUuid);
console.log('folderUuid:', folderUuid);
console.log('total folders:', allUuids.length);
console.log('test folder included:', allUuids.includes(folderUuid));
// 4. 清理测试文件夹(查询类案例不留测试对象)
await eda.dmt_Folder.deleteFolder(teamUuid, folderUuid);1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17