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 <cursoragent@cursor.com>
This commit is contained in:
1 parent
bff544404f
commit
e6c8a9c88d
1 file changed
+7
-3
@@ -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<string, unknown>): 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
|
||||
|
||||
Reference in new issue
Block a user