feat(platform): highlight customer service modules
This commit is contained in:
@@ -2734,6 +2734,30 @@ export function Dashboard({
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
<div className="vp-customer-service-overview" aria-label="客户服务总览">
|
||||
<div className="vp-customer-service-overview-copy">
|
||||
<Typography.Text strong>客户服务总览</Typography.Text>
|
||||
<Typography.Text type="secondary">
|
||||
地图、轨迹、统计、导出是客户能直接使用的车辆服务;协议来源只进入证据和追溯。
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="vp-customer-service-overview-grid">
|
||||
{customerHeroActions.map((item) => (
|
||||
<button
|
||||
key={item.title}
|
||||
type="button"
|
||||
className="vp-customer-service-overview-item"
|
||||
onClick={item.onClick}
|
||||
aria-label={`客户服务总览 ${item.title} ${item.action}`}
|
||||
>
|
||||
<strong>{item.title}</strong>
|
||||
<span>{item.value}</span>
|
||||
<p>{item.detail}</p>
|
||||
<em>{item.action}</em>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="vp-customer-service-next" aria-label="建议下一步">
|
||||
<div className="vp-customer-service-next-copy">
|
||||
<Typography.Text strong>建议下一步</Typography.Text>
|
||||
|
||||
@@ -1319,6 +1319,94 @@ body {
|
||||
grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.vp-customer-service-overview {
|
||||
grid-column: 1 / -1;
|
||||
border-top: 1px solid rgba(22, 100, 255, 0.14);
|
||||
background: #f9fbff;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-copy {
|
||||
min-width: 0;
|
||||
padding: 14px 18px;
|
||||
border-right: 1px solid var(--vp-border);
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
align-content: center;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-copy .semi-typography-secondary {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-grid {
|
||||
min-width: 0;
|
||||
padding: 12px 14px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-item {
|
||||
min-width: 0;
|
||||
min-height: 132px;
|
||||
padding: 12px;
|
||||
border: 1px solid rgba(22, 100, 255, 0.14);
|
||||
border-radius: 8px;
|
||||
background: #ffffff;
|
||||
color: inherit;
|
||||
cursor: pointer;
|
||||
font: inherit;
|
||||
text-align: left;
|
||||
display: grid;
|
||||
gap: 7px;
|
||||
align-content: start;
|
||||
transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-item:hover,
|
||||
.vp-customer-service-overview-item:focus-visible {
|
||||
border-color: rgba(22, 100, 255, 0.42);
|
||||
background: #f5f9ff;
|
||||
box-shadow: 0 0 0 3px rgba(22, 100, 255, 0.08);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-item strong {
|
||||
color: var(--vp-text);
|
||||
font-size: 15px;
|
||||
line-height: 21px;
|
||||
font-weight: 800;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-item span {
|
||||
color: var(--vp-primary);
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
font-weight: 800;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-item p {
|
||||
margin: 0;
|
||||
color: var(--vp-text-muted);
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.vp-customer-service-overview-item em {
|
||||
align-self: end;
|
||||
color: var(--vp-primary);
|
||||
font-size: 12px;
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.vp-customer-service-next-copy {
|
||||
min-width: 0;
|
||||
padding: 14px 18px;
|
||||
@@ -14598,6 +14686,8 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-vehicle-question-grid,
|
||||
.vp-customer-service-path,
|
||||
.vp-customer-service-path-grid,
|
||||
.vp-customer-service-overview,
|
||||
.vp-customer-service-overview-grid,
|
||||
.vp-customer-service-next,
|
||||
.vp-customer-service-next-grid,
|
||||
.vp-unified-service-board,
|
||||
@@ -14978,6 +15068,7 @@ button.vp-realtime-command-item:focus-visible {
|
||||
.vp-time-next-action-copy,
|
||||
.vp-time-next-action-actions,
|
||||
.vp-customer-service-path-copy,
|
||||
.vp-customer-service-overview-copy,
|
||||
.vp-customer-service-next-copy,
|
||||
.vp-time-monitor-dedicated-copy,
|
||||
.vp-map-layer-control-copy,
|
||||
|
||||
@@ -403,6 +403,89 @@ test('dashboard exposes customer service scope delivery actions on the first scr
|
||||
expect(within(scopeRegion).getByRole('button', { name: '客户服务范围 保存视图' })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('dashboard presents customer vehicle service modules before operations details', async () => {
|
||||
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: 88,
|
||||
activeToday: 119,
|
||||
frameToday: 32000,
|
||||
issueVehicles: 3,
|
||||
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: 1000,
|
||||
boundVehicles: 960,
|
||||
onlineVehicles: 88,
|
||||
singleSourceVehicles: 180,
|
||||
multiSourceVehicles: 230,
|
||||
noDataVehicles: 20,
|
||||
identityRequiredVehicles: 10,
|
||||
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 />);
|
||||
|
||||
const servicePath = await screen.findByLabelText('客户车辆服务路径');
|
||||
const serviceOverview = within(servicePath).getByLabelText('客户服务总览');
|
||||
expect(within(serviceOverview).getByText('客户服务总览')).toBeInTheDocument();
|
||||
expect(within(serviceOverview).getByText('地图、轨迹、统计、导出是客户能直接使用的车辆服务;协议来源只进入证据和追溯。')).toBeInTheDocument();
|
||||
expect(within(serviceOverview).getByRole('button', { name: '客户服务总览 车辆地图 进入地图' })).toBeInTheDocument();
|
||||
expect(within(serviceOverview).getByRole('button', { name: '客户服务总览 轨迹回放 回放轨迹' })).toBeInTheDocument();
|
||||
expect(within(serviceOverview).getByRole('button', { name: '客户服务总览 统计查询 查看统计' })).toBeInTheDocument();
|
||||
expect(within(serviceOverview).getByRole('button', { name: '客户服务总览 历史数据 查询导出' })).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