From 92434e0cd3c24c648f82d22678e046763e944a48 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Sat, 23 Sep 2023 10:37:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=B9=E9=87=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/neUser/auth.ts | 18 ++++++++++++-- src/i18n/locales/en-US.ts | 11 +++++---- src/i18n/locales/zh-CN.ts | 11 +++++---- src/views/neUser/auth/index.vue | 42 ++++++++++++++++++++++++++++----- 4 files changed, 64 insertions(+), 18 deletions(-) diff --git a/src/api/neUser/auth.ts b/src/api/neUser/auth.ts index 77a25769..9f0565c9 100644 --- a/src/api/neUser/auth.ts +++ b/src/api/neUser/auth.ts @@ -98,9 +98,9 @@ export function addAuth(data: Record) { * @param data 鉴权对象 * @returns object */ -export function batchAuth(neID: string, data: Record) { +export function batchAuth( data: Record) { return request({ - url: `/udmUserManage/v1/auth/${neID}/${data.num}`, + url: `/udmUserManage/v1/auth/${data.neID}/${data.num}`, method: 'post', data: data, }); @@ -117,3 +117,17 @@ export function delAuth(neId: string, data: Record) { method: 'delete', }); } + + + +/** + * 批量删除鉴权 + * @param data 鉴权对象 + * @returns object + */ +export function batchDelAuth(neId:string,data: Record) { + return request({ + url: `/udmUserManage/v1/auth/${neId}/${data.imsi}/${data.num}`, + method: 'delete', + }); +} diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index b3c4f53d..3b962091 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -128,12 +128,13 @@ export default { loadData: "LoadData", num:'Number allocation', batchAddText: 'Batch Add', + batchDelText: 'Batch Del', }, - sub:{ - export: 'Export', - import: 'Import', - loadData: "LoadData" - }, + sub:{ + export: 'Export', + import: 'Import', + loadData: "LoadData" + }, base5G: { neTypePlease: 'Query network element type', neType: 'AMF Type', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 71310c57..0d29b526 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -128,12 +128,13 @@ export default { loadData: "更新数据", num:'放号数', batchAddText: '批量新增', + batchDelText: '批量删除', }, - sub:{ - export: '导出', - import: '导入', - loadData: "更新数据" - }, + sub:{ + export: '导出', + import: '导入', + loadData: "更新数据" + }, base5G: { neTypePlease: '查询网元类型', neType: 'AMF网元类型', diff --git a/src/views/neUser/auth/index.vue b/src/views/neUser/auth/index.vue index c584fdc0..c42d28e4 100644 --- a/src/views/neUser/auth/index.vue +++ b/src/views/neUser/auth/index.vue @@ -22,6 +22,7 @@ import useNeInfoStore from '@/store/modules/neinfo'; import useI18n from '@/hooks/useI18n'; import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { saveAs } from 'file-saver'; +import { formItemProps } from 'ant-design-vue/lib/form'; const { t } = useI18n(); const route = useRoute(); @@ -161,12 +162,16 @@ type ModalStateType = { visibleByEdit: boolean; /**批量新增新增框是否显示 */ visibleByBatch: boolean; + /**批量新增删除框是否显示 */ + visibleByBatchDel: boolean; /**标题 */ title: string; /**表单数据 */ from: Record; /**表单数据 */ BatchForm: Record; + /**表单数据 */ + BatchDelForm: Record; /**确定按钮 loading */ confirmLoading: boolean; /**更新加载数据按钮 loading */ @@ -178,8 +183,10 @@ let modalState: ModalStateType = reactive({ visibleByView: false, visibleByEdit: false, visibleByBatch: false, + visibleByBatchDel: false, title: 'UDM鉴权用户', from: { + id:'', imsi: '', amf: '', ki: '', @@ -194,6 +201,10 @@ let modalState: ModalStateType = reactive({ algoIndex: '', opc: '', }, + BatchDelForm: { + num: '', + imsi: '', + }, confirmLoading: false, loadDataLoading: false, }); @@ -210,7 +221,7 @@ const modalStateFrom = Form.useForm( }) ); -/**对话框内表单属性和校验规则 */ +/**对话框内批量添加表单属性和校验规则 */ const modalStateBatchFrom = Form.useForm( modalState.BatchForm, reactive({ @@ -226,6 +237,18 @@ const modalStateBatchFrom = Form.useForm( }) ); + +/**对话框内批量删除表单属性和校验规则 */ +const modalStateBatchDelFrom = Form.useForm( + modalState.BatchDelForm, + reactive({ + num: [{ required: true, message: '放号数不能为空' }, + { min: 1, max: 100, message: '放号数必须小于等于100' }], + imsi: [{ required: true, message: 'IMSI不能为空' }], + }) +); + + /** * 对话框弹出显示为 新增或者修改 * @param noticeId 网元id, 不传为新增 @@ -266,7 +289,7 @@ function fnModalVisibleByBatch(batchFlag?: number) { } else { modalStateBatchFrom.resetFields(); //重置表单 modalState.title = '批量删除鉴权信息'; - modalState.visibleByBatch = true; + modalState.visibleByBatchDel = true; } } @@ -313,7 +336,7 @@ function fnModalOk() { } /** - * 对话框弹出确认执行函数 + * 对话框弹出 批量操作确认执行函数 * 进行表达规则校验 */ function fnBatchModalOk() { @@ -324,7 +347,8 @@ function fnBatchModalOk() { const from = toRaw(modalState.BatchForm); const neID = queryParams.neId || '-'; // const result = from.id ? updateAuth(from) : addAuth(neID, from); - const result = batchAuth(neID, from); + from.neID=neID; + const result = batchAuth(from); const hide = message.loading({ content: t('common.loading') }); result .then(res => { @@ -608,7 +632,12 @@ onMounted(() => { {{ t('views.neUser.auth.batchAddText') }} - + + + {{ t('views.neUser.auth.batchDelText') }} + { :label-col="{ span: 7 }" > - + {{ modalState.from }} { >