feat(platform): add global customer time window
This commit is contained in:
@@ -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'}>
|
||||
|
||||
Reference in New Issue
Block a user