배송/화물현황과 리스크/알림(api 활용, 공공데이터 복구시 대체될 가능성 있음)
This commit is contained in:
@@ -27,6 +27,16 @@ const VehicleMapWidget = dynamic(() => import("@/components/dashboard/widgets/Ve
|
||||
loading: () => <div className="flex h-full items-center justify-center text-sm text-gray-500">로딩 중...</div>,
|
||||
});
|
||||
|
||||
const DeliveryStatusWidget = dynamic(() => import("@/components/dashboard/widgets/DeliveryStatusWidget"), {
|
||||
ssr: false,
|
||||
loading: () => <div className="flex h-full items-center justify-center text-sm text-gray-500">로딩 중...</div>,
|
||||
});
|
||||
|
||||
const RiskAlertWidget = dynamic(() => import("@/components/dashboard/widgets/RiskAlertWidget"), {
|
||||
ssr: false,
|
||||
loading: () => <div className="flex h-full items-center justify-center text-sm text-gray-500">로딩 중...</div>,
|
||||
});
|
||||
|
||||
// 시계 위젯 임포트
|
||||
import { ClockWidget } from "./widgets/ClockWidget";
|
||||
|
||||
@@ -396,6 +406,16 @@ export function CanvasElement({
|
||||
<div className="widget-interactive-area h-full w-full">
|
||||
<VehicleMapWidget />
|
||||
</div>
|
||||
) : element.type === "widget" && element.subtype === "delivery-status" ? (
|
||||
// 배송/화물 현황 위젯 렌더링
|
||||
<div className="widget-interactive-area h-full w-full">
|
||||
<DeliveryStatusWidget />
|
||||
</div>
|
||||
) : element.type === "widget" && element.subtype === "risk-alert" ? (
|
||||
// 리스크/알림 위젯 렌더링
|
||||
<div className="widget-interactive-area h-full w-full">
|
||||
<RiskAlertWidget />
|
||||
</div>
|
||||
) : (
|
||||
// 기타 위젯 렌더링
|
||||
<div
|
||||
|
||||
@@ -302,6 +302,10 @@ function getElementTitle(type: ElementType, subtype: ElementSubtype): string {
|
||||
return "🧮 계산기 위젯";
|
||||
case "vehicle-map":
|
||||
return "🚚 차량 위치 지도";
|
||||
case "delivery-status":
|
||||
return "📦 배송/화물 현황";
|
||||
case "risk-alert":
|
||||
return "🚨 리스크 / 알림";
|
||||
default:
|
||||
return "🔧 위젯";
|
||||
}
|
||||
@@ -334,6 +338,10 @@ function getElementContent(type: ElementType, subtype: ElementSubtype): string {
|
||||
return "calculator";
|
||||
case "vehicle-map":
|
||||
return "vehicle-map";
|
||||
case "delivery-status":
|
||||
return "delivery-status";
|
||||
case "risk-alert":
|
||||
return "risk-alert";
|
||||
default:
|
||||
return "위젯 내용이 여기에 표시됩니다";
|
||||
}
|
||||
|
||||
@@ -127,6 +127,22 @@ export function DashboardSidebar() {
|
||||
onDragStart={handleDragStart}
|
||||
className="border-l-4 border-red-500"
|
||||
/>
|
||||
<DraggableItem
|
||||
icon="📦"
|
||||
title="배송/화물 현황"
|
||||
type="widget"
|
||||
subtype="delivery-status"
|
||||
onDragStart={handleDragStart}
|
||||
className="border-l-4 border-blue-600"
|
||||
/>
|
||||
<DraggableItem
|
||||
icon="🚨"
|
||||
title="리스크 / 알림"
|
||||
type="widget"
|
||||
subtype="risk-alert"
|
||||
onDragStart={handleDragStart}
|
||||
className="border-l-4 border-red-600"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,9 @@ export type ElementSubtype =
|
||||
| "weather"
|
||||
| "clock"
|
||||
| "calculator"
|
||||
| "vehicle-map"; // 위젯 타입
|
||||
| "vehicle-map"
|
||||
| "delivery-status"
|
||||
| "risk-alert"; // 위젯 타입
|
||||
|
||||
export interface Position {
|
||||
x: number;
|
||||
|
||||
Reference in New Issue
Block a user