Merge branch 'main' into lhj

충돌 해결:
- CanvasElement.tsx: CustomMetricWidget(main) + 통합 TaskWidget(lhj) 모두 유지
- DashboardTopMenu.tsx: lhj의 '일정관리 위젯' 유지
- DashboardSidebar.tsx: main의 삭제 수락
This commit is contained in:
leeheejin
2025-10-23 15:14:47 +09:00
11 changed files with 775 additions and 280 deletions

View File

@@ -63,9 +63,9 @@ export class DashboardService {
id, dashboard_id, element_type, element_subtype,
position_x, position_y, width, height,
title, custom_title, show_header, content, data_source_config, chart_config,
list_config, yard_config,
list_config, yard_config, custom_metric_config,
display_order, created_at, updated_at
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19)
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)
`,
[
elementId,
@@ -84,6 +84,7 @@ export class DashboardService {
JSON.stringify(element.chartConfig || {}),
JSON.stringify(element.listConfig || null),
JSON.stringify(element.yardConfig || null),
JSON.stringify(element.customMetricConfig || null),
i,
now,
now,
@@ -391,6 +392,11 @@ export class DashboardService {
? JSON.parse(row.yard_config)
: row.yard_config
: undefined,
customMetricConfig: row.custom_metric_config
? typeof row.custom_metric_config === "string"
? JSON.parse(row.custom_metric_config)
: row.custom_metric_config
: undefined,
})
);
@@ -514,9 +520,9 @@ export class DashboardService {
id, dashboard_id, element_type, element_subtype,
position_x, position_y, width, height,
title, custom_title, show_header, content, data_source_config, chart_config,
list_config, yard_config,
list_config, yard_config, custom_metric_config,
display_order, created_at, updated_at
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19)
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20)
`,
[
elementId,
@@ -535,6 +541,7 @@ export class DashboardService {
JSON.stringify(element.chartConfig || {}),
JSON.stringify(element.listConfig || null),
JSON.stringify(element.yardConfig || null),
JSON.stringify(element.customMetricConfig || null),
i,
now,
now,

View File

@@ -45,6 +45,17 @@ export interface DashboardElement {
layoutId: number;
layoutName?: string;
};
customMetricConfig?: {
metrics: Array<{
id: string;
field: string;
label: string;
aggregation: "count" | "sum" | "avg" | "min" | "max";
unit: string;
color: "indigo" | "green" | "blue" | "purple" | "orange" | "gray";
decimals: number;
}>;
};
}
export interface Dashboard {