feat: AMF/MME对应的IMEI白名单模板去除index
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -39,7 +39,7 @@ export default function useArrayBatch({
|
|||||||
batchState.loading = false;
|
batchState.loading = false;
|
||||||
batchState.startIndex = 1;
|
batchState.startIndex = 1;
|
||||||
batchState.num = 1;
|
batchState.num = 1;
|
||||||
fnActiveConfigNode('#')
|
fnActiveConfigNode('#');
|
||||||
}
|
}
|
||||||
|
|
||||||
async function modalBatchOk() {
|
async function modalBatchOk() {
|
||||||
@@ -73,6 +73,7 @@ export default function useArrayBatch({
|
|||||||
duration: 3,
|
duration: 3,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
modalBatchClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -22,21 +22,23 @@ export default function useArrayImport({
|
|||||||
imeiWhitelist: {
|
imeiWhitelist: {
|
||||||
filename: 'import_amf_imeiWhitelist_template',
|
filename: 'import_amf_imeiWhitelist_template',
|
||||||
fileetx: '.xlsx',
|
fileetx: '.xlsx',
|
||||||
|
itemKey: 'imeiPrefixValue',
|
||||||
item: (row: Record<string, any>) => {
|
item: (row: Record<string, any>) => {
|
||||||
return {
|
return {
|
||||||
imeiPrefixValue: row['IMEI Prefix'],
|
imeiPrefixValue: row['IMEI Prefix'],
|
||||||
index: row['Index'],
|
index: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
whitelist: {
|
whitelist: {
|
||||||
filename: 'import_amf_whitelist_template',
|
filename: 'import_amf_whitelist_template',
|
||||||
fileetx: '.xlsx',
|
fileetx: '.xlsx',
|
||||||
|
itemKey: 'imsiValue',
|
||||||
item: (row: Record<string, any>) => {
|
item: (row: Record<string, any>) => {
|
||||||
return {
|
return {
|
||||||
imsiValue: row['IMSI Value'],
|
imsiValue: row['IMSI Value'],
|
||||||
imeiValue: row['IMEI Value/Prefix'],
|
imeiValue: row['IMEI Value/Prefix'],
|
||||||
index: row['Index'],
|
index: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -45,10 +47,11 @@ export default function useArrayImport({
|
|||||||
white_list: {
|
white_list: {
|
||||||
filename: 'import_mme_imeiWhitelist_template',
|
filename: 'import_mme_imeiWhitelist_template',
|
||||||
fileetx: '.xlsx',
|
fileetx: '.xlsx',
|
||||||
|
itemKey: 'imei',
|
||||||
item: (row: Record<string, any>) => {
|
item: (row: Record<string, any>) => {
|
||||||
return {
|
return {
|
||||||
imei: row['IMEI'],
|
imei: row['IMEI'],
|
||||||
index: row['Index'],
|
index: 0,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -60,7 +63,8 @@ export default function useArrayImport({
|
|||||||
open: false,
|
open: false,
|
||||||
msgArr: [] as string[],
|
msgArr: [] as string[],
|
||||||
loading: false, //开始导入
|
loading: false, //开始导入
|
||||||
item: null as any,
|
itemKey: '', // 解析item的key
|
||||||
|
item: null as any, // 解析item方法
|
||||||
paramName: '',
|
paramName: '',
|
||||||
filename: '',
|
filename: '',
|
||||||
fileetx: '',
|
fileetx: '',
|
||||||
@@ -69,6 +73,7 @@ export default function useArrayImport({
|
|||||||
/**对话框表格信息导入弹出窗口 */
|
/**对话框表格信息导入弹出窗口 */
|
||||||
function modalImportOpen(neType: string, paramName: string) {
|
function modalImportOpen(neType: string, paramName: string) {
|
||||||
const tmpM = m[neType][paramName];
|
const tmpM = m[neType][paramName];
|
||||||
|
importState.itemKey = tmpM.itemKey;
|
||||||
importState.item = tmpM.item;
|
importState.item = tmpM.item;
|
||||||
importState.paramName = paramName;
|
importState.paramName = paramName;
|
||||||
importState.filename = tmpM.filename;
|
importState.filename = tmpM.filename;
|
||||||
@@ -98,7 +103,7 @@ export default function useArrayImport({
|
|||||||
// 获取最大index
|
// 获取最大index
|
||||||
let index = 0;
|
let index = 0;
|
||||||
if (arrayState.columnsData.length <= 0) {
|
if (arrayState.columnsData.length <= 0) {
|
||||||
index = 1;
|
index = 0;
|
||||||
} else {
|
} else {
|
||||||
const last = arrayState.columnsData[arrayState.columnsData.length - 1];
|
const last = arrayState.columnsData[arrayState.columnsData.length - 1];
|
||||||
index = last.index.value + 1;
|
index = last.index.value + 1;
|
||||||
@@ -120,12 +125,15 @@ 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];
|
||||||
let result: any = null;
|
let result: any = null;
|
||||||
// 检查index是否定义
|
// 检查index是否定义
|
||||||
const hasIndex = arrayState.columnsData.find(
|
const has = arrayState.columnsData.find(
|
||||||
(item: any) => item.index.value === rowItem.index
|
(item: any) => item[importState.itemKey].value === rowKey
|
||||||
);
|
);
|
||||||
if (hasIndex) {
|
if (has) {
|
||||||
|
// 已定义则更新
|
||||||
|
rowItem.index = has.index.value;
|
||||||
result = await editNeConfigData({
|
result = await editNeConfigData({
|
||||||
neType: neType,
|
neType: neType,
|
||||||
neId: neId,
|
neId: neId,
|
||||||
@@ -133,9 +141,9 @@ export default function useArrayImport({
|
|||||||
paramData: rowItem,
|
paramData: rowItem,
|
||||||
loc: `${rowItem.index}`,
|
loc: `${rowItem.index}`,
|
||||||
});
|
});
|
||||||
let msg = `update ${rowItem.index} fail`;
|
let msg = `index:${rowItem.index} update fail`;
|
||||||
if (result.code === RESULT_CODE_SUCCESS) {
|
if (result.code === RESULT_CODE_SUCCESS) {
|
||||||
msg = `update ${rowItem.index} success`;
|
msg = `index:${rowItem.index} update success`;
|
||||||
}
|
}
|
||||||
importState.msgArr.push(msg);
|
importState.msgArr.push(msg);
|
||||||
} else {
|
} else {
|
||||||
@@ -147,10 +155,10 @@ export default function useArrayImport({
|
|||||||
paramData: Object.assign(rowItem, { index }),
|
paramData: Object.assign(rowItem, { index }),
|
||||||
loc: `${index}`,
|
loc: `${index}`,
|
||||||
});
|
});
|
||||||
let msg = `add ${index} fail`;
|
let msg = `index:${index} add fail`;
|
||||||
if (result.code === RESULT_CODE_SUCCESS) {
|
if (result.code === RESULT_CODE_SUCCESS) {
|
||||||
|
msg = `index:${index} add success`;
|
||||||
index += 1;
|
index += 1;
|
||||||
msg = `add ${index} success`;
|
|
||||||
}
|
}
|
||||||
importState.msgArr.push(msg);
|
importState.msgArr.push(msg);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user