From e6c8a9c88d501627d15b06f3dc1681b5e44fc661 Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Tue, 28 Jul 2026 13:30:56 +0800 Subject: [PATCH] feat(web-admin): expose facilityNodeId on storage slot select options Needed so batch start/end fill can verify slots belong to the same box. Co-authored-by: Cursor --- web-admin/src/utils/storage-slot-options.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web-admin/src/utils/storage-slot-options.ts b/web-admin/src/utils/storage-slot-options.ts index b661eb36..93bfc8eb 100644 --- a/web-admin/src/utils/storage-slot-options.ts +++ b/web-admin/src/utils/storage-slot-options.ts @@ -9,6 +9,8 @@ export type StorageSlotSelectOption = { name: string /** 是否可分配(空格子);已占用项仍展示但应置灰 */ available?: boolean + /** 所属设施节点(盒)ID,用于同盒校验 */ + facilityNodeId?: string } export type LoadStorageSlotSelectOptions = { @@ -27,7 +29,8 @@ function mapRemoteSlotSelectOption(item: Record): StorageSlotSe return { id, name: available ? baseName : `${baseName}(已占用)`, - available + available, + facilityNodeId: String(item.facilityNodeId || item.facility_node_id || '').trim() || undefined } } @@ -322,7 +325,7 @@ export async function loadStorageSlotSelectOptions( export function ensureStorageSlotsInOptions( options: StorageSlotSelectOption[], - stubs: Array<{ id?: string; name?: string }> + stubs: Array<{ id?: string; name?: string; facilityNodeId?: string }> ): StorageSlotSelectOption[] { const next = [...options] const seen = new Set(next.map((o) => o.id)) @@ -333,7 +336,8 @@ export function ensureStorageSlotsInOptions( next.unshift({ id, name: String(stub.name || id), - available: true + available: true, + ...(stub.facilityNodeId ? { facilityNodeId: stub.facilityNodeId } : {}) }) } return next