26 lines
827 B
Python
26 lines
827 B
Python
"""新增组件动作"""
|
|
|
|
from typing import Literal
|
|
|
|
from pydantic import Field
|
|
|
|
from app.schemas.actions.base import ActionModel
|
|
from app.schemas.base import NonBlankString
|
|
from app.schemas.screen import ScreenNode
|
|
|
|
|
|
class AddAction(ActionModel):
|
|
type: Literal["add"] = "add"
|
|
node: ScreenNode = Field(
|
|
description="待新增的完整组件,包含新 ID、类型、布局和配置"
|
|
)
|
|
plan_id: NonBlankString | None = Field(
|
|
default=None, description="对应的规划组件编号,独立模拟时可省略"
|
|
)
|
|
component_key: NonBlankString | None = Field(
|
|
default=None, description="使用的物料目录编号,规划生成时必填"
|
|
)
|
|
sample_data: bool = Field(
|
|
default=False, description="物料含示例数据,不代表已获取真实业务数据"
|
|
)
|