From e8ef2816df8d1b4e51a0ab247e94cddd1e7c2aea Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Thu, 5 Sep 2024 16:36:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0IMSI,ki=E9=99=90=E5=88=B6?= =?UTF-8?q?=E4=BD=8D=E6=95=B0=E4=BB=A5=E5=8F=8A=E5=90=88=E5=B9=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=89=B9=E9=87=8F=E6=96=B0=E5=A2=9E=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 16 +- src/i18n/locales/zh-CN.ts | 18 +- src/views/neUser/auth/index.vue | 352 +++----------- src/views/neUser/sub/index.vue | 814 +++----------------------------- 4 files changed, 174 insertions(+), 1026 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 23c04e36..5178f4a4 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -853,7 +853,7 @@ export default { }, neUser: { auth: { - authInfo:'Authentication Info', + authInfo:' Authentication Info', neTypePlease: 'Query network element Object', neType: 'UDM Object', export: 'Export', @@ -876,9 +876,10 @@ export default { imsiTip3: 'MSIN = Mobile Subscriber Identification Number, consisting of 10 equal digits.', amfTip: 'Authentication management field, maximum parameter length is 4', algoIndexTip: 'Algorithm index, between 0 and 15', - kiTip: 'User signing key information, the maximum length of 32', + kiTip: 'User signing key information, the length can only be 32', opcTip: 'The authentication key, OPC, is calculated from Ki and OP, OP is the root key of the operator, ki is the authentication key, and the maximum length is 32.', delSure:'Are you sure you want to delete the user with IMSI number: {imsi} ?', + imsiConfirm:'The length of the IMSI must be 15', }, sub: { subInfo:' Subscription Info', @@ -1061,6 +1062,11 @@ export default { addCustom:' Add custom indicator', editCustom:' Edit Custom indicator', errorCustomInfo: 'Failed to get information', + status: 'Status', + active:'Active', + inactive:'Inactive', + symbol:'Symbol', + element:'Element', } }, traceManage: { @@ -1269,6 +1275,12 @@ export default { tailChar: 'End Characters', tailLines: 'End Lines', }, + logFile:{ + downTip: "Confirm the download file name is [{fileName}] File?", + downTipErr: "Failed to get file", + deleteTip: "Confirm the delete file name is [{fileName}] File?", + deleteTipErr: "Failed to delete file", + } }, monitor: { session: { diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 001c19a8..f37cd3b1 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -876,9 +876,10 @@ export default { imsiTip3: 'MSIN=移动客户识别码,采用等长10位数字构成', amfTip: '鉴权管理域,参数最大长度为 4', algoIndexTip: '算法索引,介于0到15之间', - kiTip: '用户签权密钥信息,最大长度为32', + kiTip: '用户签权密钥信息,长度只能是32', opcTip: '鉴权秘钥,OPC是由Ki和OP经过计算得来的,OP为运营商的根秘钥,ki是鉴权秘钥,最大长度为32', delSure:'确认删除IMSI编号为: {imsi} 的用户吗?', + imsiConfirm:'IMSI的长度必须为15', }, sub: { subInfo:'签约信息', @@ -1060,7 +1061,12 @@ export default { delCustom:'成功删除记录编号为 {num} 自定义指标', addCustom:'添加自定义指标', editCustom:'编辑自定义指标', - errorCustomInfo: '获取信息失败', + errorCustomInfo: '获取信息失败', + status: '状态', + active:'正常', + inactive:'停用', + symbol:"符号", + element:'元素', } }, traceManage: { @@ -1269,7 +1275,13 @@ export default { tailChar: '末尾字数', tailLines: '末尾行数', }, - }, + logFile:{ + downTip: "确认下载文件名为 【{fileName}】 文件?", + downTipErr: "文件获取失败", + deleteTip: "确认删除文件名为 【{fileName}】 文件?", + deleteTipErr: "文件删除失败", + } + }, monitor: { session: { userName: "登录账号", diff --git a/src/views/neUser/auth/index.vue b/src/views/neUser/auth/index.vue index b5249f22..0229eea9 100644 --- a/src/views/neUser/auth/index.vue +++ b/src/views/neUser/auth/index.vue @@ -194,8 +194,6 @@ type ModalStateType = { /**表单数据 */ from: Record; /**表单数据 */ - BatchForm: Record; - /**表单数据 */ BatchDelForm: Record; /**确定按钮 loading */ confirmLoading: boolean; @@ -210,15 +208,8 @@ let modalState: ModalStateType = reactive({ visibleByBatchDel: false, title: 'UDM鉴权用户', from: { - id: '', - imsi: '', - amf: '8000', - ki: '', - algoIndex: 0, - opc: '', - }, - BatchForm: { num: 1, + id: '', imsi: '', amf: '8000', ki: '', @@ -236,19 +227,6 @@ let modalState: ModalStateType = reactive({ /**对话框内表单属性和校验规则 */ const modalStateFrom = Form.useForm( modalState.from, - reactive({ - imsi: [{ required: true, message: 'IMSI' + t('common.unableNull') }], - amf: [{ required: true, message: 'AMF' + t('common.unableNull') }], - ki: [{ required: true, message: 'KI' + t('common.unableNull') }], - algoIndex: [ - { required: true, message: 'algoIndex' + t('common.unableNull') }, - ], - }) -); - -/**对话框内批量添加表单属性和校验规则 */ -const modalStateBatchFrom = Form.useForm( - modalState.BatchForm, reactive({ num: [ { @@ -256,9 +234,15 @@ const modalStateBatchFrom = Form.useForm( message: t('views.neUser.auth.numAdd') + t('common.unableNull'), }, ], - imsi: [{ required: true, message: 'IMSI' + t('common.unableNull') }], + imsi: [ + { required: true, message: 'IMSI' + t('common.unableNull') }, + { min: 15, max: 15, message: t('views.neUser.auth.imsiConfirm') }, + ], amf: [{ required: true, message: 'AMF' + t('common.unableNull') }], - ki: [{ required: true, message: 'KI' + t('common.unableNull') }], + ki: [ + { required: true, message: 'KI' + t('common.unableNull') }, + { min: 32, max: 32, message: t('views.neUser.auth.kiTip') }, + ], algoIndex: [ { required: true, message: 'algoIndex' + t('common.unableNull') }, ], @@ -312,21 +296,14 @@ function fnModalVisibleByEdit(row?: Record) { } /** - * 对话框弹出显示为 批量新增,批量删除 + * 对话框弹出显示为 批量删除 * @param noticeId 网元id, 不传为新增 */ -function fnModalVisibleByBatch(batchFlag?: number) { - if (batchFlag) { - modalStateBatchFrom.resetFields(); //重置表单 - modalState.title = - t('views.neUser.auth.batchAddText') + t('views.neUser.auth.authInfo'); - modalState.visibleByBatch = true; - } else { - modalStateBatchFrom.resetFields(); //重置表单 - modalState.title = - t('views.neUser.auth.batchDelText') + t('views.neUser.auth.authInfo'); - modalState.visibleByBatchDel = true; - } +function fnModalVisibleByBatch() { + modalStateBatchDelFrom.resetFields(); //重置表单 + modalState.title = + t('views.neUser.auth.batchDelText') + t('views.neUser.auth.authInfo'); + modalState.visibleByBatchDel = true; } /** @@ -341,23 +318,52 @@ function fnModalOk() { const from = toRaw(modalState.from); from.neId = queryParams.neId || '-'; from.algoIndex = `${from.algoIndex}`; - const result = from.id ? updateUDMAuth(from) : addUDMAuth(from); + const result = from.id + ? updateUDMAuth(from) + : from.num === 1 + ? addUDMAuth(from) + : batchAddUDMAuth(from, from.num); const hide = message.loading(t('common.loading'), 0); result .then(res => { if (res.code === RESULT_CODE_SUCCESS) { - message.success({ - content: t('common.msgSuccess', { msg: modalState.title }), - duration: 3, - }); + if (from.num === 1) { + //新增时 + message.success({ + content: t('common.msgSuccess', { msg: modalState.title }), + duration: 3, + }); + fnGetList(); + } else { + //批量新增时 + const timerS = Math.max( + Math.ceil(+from.num / 500), + `${from.num}`.length + ); + notification.success({ + message: modalState.title, + description: t('common.operateOk'), + duration: timerS, + }); + setTimeout(() => { + fnGetList(1); + }, timerS * 1000); + } modalState.visibleByEdit = false; modalStateFrom.resetFields(); - fnGetList(); } else { - message.error({ - content: `${res.msg}`, - duration: 3, - }); + if (from.num === 1) { + message.error({ + content: `${res.msg}`, + duration: 3, + }); + } else { + notification.error({ + message: modalState.title, + description: res.msg, + duration: 3, + }); + } } }) .finally(() => { @@ -370,51 +376,6 @@ function fnModalOk() { }); } -/** - * 对话框弹出 批量新增操作确认执行函数 - * 进行表达规则校验 - */ -function fnBatchModalOk() { - modalStateBatchFrom - .validate() - .then(e => { - modalState.confirmLoading = true; - const from = toRaw(modalState.BatchForm); - from.neId = queryParams.neId || '-'; - from.algoIndex = `${from.algoIndex}`; - const result = batchAddUDMAuth(from, from.num); - result.then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - const timerS = Math.max( - Math.ceil(+from.num / 500), - `${from.num}`.length - ); - notification.success({ - message: modalState.title, - description: t('common.operateOk'), - duration: timerS, - }); - setTimeout(() => { - modalState.confirmLoading = false; - modalState.visibleByBatch = false; - modalStateBatchFrom.resetFields(); - fnGetList(1); - }, timerS * 1000); - } else { - modalState.confirmLoading = false; - notification.error({ - message: modalState.title, - description: res.msg, - duration: 3, - }); - } - }); - }) - .catch(e => { - message.error(t('common.errorFields', { num: e.errorFields.length }), 3); - }); -} - /** * 对话框弹出 批量删除确认执行函数 * 进行表达规则校验 @@ -455,15 +416,6 @@ function fnBatchDelModalOk() { }); } -/** - * 批量添加对话框弹出关闭执行函数 - * 进行表达规则校验 - */ -function fnBatchModalCancel() { - modalState.visibleByBatch = false; - modalStateBatchFrom.resetFields(); -} - /** * 批量删除对话框弹出关闭执行函数 * 进行表达规则校验 @@ -831,13 +783,6 @@ onMounted(() => { {{ t('common.addText') }} - - - {{ t('views.neUser.auth.batchAddText') }} - - { type="primary" danger ghost - @click.prevent="fnModalVisibleByBatch(0)" + @click.prevent="fnModalVisibleByBatch()" >