feat:图表交互
This commit is contained in:
@@ -113,7 +113,13 @@ class MaterialField(ExtensibleModel):
|
||||
)
|
||||
identifies: bool = Field(
|
||||
default=False,
|
||||
description="这个字段的文字是组件在画面上的名字或内容(图表标题、指标名、文本),大屏摘要用它帮助认出用户说的组件",
|
||||
description="这个字段的文字是组件在画面上的名字或内容(图表标题、指标名、文本),大屏摘要用它帮助认出用户说的组件;"
|
||||
"对象数组字段(导航的选项)取每项的 label",
|
||||
)
|
||||
template: bool = Field(
|
||||
default=False,
|
||||
description="前端渲染时把这个字段里的 {{变量ID}} 换成大屏变量的值(文本内容);其他字段里的 {{...}} 原样显示,"
|
||||
"批末检查只查这些字段和数据源 params 里引用的变量",
|
||||
)
|
||||
editable: bool = Field(default=True, description="是否允许修改")
|
||||
panel: bool = Field(default=True, description="是否显示在前端属性面板")
|
||||
@@ -133,8 +139,15 @@ class MaterialField(ExtensibleModel):
|
||||
raise ValueError(f"只有 color 字段可以跟随主题,且不能声明 default: {self.path}")
|
||||
if self.example and (self.themed or self.default is not None):
|
||||
raise ValueError(f"示例内容要写在默认配置里,不能跟随主题或声明 default: {self.path}")
|
||||
if self.identifies and self.value_type != "string":
|
||||
raise ValueError(f"只有 string 字段可以用来识别组件: {self.path}")
|
||||
if self.template and self.value_type != "string":
|
||||
raise ValueError(f"只有 string 字段可以写模板: {self.path}")
|
||||
if self.identifies and not (
|
||||
self.value_type == "string"
|
||||
or (self.value_type == "array" and self.item_type == "object")
|
||||
):
|
||||
raise ValueError(
|
||||
f"只有 string 字段或选项数组(取每项的 label)可以用来识别组件: {self.path}"
|
||||
)
|
||||
return self
|
||||
|
||||
def value_error(self, value: JsonValue) -> str | None:
|
||||
|
||||
Reference in New Issue
Block a user