feat(platform): collapse advanced dashboard workbench
This commit is contained in:
@@ -2763,6 +2763,12 @@ export function Dashboard({
|
||||
</div>
|
||||
</section>
|
||||
) : null}
|
||||
<details className="vp-dashboard-secondary-details vp-dashboard-customer-advanced">
|
||||
<summary>
|
||||
<span>客户进阶工作台</span>
|
||||
<small>地图大屏、指挥台、车辆服务驾驶舱和态势分析默认收起;客户首页先回答车辆在哪里、时间窗怎么查、里程怎么核、数据怎么交付。</small>
|
||||
</summary>
|
||||
<div className="vp-dashboard-secondary-body">
|
||||
<section className="vp-vehicle-command-center" aria-label="车辆服务指挥台">
|
||||
<div className="vp-vehicle-command-map">
|
||||
<VehicleMap
|
||||
@@ -2932,6 +2938,8 @@ export function Dashboard({
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</details>
|
||||
<section className="vp-vehicle-service-cockpit" aria-label="车辆服务驾驶舱">
|
||||
<div className="vp-vehicle-service-cockpit-copy">
|
||||
<Space wrap>
|
||||
|
||||
@@ -155,6 +155,89 @@ test('dashboard opens with a customer vehicle service path instead of protocol e
|
||||
expect(screen.getByRole('button', { name: '客户车辆服务路径 数据导出 数据能否交付 导出证据' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('dashboard keeps advanced customer workbench collapsed behind the service path', async () => {
|
||||
window.history.replaceState(null, '', '/#/dashboard');
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
||||
const path = String(input);
|
||||
if (path.includes('/api/ops/health')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
linkHealth: [],
|
||||
kafkaLag: 0,
|
||||
activeConnections: 15,
|
||||
redisOnlineKeys: 92,
|
||||
tdengineWritable: true,
|
||||
mysqlWritable: true,
|
||||
runtime: { requestTimeoutMs: 5000, amapWebJsConfigured: true, amapSecurityProxyEnabled: true, amapSecurityCodeExposed: false }
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/dashboard/summary')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
onlineVehicles: 92,
|
||||
activeToday: 120,
|
||||
frameToday: 21000,
|
||||
issueVehicles: 7,
|
||||
kafkaLag: 0,
|
||||
protocols: [],
|
||||
serviceStatuses: [],
|
||||
linkHealth: []
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
if (path.includes('/api/vehicle-service/summary')) {
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: {
|
||||
totalVehicles: 1033,
|
||||
boundVehicles: 988,
|
||||
onlineVehicles: 92,
|
||||
singleSourceVehicles: 170,
|
||||
multiSourceVehicles: 220,
|
||||
noDataVehicles: 15,
|
||||
identityRequiredVehicles: 9,
|
||||
serviceStatuses: [],
|
||||
protocols: [],
|
||||
missingSources: []
|
||||
},
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
}
|
||||
return {
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
data: { items: [], total: 0, limit: 8, offset: 0 },
|
||||
traceId: 'trace-test',
|
||||
timestamp: 1783094400000
|
||||
})
|
||||
} as Response;
|
||||
});
|
||||
|
||||
render(<App />);
|
||||
|
||||
expect(await screen.findByRole('heading', { name: '客户车辆服务路径' })).toBeInTheDocument();
|
||||
const summary = screen.getByText('客户进阶工作台');
|
||||
const details = summary.closest('details');
|
||||
expect(details).toBeInTheDocument();
|
||||
expect(details).not.toHaveAttribute('open');
|
||||
expect(within(details as HTMLElement).getByText('车辆服务指挥台')).toBeInTheDocument();
|
||||
expect(within(details as HTMLElement).getByText('车辆地图态势')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('topbar frames customer work as a vehicle service delivery strip', () => {
|
||||
vi.spyOn(globalThis, 'fetch').mockImplementation(async () => ({
|
||||
ok: true,
|
||||
|
||||
Reference in New Issue
Block a user