feat(assets): add dimension analysis and authorized user previews
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
Refactor asset drilldowns with combined dimension filters, parent summaries and progressive loading. Add the hidden /who read-only permission preview with scoped authorization, identity mapping and audit logging. Refine inventory counts and AI问数 presentation.
This commit is contained in:
@@ -53,13 +53,15 @@ export function inventorySelection(filters: InventoryFilters, title: string, ove
|
||||
};
|
||||
}
|
||||
|
||||
export function inventorySubtotalSelection(rows: RegionalInventoryStats[], label: string): VehicleModalSelection {
|
||||
export function inventorySubtotalSelection(rows: RegionalInventoryStats[], label: string, category: 'Inventory' | 'Abnormal' = 'Inventory'): VehicleModalSelection {
|
||||
const common = (key: 'region' | 'city' | 'brand' | 'type') => rows.length && rows.every(row => row[key] === rows[0][key]) ? rows[0][key] : '';
|
||||
const scope = [...new Set([common('region'), common('city'), common('brand'), common('type'), label].filter(Boolean))].join(' · ');
|
||||
return {
|
||||
batch: 'All', model: 'All', location: 'All', source: 'asset', category: 'Inventory',
|
||||
batch: 'All', model: 'All', location: 'All', source: 'asset', category,
|
||||
inventoryKeys: [...new Set(rows.map(inventoryKey))],
|
||||
title: `库存统计 · ${scope}`, scopeLabel: `${scope} · 合计 ${inventoryTotal(rows)} 台`,
|
||||
title: `库存统计 · ${scope}`, scopeLabel: category === 'Abnormal'
|
||||
? `${scope} · 异动 ${rows.reduce((sum, row) => sum + (row.abnormal ?? 0), 0)} 台`
|
||||
: `${scope} · 合计 ${inventoryTotal(rows)} 台`,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user