|
|
@@ -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
|