feat: 完成后端处理链路、优化部分提示词

This commit is contained in:
2026-09-26 12:53:20 +08:00
parent d3e2c6b544
commit 4725cef538
2 changed files with 21 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
"""在大屏 JSON 副本上删除组件,用于后端校验,不删除共享数据源"""
from app.actions.base import BaseActionHandler
from app.schemas.actions import DeleteAction
from app.schemas.screen import Screen
class DeleteHandler(BaseActionHandler[DeleteAction]):
def apply(self, screen: Screen, action: DeleteAction) -> Screen:
result, target = self.copy_target(screen, action.target_id)
result.nodes = [node for node in result.nodes if node.id != target.id]
return result
+9
View File
@@ -0,0 +1,9 @@
"""删除指定的已有组件"""
from typing import Literal
from .base import BaseAction
class DeleteAction(BaseAction):
type: Literal["delete"] = "delete"