数据源支持GraphQL

This commit is contained in:
2025-07-30 23:40:50 +08:00
parent 2d9a95c5d3
commit 58afe530b1

View File

@@ -21,7 +21,7 @@ export interface ScreenDesignTimeConfig {
design: {
hidden: boolean;
locked: boolean;
}
};
// 组件在画布上的布局和样式
style: {
left: number; // 组件在画布上的X轴距离
@@ -41,15 +41,21 @@ export interface ScreenDesignTimeConfig {
data: any; // 组件数据
dataSource: {
variableNames: Array<string>; // 关联的全局变量名称
type: "static" | "api" | "variable";
type: "static" | "variable" | "api" | "graphql";
// 数据源配置
config: {
value?: any;
url?: string;
method?: "GET" | "POST";
headers?: Record<string, any>;
query?: Record<string, any>;
body?: Record<string, any>;
api?: {
url?: string;
method?: "GET" | "POST";
headers?: Record<string, any>;
query?: Record<string, any>;
body?: Record<string, any>;
};
graphql?: {
query?: string;
variables?: Record<string, any>;
};
};
cors: boolean; // 服务器代理请求
filterIds: Array<string>;