新增任务管理与报警管理前端,并接入车队健康数据。
运营菜单下挂地图监控/任务/报警入口,车辆卡片与任务列表同步展示运行态。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import type { VehicleAlarm } from '@/types/alarm'
|
||||
|
||||
function minsAgo(m: number): string {
|
||||
return new Date(Date.now() - m * 60_000).toISOString()
|
||||
}
|
||||
|
||||
export async function mockAlarms(): Promise<VehicleAlarm[]> {
|
||||
await new Promise((r) => setTimeout(r, 60))
|
||||
return [
|
||||
{
|
||||
id: 'a1', carId: 309, carName: 'AGV-309', info: '导航失联', level: 2,
|
||||
status: 'active', firstAt: minsAgo(6), lastAt: minsAgo(0), resolvedAt: null, durationSecs: null, acknowledged: false
|
||||
},
|
||||
{
|
||||
id: 'a2', carId: 415, carName: 'Kiva-415', info: '急停触发', level: 3,
|
||||
status: 'active', firstAt: minsAgo(2), lastAt: minsAgo(0), resolvedAt: null, durationSecs: null, acknowledged: false
|
||||
},
|
||||
{
|
||||
id: 'a3', carId: 572, carName: 'AGV-572', info: '电量低', level: 1,
|
||||
status: 'cleared', firstAt: minsAgo(120), lastAt: minsAgo(95), resolvedAt: minsAgo(95), durationSecs: 1500, acknowledged: false
|
||||
},
|
||||
{
|
||||
id: 'a4', carId: 888, carName: 'Kiva-888', info: '放货点被占用', level: 1,
|
||||
status: 'cleared', firstAt: minsAgo(1440), lastAt: minsAgo(1420), resolvedAt: minsAgo(1420), durationSecs: 1200, acknowledged: false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,13 +1,18 @@
|
||||
import type { DeliveryTask } from '@/types/delivery'
|
||||
|
||||
function hoursAgo(h: number): string {
|
||||
return new Date(Date.now() - h * 3600_000).toISOString()
|
||||
}
|
||||
|
||||
export async function mockDeliveries(): Promise<DeliveryTask[]> {
|
||||
await new Promise((r) => setTimeout(r, 60))
|
||||
return [
|
||||
{
|
||||
id: 101,
|
||||
id: 'a7Kp3',
|
||||
taskId: 'WMS-20260720-001',
|
||||
missionId: 1,
|
||||
missionName: '链式搬运',
|
||||
missionTypeName: 'FengTianChainedDeliveryMission',
|
||||
missionName: '搬运任务进程',
|
||||
missionTypeName: 'TransportMission',
|
||||
srcSiteId: 1,
|
||||
srcLabel: '1-取货台 A',
|
||||
dstSiteId: 8,
|
||||
@@ -17,14 +22,18 @@ export async function mockDeliveries(): Promise<DeliveryTask[]> {
|
||||
carId: 1,
|
||||
carName: 'AGV-01',
|
||||
priority: 1,
|
||||
createTime: new Date().toISOString(),
|
||||
createTime: hoursAgo(0.5),
|
||||
startTime: hoursAgo(0.4),
|
||||
finishTime: null,
|
||||
stuckReason: null,
|
||||
overdue: false
|
||||
},
|
||||
{
|
||||
id: 102,
|
||||
id: 'b2Xq9',
|
||||
taskId: null,
|
||||
missionId: 1,
|
||||
missionName: '链式搬运',
|
||||
missionTypeName: 'FengTianChainedDeliveryMission',
|
||||
missionName: '搬运任务进程',
|
||||
missionTypeName: 'TransportMission',
|
||||
srcSiteId: 3,
|
||||
srcLabel: '3-缓存区',
|
||||
dstSiteId: 12,
|
||||
@@ -34,14 +43,39 @@ export async function mockDeliveries(): Promise<DeliveryTask[]> {
|
||||
carId: null,
|
||||
carName: null,
|
||||
priority: 0,
|
||||
createTime: new Date(Date.now() - 45 * 60_000).toISOString(),
|
||||
createTime: hoursAgo(0.8),
|
||||
startTime: null,
|
||||
finishTime: null,
|
||||
stuckReason: '无可用车辆',
|
||||
overdue: true
|
||||
},
|
||||
{
|
||||
id: 99,
|
||||
id: 'c9Lm4',
|
||||
taskId: 'WMS-20260720-003',
|
||||
missionId: 1,
|
||||
missionName: '链式搬运',
|
||||
missionTypeName: 'FengTianChainedDeliveryMission',
|
||||
missionName: '搬运任务进程',
|
||||
missionTypeName: 'TransportMission',
|
||||
srcSiteId: 4,
|
||||
srcLabel: '4-线边库',
|
||||
dstSiteId: 9,
|
||||
dstLabel: '9-包装台',
|
||||
status: '放货中',
|
||||
statusCode: 'Putting',
|
||||
carId: 3,
|
||||
carName: 'Kiva-03',
|
||||
priority: 2,
|
||||
createTime: hoursAgo(1.2),
|
||||
startTime: hoursAgo(1.0),
|
||||
finishTime: null,
|
||||
stuckReason: null,
|
||||
overdue: false
|
||||
},
|
||||
{
|
||||
id: 'd1Nb7',
|
||||
taskId: 'WMS-20260719-088',
|
||||
missionId: 1,
|
||||
missionName: '搬运任务进程',
|
||||
missionTypeName: 'TransportMission',
|
||||
srcSiteId: 2,
|
||||
srcLabel: '2-原料区',
|
||||
dstSiteId: 5,
|
||||
@@ -51,8 +85,53 @@ export async function mockDeliveries(): Promise<DeliveryTask[]> {
|
||||
carId: 2,
|
||||
carName: 'AGV-02',
|
||||
priority: 1,
|
||||
createTime: new Date(Date.now() - 3600_000).toISOString(),
|
||||
createTime: hoursAgo(6),
|
||||
startTime: hoursAgo(5.8),
|
||||
finishTime: hoursAgo(5.4),
|
||||
stuckReason: null,
|
||||
overdue: false
|
||||
},
|
||||
{
|
||||
id: 'e5Rt2',
|
||||
taskId: null,
|
||||
missionId: 1,
|
||||
missionName: '搬运任务进程',
|
||||
missionTypeName: 'TransportMission',
|
||||
srcSiteId: 6,
|
||||
srcLabel: '6-暂存',
|
||||
dstSiteId: 7,
|
||||
dstLabel: '7-发运',
|
||||
status: '已取消',
|
||||
statusCode: 'Canceled',
|
||||
carId: 4,
|
||||
carName: 'Kiva-04',
|
||||
priority: 0,
|
||||
createTime: hoursAgo(26),
|
||||
startTime: null,
|
||||
finishTime: hoursAgo(25.5),
|
||||
stuckReason: null,
|
||||
overdue: false
|
||||
},
|
||||
{
|
||||
id: 'f8Wy6',
|
||||
taskId: 'WMS-20260720-077',
|
||||
missionId: 1,
|
||||
missionName: '搬运任务进程',
|
||||
missionTypeName: 'TransportMission',
|
||||
srcSiteId: 10,
|
||||
srcLabel: '10-入库口',
|
||||
dstSiteId: 11,
|
||||
dstLabel: '11-立体库',
|
||||
status: '任务异常',
|
||||
statusCode: 'Error',
|
||||
carId: 5,
|
||||
carName: 'Kiva-05',
|
||||
priority: 3,
|
||||
createTime: hoursAgo(3),
|
||||
startTime: hoursAgo(2.8),
|
||||
finishTime: null,
|
||||
stuckReason: '放货点被占用',
|
||||
overdue: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import type {
|
||||
const PAGES: PageDef[] = [
|
||||
{ key: 'admin-dashboard', label: '总览', group: '概览', scope: 'Platform' },
|
||||
{ key: 'admin-map-monitor', label: '地图监控', group: '概览', scope: 'Platform' },
|
||||
{ key: 'admin-tasks', label: '任务管理', group: '概览', scope: 'Platform' },
|
||||
{ key: 'admin-alarms', label: '报警管理', group: '概览', scope: 'Platform' },
|
||||
{ key: 'admin-maps', label: '地图管理', group: '设计与编排', scope: 'Platform' },
|
||||
{ key: 'admin-map-editor', label: '地图编辑', group: '设计与编排', scope: 'Platform' },
|
||||
{ key: 'admin-project-properties', label: '项目属性', group: '设计与编排', scope: 'Platform' },
|
||||
|
||||
Reference in New Issue
Block a user