From 43f4451269c0440decb5554dd98b98befef332a2 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Thu, 21 Sep 2023 19:48:04 +0800 Subject: [PATCH 1/4] =?UTF-8?q?--=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=AD=BE=E7=BA=A6=E7=94=A8=E6=88=B7,=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=B8=AD=E8=8B=B1=E6=96=87=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 4 +- src/api/neUser/auth.ts | 29 ++- src/i18n/locales/en-US.ts | 8 +- src/i18n/locales/zh-CN.ts | 9 +- src/views/configManage/neManage/index.vue | 2 +- src/views/index.vue | 10 +- src/views/neUser/auth/index.vue | 220 ++++++++-------------- vite.config.ts | 4 +- 8 files changed, 129 insertions(+), 157 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index dc19f43a..482784c5 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -26,7 +26,7 @@ export async function listMain() { ...systemState, refresh: parseDateToStr(time), ipAddress: ipAddress, - name: key, + name: key.split("/").join("_"), status: '正常', }; } else { @@ -34,7 +34,7 @@ export async function listMain() { version: '-', refresh: parseDateToStr(time), ipAddress: ipAddress, - name: key, + name: key.split("/").join("_"), status: '异常', }; } diff --git a/src/api/neUser/auth.ts b/src/api/neUser/auth.ts index ee081c08..fb42be81 100644 --- a/src/api/neUser/auth.ts +++ b/src/api/neUser/auth.ts @@ -1,7 +1,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { request } from '@/plugins/http-fetch'; import { parseObjLineToHump } from '@/utils/parse-utils'; - +import { toRaw } from 'vue'; /** * 查询鉴权列表 * @param query 查询参数 @@ -39,3 +39,30 @@ export function updateAuth(data: Record) { data: data, }); } + + +/** + * 新增鉴权 + * @param data 鉴权对象 + * @returns object + */ +export function addAuth(neID:string,data: Record) { + return request({ + url: `/udmUserManage/v1/auth/${neID}`, + method: 'post', + data: data, + }); +} + + +/** + * 删除鉴权 + * @param data 鉴权对象 + * @returns object + */ +export function delAuth(neId:string,data: Record) { + return request({ + url: `/udmUserManage/v1/auth/${neId}/${data.imsi}`, + method: 'delete', + }); +} \ No newline at end of file diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 3332acce..8c5f8c17 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -3,7 +3,7 @@ export default { i18n: 'English', hello: 'Hello', - // 通用 + // 网管通用 common: { title: 'Core network management system', desc: '', @@ -40,6 +40,12 @@ export default { operate: "Operate", }, +// 网元通用 +nfCommon:{ + getAll:'Get ALL' + +}, + // 全局页脚 globalFooter: { help: 'Help', diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 690aa774..742d4e0e 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -3,7 +3,7 @@ export default { i18n: '中文', hello: '你好', - // 通用 + // 网管通用 common: { title: '核心网管理系统', desc: '', @@ -40,6 +40,13 @@ export default { operate: '操作', }, + // 网元通用 + nfCommon:{ + getAll:'全部获取' + + }, + + // 全局页脚 globalFooter: { help: '', diff --git a/src/views/configManage/neManage/index.vue b/src/views/configManage/neManage/index.vue index 94c55211..e6bda9a6 100644 --- a/src/views/configManage/neManage/index.vue +++ b/src/views/configManage/neManage/index.vue @@ -310,7 +310,7 @@ function fnRecordDelete(row: Record) { const key = 'delNotice'; message.loading({ content: '请稍等...', key }); delNeInfo(row).then(res => { - if (res.code === 200) { + if (res.code === RESULT_CODE_SUCCESS) { message.success({ content: `删除成功`, key, diff --git a/src/views/index.vue b/src/views/index.vue index 0395c434..7ff4958f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -1,10 +1,10 @@ diff --git a/src/views/neUser/auth/index.vue b/src/views/neUser/auth/index.vue index 903f7318..752c258a 100644 --- a/src/views/neUser/auth/index.vue +++ b/src/views/neUser/auth/index.vue @@ -14,7 +14,7 @@ import { delNeInfo, } from '@/api/configManage/neManage'; -import { listAuth, getAuth, updateAuth } from '@/api/neUser/auth'; +import { listAuth, getAuth, updateAuth,addAuth,delAuth} from '@/api/neUser/auth'; import { parseDateToStr } from '@/utils/date-utils'; import useNeInfoStore from '@/store/modules/neinfo'; import useI18n from '@/hooks/useI18n'; @@ -172,19 +172,13 @@ type ModalStateType = { let modalState: ModalStateType = reactive({ visibleByView: false, visibleByEdit: false, - title: '网元', + title: 'UDM鉴权用户', from: { - dn: '网络标识', - ip: '192.168.4.132', - neAddress: '192.160.0.107', - neId: '网元内部标识', - neName: '网元名称', - neType: 'AMF', - port: '3030', - province: '网元所在省份', - pvFlag: '', - rmUid: '资源唯一标识', - vendorName: '厂商名称', + imsi: '', + amf: '', + ki: '', + algoIndex: '', + opc: '', }, confirmLoading: false, }); @@ -193,13 +187,11 @@ let modalState: ModalStateType = reactive({ const modalStateFrom = Form.useForm( modalState.from, reactive({ - neType: [{ required: true, message: '网元类型不能为空' }], - neId: [{ required: true, message: '网元内部标识不能为空' }], - rmUid: [{ required: true, message: '资源唯一标识不能为空' }], - ip: [{ required: true, message: 'IP地址不能为空' }], - port: [{ required: true, message: '端口不能为空' }], - pvFlag: [{ required: true, message: '请选择网元虚拟化标识' }], - neName: [{ required: true, message: '网元名称不能为空' }], + imsi: [{ required: true, message: 'IMSI不能为空' }], + amf: [{ required: true, message: 'AMF不能为空' }], + ki: [{ required: true, message: 'KI不能为空' }], + algo: [{ required: true, message: 'algoIndex不能为空' }], + opc: [{ required: true, message: 'OPC能为空' }], }) ); @@ -231,6 +223,9 @@ function fnModalVisibleByEdit(row?: Record) { } } + + + /** * 对话框弹出确认执行函数 * 进行表达规则校验 @@ -241,7 +236,8 @@ function fnModalOk() { .then(e => { modalState.confirmLoading = true; const from = toRaw(modalState.from); - const result = from.id ? updateAuth(from) : addNeInfo(from); + const neID = queryParams.neId || '-'; + const result = from.id ? updateAuth(from) : addAuth(neID,from); const hide = message.loading({ content: t('common.loading') }); result .then(res => { @@ -281,18 +277,20 @@ function fnModalCancel() { } /** - * 网元删除 + * UDM鉴权用户删除 * @param row 网元编号ID */ function fnRecordDelete(row: Record) { Modal.confirm({ title: '提示', - content: `确认删除网元编号为 【${row.id}】 的数据项?`, + content: `确认删除IMSI编号为: ${row.imsi} 的用户嘛?`, onOk() { + const key = 'delNotice'; message.loading({ content: '请稍等...', key }); - delNeInfo(row).then(res => { - if (res.code === 200) { + const neID = queryParams.neId || '-'; + delAuth(neID,row).then(res => { + if (res.code === RESULT_CODE_SUCCESS) { message.success({ content: `删除成功`, key, @@ -328,6 +326,24 @@ function fnGetList() { }); } +/**全部获取 */ +function fnGetAll() { + if (tableState.loading) return; + tableState.loading = true; + listAuth(toRaw(queryParams)).then(res => { + if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { + // 取消勾选 + if (tableState.selectedRowKeys.length > 0) { + tableState.selectedRowKeys = []; + } + tablePagination.total = res.total; + tableState.data = res.rows; + } + tableState.loading = false; + }); +} + + onMounted(() => { // 获取列表数据 fnGetList(); @@ -366,7 +382,7 @@ onMounted(() => { :body-style="{ marginBottom: '24px', paddingBottom: 0 }" > - + @@ -413,6 +429,10 @@ onMounted(() => { {{ t('common.addText') }} + @@ -507,38 +527,38 @@ onMounted(() => { @ok="fnModalOk" @cancel="fnModalCancel" > - + - From e98020a17b5a28fc0990aac2bf09c03e34e231ad Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 21 Sep 2023 21:03:13 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E5=AF=BC=E8=88=AA=E6=A0=8F=E6=A0=87?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layouts/BasicLayout.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index 78a0f147..c7e0fa9f 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -134,7 +134,9 @@ tabsStore.clear(); @@ -201,4 +203,11 @@ tabsStore.clear(); border-style: none; border-radius: 6.66px; } + +.title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + width: 180px; +} From ead5dbcc76bf26a8ac3fb0bf6ac90e3b1b043b65 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Fri, 22 Sep 2023 10:32:43 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=205g=E5=9F=BA=E7=AB=99=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/neUser/base5G.ts | 30 ++ src/i18n/locales/en-US.ts | 4 + src/i18n/locales/zh-CN.ts | 4 + src/views/neUser/5gBase/index.vue | 676 ------------------------------ src/views/neUser/base5G/index.vue | 292 +++++++++++++ 5 files changed, 330 insertions(+), 676 deletions(-) create mode 100644 src/api/neUser/base5G.ts delete mode 100644 src/views/neUser/5gBase/index.vue create mode 100644 src/views/neUser/base5G/index.vue diff --git a/src/api/neUser/base5G.ts b/src/api/neUser/base5G.ts new file mode 100644 index 00000000..c1157436 --- /dev/null +++ b/src/api/neUser/base5G.ts @@ -0,0 +1,30 @@ +import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; +import { request } from '@/plugins/http-fetch'; +import { parseObjLineToHump } from '@/utils/parse-utils'; + +/** + * 查询列表 + * @param query 查询参数 + * @returns object + */ +export async function list5gBase(query: Record) { + query.nbId = query.id; + const result = await request({ + url: '/ueManagement/v1/elementType/amf/objectType/nbInfo', + method: 'get', + params: query, + }); + let data: DataList = { + total: 0, + rows: [], + code: result.code, + msg: result.msg, + }; + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { + const rows = parseObjLineToHump(result.data.data); + data.total = rows.length; + data.rows = rows; + } + return data; +} diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index fa3ee1e2..34b86666 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -124,6 +124,10 @@ export default { auth: { getAll: 'Get ALL', }, + 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 9e954148..a07383b4 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -124,6 +124,10 @@ export default { auth: { getAll: '全部获取', }, + base5G: { + neTypePlease: '查询网元类型', + neType: 'AMF网元类型', + }, }, }, }; diff --git a/src/views/neUser/5gBase/index.vue b/src/views/neUser/5gBase/index.vue deleted file mode 100644 index 94c55211..00000000 --- a/src/views/neUser/5gBase/index.vue +++ /dev/null @@ -1,676 +0,0 @@ - - - - - diff --git a/src/views/neUser/base5G/index.vue b/src/views/neUser/base5G/index.vue new file mode 100644 index 00000000..c5301507 --- /dev/null +++ b/src/views/neUser/base5G/index.vue @@ -0,0 +1,292 @@ + + + + +