fix: UDM鉴权签约用户勾选导出
This commit is contained in:
@@ -484,33 +484,27 @@ function fnRecordDelete(imsi: string) {
|
|||||||
/**
|
/**
|
||||||
* UDM鉴权用户勾选导出
|
* UDM鉴权用户勾选导出
|
||||||
*/
|
*/
|
||||||
function fnRecordExport(type: string = 'txt') {
|
function fnRecordExport(type: string = 'txt') {
|
||||||
const selectLen = tableState.selectedRowKeys.length;
|
const selectLen = tableState.selectedRowKeys.length;
|
||||||
if (selectLen <= 0) return;
|
if (selectLen <= 0) return;
|
||||||
const rows: Record<string, any>[] = tableState.data.filter(
|
const neId = queryParams.neId;
|
||||||
(row: Record<string, any>) =>
|
if (!neId) return;
|
||||||
tableState.selectedRowKeys.indexOf(row.imsi) >= 0
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
);
|
exportUDMAuth({ type: type, neId: neId, imsis: tableState.selectedRowKeys })
|
||||||
|
.then(res => {
|
||||||
let content = '';
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
if (type == 'txt') {
|
message.success(t('common.msgSuccess', { msg: t('common.export') }), 3);
|
||||||
for (const row of rows) {
|
saveAs(res.data, `UDMAuth_select_${Date.now()}.${type}`);
|
||||||
const opc = row.opc === '-' ? '' : `,${row.opc}`;
|
} else {
|
||||||
content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf}${opc}\r\n`;
|
message.error(`${res.msg}`, 3);
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
if (type == 'csv') {
|
.finally(() => {
|
||||||
content = `IMSI,ki,Algo Index,AMF,OPC\r\n`;
|
hide();
|
||||||
for (const row of rows) {
|
});
|
||||||
const opc = row.opc === '-' ? '' : `,${row.opc}`;
|
|
||||||
content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf}${opc}\r\n`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
|
|
||||||
saveAs(blob, `UDMAuth_${Date.now()}.${type}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**列表导出全部数据 */
|
/**列表导出全部数据 */
|
||||||
function fnExportList(type: string) {
|
function fnExportList(type: string) {
|
||||||
const neId = queryParams.neId;
|
const neId = queryParams.neId;
|
||||||
|
|||||||
@@ -831,49 +831,30 @@ function fnRecordDelete(imsi: string) {
|
|||||||
/**
|
/**
|
||||||
* UDM签约用户导出
|
* UDM签约用户导出
|
||||||
*/
|
*/
|
||||||
function fnRecordExport(type: string = 'txt') {
|
function fnRecordExport(type: string = 'txt') {
|
||||||
const selectLen = tableState.selectedRowKeys.length;
|
const selectLen = tableState.selectedRowKeys.length;
|
||||||
if (selectLen <= 0) return;
|
if (selectLen <= 0) return;
|
||||||
const rows: Record<string, any>[] = tableState.data.filter(
|
const neId = queryParams.neId;
|
||||||
(row: Record<string, any>) =>
|
if (!neId) return;
|
||||||
tableState.selectedRowKeys.indexOf(row.imsi) >= 0
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
);
|
exportUDMSub({ type: type, neId: neId, imsis: tableState.selectedRowKeys })
|
||||||
|
.then(res => {
|
||||||
let content = '';
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
if (type == 'txt') {
|
message.success({
|
||||||
for (const row of rows) {
|
content: t('common.msgSuccess', { msg: t('common.export') }),
|
||||||
const epsDat = [
|
duration: 2,
|
||||||
row.epsFlag,
|
});
|
||||||
row.epsOdb,
|
saveAs(res.data, `UDMSub_select_${Date.now()}.${type}`);
|
||||||
row.hplmnOdb,
|
} else {
|
||||||
row.ard,
|
message.error({
|
||||||
row.epstpl,
|
content: `${res.msg}`,
|
||||||
row.contextId,
|
duration: 2,
|
||||||
row.apnContext,
|
});
|
||||||
row.staticIp,
|
}
|
||||||
].join(',');
|
})
|
||||||
content += `${row.imsi},${row.msisdn},${row.ambr},${row.nssai},${row.arfb},${row.sar},${row.rat},${row.cn},${row.smfSel},${row.smData},${epsDat}\r\n`;
|
.finally(() => {
|
||||||
}
|
hide();
|
||||||
}
|
});
|
||||||
if (type == 'csv') {
|
|
||||||
content = `imsi,msisdn,ambr,nssai,arfb,sar,rat,cn,smf_sel,sm_dat,eps_dat\r\n`;
|
|
||||||
for (const row of rows) {
|
|
||||||
const epsDat = [
|
|
||||||
row.epsFlag,
|
|
||||||
row.epsOdb,
|
|
||||||
row.hplmnOdb,
|
|
||||||
row.ard,
|
|
||||||
row.epstpl,
|
|
||||||
row.contextId,
|
|
||||||
row.apnContext,
|
|
||||||
row.staticIp,
|
|
||||||
].join(',');
|
|
||||||
content += `${row.imsi},${row.msisdn},${row.ambr},${row.nssai},${row.arfb},${row.sar},${row.rat},${row.cn},${row.smfSel},${row.smData},${epsDat}\r\n`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const blob = new Blob([content], { type: 'text/plain;charset=utf-8' });
|
|
||||||
saveAs(blob, `UDMSub_${Date.now()}.${type}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**列表导出 */
|
/**列表导出 */
|
||||||
|
|||||||
Reference in New Issue
Block a user