feat(platform): add customer alert command center

This commit is contained in:
lingniu
2026-07-06 05:21:06 +08:00
parent ce3a6225ec
commit 81014bf7ce
2 changed files with 153 additions and 0 deletions

View File

@@ -12493,6 +12493,11 @@ test('loads realtime vehicles from shareable source filter hash', async () => {
test('opens realtime status from quality issue row with source evidence', async () => {
window.history.replaceState(null, '', '/#/alert-events');
const writeText = vi.fn(() => Promise.resolve());
Object.defineProperty(navigator, 'clipboard', {
configurable: true,
value: { writeText }
});
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
const path = String(input);
if (path.includes('/api/ops/health')) {
@@ -12570,6 +12575,13 @@ test('opens realtime status from quality issue row with source evidence', async
render(<App />);
expect(await screen.findByText('13307795425')).toBeInTheDocument();
expect(screen.getByText('客户告警通知总控')).toBeInTheDocument();
expect(screen.getByText('把影响车辆、通知对象、SLA升级、证据闭环和恢复验收收敛成客户可执行的告警服务链路。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户告警通知总控 影响车辆 1 辆 复制影响' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户告警通知总控 通知对象 接入运维 + 业务责任人 复制通知' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户告警通知总控 SLA升级 30 分钟升级 通知闭环' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户告警通知总控 恢复验收 有标准 复制回执' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: /复制告警总控包/ })).toBeInTheDocument();
expect(screen.getByText('告警处置结论栏')).toBeInTheDocument();
expect(screen.getByText('先判断客户受影响车辆再确认通知、SLA、证据和恢复回执避免告警停留在技术表格里。')).toBeInTheDocument();
expect(screen.getByRole('button', { name: '告警处置结论栏 影响范围 1 辆 复制影响' })).toBeInTheDocument();
@@ -12584,6 +12596,16 @@ test('opens realtime status from quality issue row with source evidence', async
expect(screen.getByRole('button', { name: '客户告警服务台 焦点车辆 粤AG18312 / 13307795425 车辆服务' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户告警服务台 证据闭环 可复核 复制交接' })).toBeInTheDocument();
expect(screen.getByRole('button', { name: '客户告警服务台 恢复验收 有标准 复制回执' })).toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: /复制告警总控包/ }));
await waitFor(() => {
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('【客户告警通知总控包】'));
});
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('服务链路:影响车辆 -> 通知对象 -> SLA升级 -> 证据闭环 -> 恢复验收'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('影响范围1 辆 / 1 条'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('优先级P0 1 / P1 0'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('主通知策略P0 实时中断 / 接入运维 + 业务责任人 / 站内告警 / 邮件 / 企业微信 / 30 分钟升级'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('焦点车辆粤AG18312 / 13307795425'));
expect(writeText).toHaveBeenCalledWith(expect.stringContaining('通知闭环http://localhost:3000/#/notification-rules'));
fireEvent.click(screen.getAllByRole('button', { name: '实时状态' })[0]);
await waitFor(() => {