feat: 完成后端处理链路、优化部分提示词
This commit is contained in:
@@ -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
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
"""删除指定的已有组件"""
|
||||||
|
|
||||||
|
from typing import Literal
|
||||||
|
|
||||||
|
from .base import BaseAction
|
||||||
|
|
||||||
|
|
||||||
|
class DeleteAction(BaseAction):
|
||||||
|
type: Literal["delete"] = "delete"
|
||||||
Reference in New Issue
Block a user