| | |
| | | .then(res => { |
| | | const records = res?.records || res?.data?.records || res?.data || []; |
| | | const rows = Array.isArray(records) ? records : []; |
| | | list.value = page.current === 1 ? rows : [...list.value, ...rows]; |
| | | const normalized = rows.map(r => { |
| | | const modelId = r?.id ?? r?.productModelId ?? r?.materialModelId; |
| | | return modelId == null ? r : { ...r, id: modelId }; |
| | | }); |
| | | list.value = page.current === 1 ? normalized : [...list.value, ...normalized]; |
| | | total.value = Number(res?.total ?? res?.data?.total ?? list.value.length); |
| | | loadStatus.value = list.value.length >= total.value ? "nomore" : "loadmore"; |
| | | }) |