feat(platform): add time window next action strip
This commit is contained in:
@@ -1086,6 +1086,94 @@ export function Dashboard({
|
||||
onClick: openTimeMonitorAlerts
|
||||
}
|
||||
];
|
||||
const timeWindowNextPrimary = !timeMonitorHasRange
|
||||
? '锁定范围'
|
||||
: timeMonitorHasAlerts
|
||||
? '告警复盘'
|
||||
: timeMonitorHasHistory
|
||||
? '历史导出'
|
||||
: timeMonitorHasTrajectory
|
||||
? '轨迹回放'
|
||||
: '应用时间窗';
|
||||
const runTimeWindowPrimaryAction = () => {
|
||||
if (!timeMonitorHasRange) {
|
||||
setTimeMonitorFilters(timeMonitorScopeValue);
|
||||
return;
|
||||
}
|
||||
if (timeMonitorHasAlerts) {
|
||||
openTimeMonitorAlerts();
|
||||
return;
|
||||
}
|
||||
if (timeMonitorHasHistory) {
|
||||
openTimeMonitorRaw();
|
||||
return;
|
||||
}
|
||||
if (timeMonitorHasTrajectory) {
|
||||
openTimeMonitorHistory();
|
||||
return;
|
||||
}
|
||||
setTimeMonitorFilters(timeMonitorScopeValue);
|
||||
};
|
||||
const timeWindowNextItems = [
|
||||
{
|
||||
label: '首要动作',
|
||||
value: timeWindowNextPrimary,
|
||||
detail: timeMonitorHasAlerts ? '存在告警车辆,先给客户解释风险与处置闭环。' : timeMonitorHasHistory ? '历史证据可用,优先导出原始记录与解析字段。' : '先锁定车辆和时间范围。',
|
||||
color: timeMonitorHasAlerts ? 'orange' as const : timeMonitorHasHistory ? 'blue' as const : 'orange' as const,
|
||||
onClick: runTimeWindowPrimaryAction
|
||||
},
|
||||
{
|
||||
label: '交付状态',
|
||||
value: timeMonitorDeliveryStatus.label,
|
||||
detail: timeMonitorDeliveryStatus.detail,
|
||||
color: timeMonitorDeliveryStatus.color,
|
||||
onClick: () => copyTimeMonitorReviewPackage()
|
||||
},
|
||||
{
|
||||
label: '证据状态',
|
||||
value: `${formatCount(summary?.frameToday)} 帧`,
|
||||
detail: `${formatCount(summary?.activeToday)} 活跃车辆,可核对轨迹与历史明细。`,
|
||||
color: timeMonitorHasHistory ? 'blue' as const : 'orange' as const,
|
||||
onClick: openTimeMonitorRaw
|
||||
},
|
||||
{
|
||||
label: '服务范围',
|
||||
value: timeMonitorScopeValue.keyword ? '单车聚焦' : '全域巡检',
|
||||
detail: `${timeMonitorScopeValue.keyword || '全部车辆'} / ${timeMonitorScopeValue.protocol || '全部数据通道'} / ${timeMonitorWindowLabel}`,
|
||||
color: timeMonitorScopeValue.keyword ? 'green' as const : 'blue' as const,
|
||||
onClick: () => setTimeMonitorFilters(timeMonitorScopeValue)
|
||||
}
|
||||
];
|
||||
const timeWindowNextActions = [
|
||||
{
|
||||
label: '处理告警',
|
||||
action: '告警复盘',
|
||||
color: timeMonitorHasAlerts ? 'orange' as const : 'green' as const,
|
||||
disabled: false,
|
||||
onClick: openTimeMonitorAlerts
|
||||
},
|
||||
{
|
||||
label: '导出证据',
|
||||
action: '历史导出',
|
||||
color: timeMonitorHasHistory ? 'blue' as const : 'orange' as const,
|
||||
disabled: false,
|
||||
onClick: openTimeMonitorRaw
|
||||
},
|
||||
{
|
||||
label: '核对里程',
|
||||
action: '统计查询',
|
||||
color: 'green' as const,
|
||||
disabled: false,
|
||||
onClick: openTimeMonitorMileage
|
||||
},
|
||||
{
|
||||
label: '复制复盘',
|
||||
action: '交付包',
|
||||
color: timeMonitorDeliveryStatus.color,
|
||||
disabled: false,
|
||||
onClick: () => copyTimeMonitorReviewPackage()
|
||||
}
|
||||
];
|
||||
const dataFlowStages = [
|
||||
{
|
||||
stage: '01',
|
||||
@@ -3530,6 +3618,51 @@ export function Dashboard({
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-time-next-action-strip" aria-label="时间窗下一步行动条">
|
||||
<div className="vp-time-next-action-copy">
|
||||
<Space wrap>
|
||||
<Tag color="blue">时间窗下一步行动条</Tag>
|
||||
<Tag color={timeMonitorDeliveryStatus.color}>{timeMonitorDeliveryStatus.label}</Tag>
|
||||
<Tag color={timeMonitorHasAlerts ? 'orange' : 'green'}>{timeMonitorHasAlerts ? `${formatCount(summary?.issueVehicles)} 告警` : '无高风险'}</Tag>
|
||||
</Space>
|
||||
<Typography.Title heading={5} style={{ margin: 0 }}>
|
||||
把客户选择的车辆和时间范围转成下一步动作:先处理风险,再核对轨迹、里程、历史证据和交付说明。
|
||||
</Typography.Title>
|
||||
<Typography.Text type="secondary">
|
||||
当前范围:{timeMonitorSummary};时间窗:{timeMonitorWindowLabel}。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-time-next-action-grid">
|
||||
{timeWindowNextItems.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-time-next-action-item"
|
||||
onClick={item.onClick}
|
||||
aria-label={`时间窗下一步 ${item.label} ${item.value}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.label}</Tag>
|
||||
<strong>{item.value}</strong>
|
||||
<span>{item.detail}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="vp-time-next-action-actions">
|
||||
{timeWindowNextActions.map((item) => (
|
||||
<button
|
||||
key={item.label}
|
||||
type="button"
|
||||
className="vp-time-next-action-button"
|
||||
disabled={item.disabled}
|
||||
onClick={item.onClick}
|
||||
aria-label={`时间窗下一步动作 ${item.label} ${item.action}`}
|
||||
>
|
||||
<Tag color={item.color}>{item.label}</Tag>
|
||||
<span>{item.action}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-time-delivery-strip">
|
||||
<div className="vp-time-delivery-summary">
|
||||
<Space wrap>
|
||||
|
||||
@@ -4051,6 +4051,108 @@ body {
|
||||
align-self: end;
|
||||
}
|
||||
|
||||
.vp-time-next-action-strip {
|
||||
margin-top: 14px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.18);
|
||||
border-radius: var(--vp-radius);
|
||||
background: #fff;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr) minmax(180px, 0.52fr);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.vp-time-next-action-copy {
|
||||
padding: 16px;
|
||||
border-right: 1px solid var(--vp-border);
|
||||
background: #f7fbff;
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.vp-time-next-action-grid {
|
||||
padding: 12px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-time-next-action-item {
|
||||
min-height: 116px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.13);
|
||||
border-radius: 8px;
|
||||
background: #fbfcff;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.vp-time-next-action-item:hover,
|
||||
.vp-time-next-action-item:focus-visible,
|
||||
.vp-time-next-action-button:hover,
|
||||
.vp-time-next-action-button:focus-visible {
|
||||
border-color: rgba(22, 100, 255, 0.42);
|
||||
background: #f5f9ff;
|
||||
box-shadow: var(--vp-shadow-sm);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-time-next-action-item strong {
|
||||
color: var(--vp-text);
|
||||
font-size: 18px;
|
||||
line-height: 24px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-time-next-action-item span {
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-time-next-action-actions {
|
||||
padding: 12px;
|
||||
border-left: 1px solid var(--vp-border);
|
||||
background: #fafcff;
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-time-next-action-button {
|
||||
min-height: 44px;
|
||||
padding: 8px 10px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.13);
|
||||
border-radius: 8px;
|
||||
background: #fff;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.vp-time-next-action-button:disabled {
|
||||
cursor: not-allowed;
|
||||
opacity: 0.62;
|
||||
}
|
||||
|
||||
.vp-time-next-action-button span {
|
||||
color: var(--vp-primary);
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
line-height: 18px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.vp-result-summary-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
@@ -14206,6 +14308,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-mileage-mini-charts,
|
||||
.vp-time-service-path,
|
||||
.vp-time-service-path-grid,
|
||||
.vp-time-next-action-strip,
|
||||
.vp-time-next-action-grid,
|
||||
.vp-playback-layout,
|
||||
.vp-playback-timeline {
|
||||
grid-template-columns: 1fr;
|
||||
@@ -14287,6 +14391,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-history-delivery-conclusion-actions,
|
||||
.vp-history-next-export-copy,
|
||||
.vp-history-next-export-actions,
|
||||
.vp-time-next-action-copy,
|
||||
.vp-time-next-action-actions,
|
||||
.vp-notification-orchestration-copy,
|
||||
.vp-notification-orchestration-actions {
|
||||
border-left: 0;
|
||||
|
||||
@@ -1214,6 +1214,16 @@ test('dashboard guides customer custom time window service path', async () => {
|
||||
expect(screen.getByRole('button', { name: '时间窗服务路径 3 核对里程 1,033 车辆 统计查询' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗服务路径 4 导出证据 1,286,320 帧 数据导出' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗服务路径 5 告警说明 7 告警 告警通知' })).toBeInTheDocument();
|
||||
expect(screen.getByText('时间窗下一步行动条')).toBeInTheDocument();
|
||||
expect(screen.getByText('把客户选择的车辆和时间范围转成下一步动作:先处理风险,再核对轨迹、里程、历史证据和交付说明。')).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步 首要动作 告警复盘' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步 交付状态 带风险交付' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步 证据状态 1,286,320 帧' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步 服务范围 全域巡检' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步动作 处理告警 告警复盘' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步动作 导出证据 历史导出' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步动作 核对里程 统计查询' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('button', { name: '时间窗下一步动作 复制复盘 交付包' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('dashboard exposes vehicle data center capability matrix', async () => {
|
||||
|
||||
Reference in New Issue
Block a user