fix(assets): expose full inventory for scoped users and stabilize previews
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
shishengliang
2026-09-28 13:16:12 +08:00
parent f1b3f8d3da
commit 48cf429468
17 changed files with 191 additions and 57 deletions
+2 -2
View File
@@ -285,8 +285,8 @@ const BUSINESS_DIMENSIONS: Record<AnalysisView, readonly AssetAnalysisDimension[
/** Dimensions are choices, not a required drill sequence. */
export function getAvailableDimensions(view: AnalysisView): AssetAnalysisDimension[] {
const common = view === 'inventory'
? COMMON_DIMENSIONS.filter(dimension => dimension !== 'manager' && dimension !== 'customer')
const common = ['inventory', 'pending', 'abnormal'].includes(view)
? COMMON_DIMENSIONS.filter(dimension => dimension !== 'department' && dimension !== 'manager' && dimension !== 'customer')
: COMMON_DIMENSIONS;
return [...common, ...BUSINESS_DIMENSIONS[view]];
}
@@ -49,7 +49,7 @@ export function InventoryStatisticsSection({
<div className="w-1.5 h-6 bg-blue-600 rounded-full"></div>
<div className="flex flex-col">
<h2 className="text-lg font-bold text-gray-800 leading-tight">库存统计</h2>
<span className="text-[10px] text-gray-400 font-medium">{preview ? '公共库存汇总 · 明细按当前用户权限查看' : '实时更新库存数据'}</span>
<span className="text-[10px] text-gray-400 font-medium">{preview ? '全量库存 · 汇总与明细口径一致' : '实时更新库存数据'}</span>
</div>
</div>