From ca048f223cba6dd88d16cf74c0082a2b3b78cd3b Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 26 Jul 2024 15:28:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20UDM=E9=89=B4=E6=9D=83=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=85=A5K4=E6=96=87=E4=BB=B6=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/neData/udm_auth.ts | 1 - src/views/neUser/auth/index.vue | 217 ++++++++++++++++++-------------- 2 files changed, 123 insertions(+), 95 deletions(-) diff --git a/src/api/neData/udm_auth.ts b/src/api/neData/udm_auth.ts index 0af15c84..abc2450d 100644 --- a/src/api/neData/udm_auth.ts +++ b/src/api/neData/udm_auth.ts @@ -113,7 +113,6 @@ export function batchDelUDMAuth(neId: string, imsi: string, num: number) { /** * UDM鉴权用户导入 - * @param neId 网元ID * @param data 表单数据对象 * @returns object */ diff --git a/src/views/neUser/auth/index.vue b/src/views/neUser/auth/index.vue index a2d97ec3..b5249f22 100644 --- a/src/views/neUser/auth/index.vue +++ b/src/views/neUser/auth/index.vue @@ -530,7 +530,7 @@ function fnRecordDelete(imsi: string) { } /** - * UDM鉴权用户导出 + * UDM鉴权用户勾选导出 */ function fnRecordExport(type: string = 'txt') { const selectLen = tableState.selectedRowKeys.length; @@ -543,13 +543,15 @@ function fnRecordExport(type: string = 'txt') { let content = ''; if (type == 'txt') { for (const row of rows) { - content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf},${row.opc}\r\n`; + const opc = row.opc === '-' ? '' : `,${row.opc}`; + content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf}${opc}\r\n`; } } if (type == 'csv') { content = `IMSI,ki,Algo Index,AMF,OPC\r\n`; for (const row of rows) { - content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf},${row.opc}\r\n`; + const opc = row.opc === '-' ? '' : `,${row.opc}`; + content += `${row.imsi},${row.ki},${row.algoIndex},${row.amf}${opc}\r\n`; } } @@ -557,7 +559,7 @@ function fnRecordExport(type: string = 'txt') { saveAs(blob, `UDMAuth_${Date.now()}.${type}`); } -/**列表导出 */ +/**列表导出全部数据 */ function fnExportList(type: string) { const neId = queryParams.neId; if (!neId) return; @@ -651,6 +653,10 @@ type ModalUploadImportStateType = { loading: boolean; /**上传结果信息 */ msg: string; + /**导入类型 */ + typeOptions: { label: string; value: string }[]; + /**表单 */ + from: { typeVal: string; typeData: any }; }; /**对话框表格信息导入对象信息状态 */ @@ -659,11 +665,27 @@ let uploadImportState: ModalUploadImportStateType = reactive({ title: t('components.UploadModal.uploadTitle'), loading: false, msg: '', + typeOptions: [ + { label: 'Default', value: 'default' }, + { label: 'K4', value: 'k4' }, + ], + from: { + typeVal: 'default', + typeData: undefined, + }, }); +/**对话框表格信息导入类型选择 */ +function fnModalUploadImportTypeChange() { + uploadImportState.from.typeData = ''; + uploadImportState.msg = ''; +} + /**对话框表格信息导入弹出窗口 */ function fnModalUploadImportOpen() { uploadImportState.msg = ''; + uploadImportState.from.typeVal = 'default'; + uploadImportState.from.typeData = undefined; uploadImportState.loading = false; uploadImportState.visible = true; } @@ -702,6 +724,7 @@ function fnModalUploadImportUpload(file: File) { return importUDMAuth({ neId: neId, uploadPath: filePath, + ...uploadImportState.from, }); }) .then(res => { @@ -1103,54 +1126,52 @@ onMounted(() => { - - - - -