重命名设计时配置接口,扩展模板组件类型

This commit is contained in:
2025-08-06 13:30:46 +08:00
parent 09d13339d8
commit 34ce564cfc
2 changed files with 14 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import type { ScreenDesignTimeConfig } from "./datax-screen-config";
import type { ScreenDesignModeConfig } from "./datax-screen-config";
interface DesignTemplate {
id: string; // 模板ID
@@ -8,11 +8,12 @@ interface DesignTemplate {
description?: string; // 模板描述
previewImage?: string; // 模板预览图
// 模板包含的组件
components: ScreenDesignTimeConfig["dataComponents"];
dataComponents: ScreenDesignModeConfig["dataComponents"];
feedbackComponents: ScreenDesignModeConfig["feedbackComponents"];
// 模板包含的分组信息
groups: ScreenDesignTimeConfig["groups"];
groups: ScreenDesignModeConfig["groups"];
// 模板可能依赖的变量
variables: ScreenDesignTimeConfig["variables"];
variables: ScreenDesignModeConfig["variables"];
// 模板可能依赖的过滤器
filters: ScreenDesignTimeConfig["filters"];
filters: ScreenDesignModeConfig["filters"];
}

View File

@@ -1,6 +1,6 @@
// 大屏设计时的配置,可以被导出/导入
// 由于设计了反馈组件因此大屏需要携带id字段
export interface ScreenDesignTimeConfig {
export interface ScreenDesignModeConfig {
id: string;
// 大屏样式
style: {
@@ -18,7 +18,7 @@ export interface ScreenDesignTimeConfig {
groupId?: string; // 组件所在分组ID如果存在
zIndex?: number; // 组件在分组中的层级
parentId?: string; // 组件的父组件ID如果存在
children: ScreenDesignTimeConfig["dataComponents"]; // 子组件
children: ScreenDesignModeConfig["dataComponents"]; // 子组件
// 设计时属性,运行时会忽略
design: {
hidden: boolean;
@@ -150,9 +150,9 @@ export interface ScreenDesignTimeConfig {
feedbackComponents: Array<{
id: string;
name: string;
style: ScreenDesignTimeConfig['style'];
dataComponents: ScreenDesignTimeConfig['dataComponents'];
// feedbackComponents: ScreenDesignTimeConfig['feedbackComponents']; // 是否允许反馈组件中包含反馈组件,即实现类似多对话框的效果
style: ScreenDesignModeConfig['style'];
dataComponents: ScreenDesignModeConfig['dataComponents'];
feedbackComponents: ScreenDesignModeConfig['feedbackComponents']; // 是否允许反馈组件中包含反馈组件,即实现类似多对话框的效果
}>;
}
@@ -161,4 +161,6 @@ export interface ScreenDesignTimeConfig {
// 2. 控制组件:大屏中的悬浮组件,可拖拽,贴边时可隐藏,比如一个控制面版用于操作摄像机/录像机等设备
// 3. 反馈组件:弹窗(全局,带遮罩)
export interface ScreenRuntimeConfig { }
export interface ScreenPreviewModeConfig { }
export interface ScreenPublishModeConfig { }