fix: AMF配置WhiteList Content导入index0无效问题

This commit is contained in:
TsMask
2025-10-24 20:46:20 +08:00
parent 8ced920aec
commit 0b15ff1476

View File

@@ -24,7 +24,7 @@ export default function useArrayImport({
fileetx: '.xlsx', fileetx: '.xlsx',
itemKey: 'index', itemKey: 'index',
item: (row: Record<string, any>) => { item: (row: Record<string, any>) => {
const index = row['Index'] || 0; const index = row['Index'] ?? -1;
return { return {
imeiPrefixValue: `${row['IMEI Prefix']}`, imeiPrefixValue: `${row['IMEI Prefix']}`,
index: parseInt(index), index: parseInt(index),
@@ -36,7 +36,7 @@ export default function useArrayImport({
fileetx: '.xlsx', fileetx: '.xlsx',
itemKey: 'index', itemKey: 'index',
item: (row: Record<string, any>) => { item: (row: Record<string, any>) => {
const index = row['Index'] || 0; const index = row['Index'] ?? -1;
return { return {
imsiValue: `${row['IMSI Value']}`, imsiValue: `${row['IMSI Value']}`,
imeiValue: `${row['IMEI Value/Prefix']}`, imeiValue: `${row['IMEI Value/Prefix']}`,
@@ -51,7 +51,7 @@ export default function useArrayImport({
fileetx: '.xlsx', fileetx: '.xlsx',
itemKey: 'index', itemKey: 'index',
item: (row: Record<string, any>) => { item: (row: Record<string, any>) => {
const index = row['Index'] || 0; const index = row['Index'] ?? -1;
return { return {
imei: `${row['IMEI']}`, imei: `${row['IMEI']}`,
index: parseInt(index), index: parseInt(index),
@@ -128,7 +128,7 @@ export default function useArrayImport({
importState.loading = true; importState.loading = true;
for (const row of rows) { for (const row of rows) {
const rowItem = importState.item(row); const rowItem = importState.item(row);
const rowKey = rowItem[importState.itemKey] || -1; const rowKey = rowItem[importState.itemKey];
let result: any = null; let result: any = null;
// 检查index是否定义 // 检查index是否定义
const has = arrayState.columnsData.find( const has = arrayState.columnsData.find(