@@ -280,20 +280,16 @@ const showEditor = ref(false)
280280const currentIndex = ref <any >(null )
281281const showEditIcon = ref (false )
282282const codeTemplate = `
283- from typing import Dict, List
284-
285-
286- def get_form_list(node, **kwargs) -> List[Dict[str, object]]:
287- """获取文件列表表单配置
288-
289- 生成一个树形选择器的表单配置,用于展示和选择文件列表。
290-
283+ def get_form_list(node, **kwargs):
284+ """
285+ 获取表单配置列表
286+
291287 Args:
292- node: 节点对象,用于构造API调用URL
293- **kwargs: 其他可选参数
294-
288+ node: 节点对象
289+ **kwargs: 其他关键字参数
290+
295291 Returns:
296- list: 表单配置列表,包含树形选择器的配置项
292+ list: 包含表单字段配置的列表,用于构建文件树选择器
297293 """
298294 return [{
299295 "field": 'file_list',
@@ -308,56 +304,56 @@ def get_form_list(node, **kwargs) -> List[Dict[str, object]]:
308304 }]
309305
310306
311- def get_file_list(app_id=None, app_secret=None, folder_token=None, **kwargs) -> List[Dict[str, str]]:
312- """获取指定文件夹下的文件列表
313-
307+ def get_file_list(app_id=None, app_secret=None, folder_token=None, **kwargs):
308+ """
309+ 获取文件列表
310+
314311 Args:
315- app_id: 应用ID,用于身份验证
316- app_secret: 应用密钥,用于身份验证
317- folder_token: 文件夹标识符,不传则获取根目录文件
318- **kwargs: 其他可选参数
319-
312+ app_id (str, optional) : 应用ID
313+ app_secret (str, optional) : 应用密钥
314+ folder_token (str, optional): 文件夹token
315+ **kwargs: 其他关键字参数,包括current_node当前节点信息
316+
320317 Returns:
321- list: 文件列表,每个文件对象包含以下字段:
322- - name (str): 文件名称
323- - token (str): 文件唯一标识符
324- - type (str): 文件类型,如 "docx"、"xlsx" 或 "folder"
325- - 其他元数据字段
326-
327- Example:
328- [
329- {
330- "name": "示例文档.docx",
331- "token": "abc123",
332- "type": "docx"
333- },
334- {
335- "name": "子文件夹",
336- "token": "def456",
337- "type": "folder"
338- }
339- ]
318+ list: 过滤后的文件列表,每个文件包含leaf标识和原始文件信息
340319 """
341320 pass
342321
322+ def get_down_file_list(app_id=None, app_secret=None, **kwargs):
323+ """
324+ 获取需要下载的文件列表(过滤掉文件夹)
325+
326+ Args:
327+ app_id (str, optional): 应用ID
328+ app_secret (str, optional): 应用密钥
329+ **kwargs: 其他关键字参数,包括file_list文件列表
330+
331+ Returns:
332+ list: 过滤后的文件列表,不包含文件夹类型
333+ """
334+ pass
343335
344- def get_raw_file(app_id=None, app_secret=None, **kwargs) -> Dict[str, object]:
345- """下载文件的原始内容
346336
337+ def download(app_id=None, app_secret=None, **kwargs):
338+ """
339+ 下载文件
340+
341+ 支持下载文档(docx)、表格(sheet)和普通文件
342+ - 对于文档和表格,先创建导出任务,轮询等待导出完成后下载
343+ - 对于普通文件,直接下载
344+
347345 Args:
348- app_id: 应用ID,用于身份验证
349- app_secret: 应用密钥,用于身份验证
350- **kwargs: 其他可选参数
351-
346+ app_id (str, optional) : 应用ID
347+ app_secret (str, optional) : 应用密钥
348+ **kwargs: 其他关键字参数,包括download_item下载项信息
349+
352350 Returns:
353- [
354- {
355- "name": "示例文档.docx",
356- "file_bytes": b"文件的二进制内容"
357- }
358- ]
351+ dict: 包含文件字节数组(base64编码)和文件名的字典
352+ {'file_bytes': [base64_chunk1, base64_chunk2, ...], 'name': 'filename.ext'}
353+
354+ Raises:
355+ Exception: 当创建导出任务失败、查询任务失败或导出任务超时时抛出异常
359356 """
360-
361357 pass
362358`
363359
0 commit comments