feat(platform): add global customer time window

This commit is contained in:
lingniu
2026-07-05 19:21:52 +08:00
parent 4085268971
commit 0bfc47bc1c
4 changed files with 148 additions and 1 deletions

View File

@@ -130,6 +130,8 @@ export function AppShell({
currentVehicleStatus,
currentVehicleLabel,
currentVehicleConsistency,
customerTimeWindow,
onCustomerTimeWindowChange,
onChange,
onCustomerTask,
onVehicleSearch,
@@ -143,6 +145,8 @@ export function AppShell({
currentVehicleStatus?: VehicleServiceStatus;
currentVehicleLabel?: string;
currentVehicleConsistency?: VehicleSourceConsistency;
customerTimeWindow?: Record<string, string>;
onCustomerTimeWindowChange?: (filters: Record<string, string>) => void;
onChange: (page: PageKey) => void;
onCustomerTask?: (page: PageKey) => void;
onVehicleSearch: (keyword: string) => void | Promise<void>;
@@ -154,6 +158,8 @@ export function AppShell({
const alertLabel = alertButtonLabel(linkIssueCount, activeAlertRuleCount, p0AlertRuleCount);
const alertClassName = alertButtonClassName(linkIssueCount, activeAlertRuleCount, p0AlertRuleCount);
const selectedPage = activePage === 'quality' ? 'alert-events' : activePage;
const dateFrom = customerTimeWindow?.dateFrom ?? '';
const dateTo = customerTimeWindow?.dateTo ?? '';
const search = () => {
const value = keyword.trim();
@@ -258,6 +264,26 @@ export function AppShell({
<Button theme="solid" type="primary" loading={searching} onClick={search}></Button>
</Space>
<div className="vp-topbar-context">
<div className="vp-topbar-time-window" aria-label="客户时间窗">
<label>
<span></span>
<input
aria-label="顶部时间窗开始"
type="date"
value={dateFrom}
onChange={(event) => onCustomerTimeWindowChange?.({ dateFrom: event.currentTarget.value, dateTo })}
/>
</label>
<label>
<span></span>
<input
aria-label="顶部时间窗结束"
type="date"
value={dateTo}
onChange={(event) => onCustomerTimeWindowChange?.({ dateFrom, dateTo: event.currentTarget.value })}
/>
</label>
</div>
{currentVehicleLabel ? <Tag color="grey">{currentVehicleLabel}</Tag> : null}
{currentVehicleStatus ? (
<Tag color={currentVehicleStatus.severity === 'ok' ? 'green' : currentVehicleStatus.severity === 'error' ? 'red' : 'orange'}>