From 70ea998564346d1a253b5ad5501c132d0dbd05a8 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 19 Jan 2026 16:34:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(annotation):=20=E4=BC=98=E5=8C=96=E6=A0=87?= =?UTF-8?q?=E6=B3=A8=E7=BC=96=E8=BE=91=E5=99=A8=E7=9A=84=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=8E=B7=E5=8F=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 优先使用项目配置中的label_config(用户编辑版本) - 其次使用模板默认配置作为备选方案 - 支持从项目配置字典中获取label_config字段 - 保持向后兼容性,当项目配置无效时回退到模板配置 --- .../app/module/annotation/service/editor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runtime/datamate-python/app/module/annotation/service/editor.py b/runtime/datamate-python/app/module/annotation/service/editor.py index ac04257..f703bc0 100644 --- a/runtime/datamate-python/app/module/annotation/service/editor.py +++ b/runtime/datamate-python/app/module/annotation/service/editor.py @@ -96,7 +96,12 @@ class AnnotationEditorService: if not supported: unsupported_reason = f"当前仅支持 TEXT,项目数据类型为: {dataset_type or 'UNKNOWN'}" - label_config = await self._get_label_config(project.template_id) + # 优先使用项目配置中的label_config(用户编辑版本),其次使用模板默认配置 + label_config = None + if project.configuration and isinstance(project.configuration, dict): + label_config = project.configuration.get("label_config") + if not label_config: + label_config = await self._get_label_config(project.template_id) return EditorProjectInfo( projectId=project.id,