From f2d5379506d03f416ead1f0343f6600347036e03 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Thu, 30 Nov 2023 16:43:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9EPCF=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=AD=96=E7=95=A5=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/neUser/pcf.ts | 208 ++++++++ src/i18n/locales/en-US.ts | 18 + src/i18n/locales/zh-CN.ts | 18 + src/views/neUser/pcf/index.vue | 946 +++++++++++++++++++++++++++++++++ 4 files changed, 1190 insertions(+) create mode 100644 src/api/neUser/pcf.ts create mode 100644 src/views/neUser/pcf/index.vue diff --git a/src/api/neUser/pcf.ts b/src/api/neUser/pcf.ts new file mode 100644 index 00000000..ce67ec88 --- /dev/null +++ b/src/api/neUser/pcf.ts @@ -0,0 +1,208 @@ +import { + RESULT_CODE_ERROR, + RESULT_CODE_SUCCESS, +} from '@/constants/result-constants'; +import { request } from '@/plugins/http-fetch'; +import { parseObjLineToHump } from '@/utils/parse-utils'; + +/** + * 签约规则导出 + * @param data 表单数据对象 + * @returns bolb + */ +export function exportRule(data: Record) { + return request({ + url: '/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/file/export', + method: 'post', + data: data, + responseType: 'blob', + timeout: 180_000, + }); +} + +/** + * 导入规则数据 + * @param neId 网元ID + * @param data 表单数据对象 + * @returns object + */ +export function importRuleData(data: Record) { + return request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/file/import`, + method: 'post', + data, + timeout: 60_000, + }); +} + +/** + * 查询规则列表 + * @param query 查询参数 + * @returns object + */ +export async function listRules(query: Record) { + const result = await request({ + url: '/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo', + 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; + } + + // 模拟数据 + // data.rows = [ + // { + // msisdn: '12307550237', + // pccRules: 'internet', + // rfsp: 0, + // sessRules: 'internet', + // }, + // { + // msisdn: '12307550238', + // pccRules: 'internet|ims_sig', + // rfsp: 0, + // sessRules: 'internet|ims_sig', + // }, + // ]; + + return data; +} + +/** + * 查询规则详细 + * @param neId 网元ID + * @returns object + */ +export async function getRule(neId: string, imsi: string) { + const result = await request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${neId}&imsi=${imsi}`, + method: 'get', + }); + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && Array.isArray(result.data.data)) { + result.data = result.data.data[0]; + } + return result; +} + +/** + * 修改规则 + * @param data 规则对象 + * @returns object + */ +export async function updateRule(data: Record) { + const result = await request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${data.neId}`, + method: 'put', + data: data, + }); + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && result.data?.status) { + return { + code: RESULT_CODE_ERROR, + msg: result.data?.cause, + data: result.data, + }; + } + return result; +} + +/** + * 批量修改规则 + * @param data 规则对象 + * @returns object + */ +export async function batchUpdateRule(data: Record) { + const result = await request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/${data.num}?neId=${data.neId}`, + method: 'put', + data: data, + }); + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && result.data?.status) { + return { + code: RESULT_CODE_ERROR, + msg: result.data?.cause, + data: result.data, + }; + } + return result; +} + +/** + * 新增规则 + * @param data 规则对象 + * @returns object + */ +export async function addRule(data: Record) { + const result = await request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${data.neId}`, + method: 'post', + data: data, + }); + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && result.data?.status) { + return { + code: RESULT_CODE_ERROR, + msg: result.data?.cause, + data: result.data, + }; + } + return result; +} + +/** + * 批量新增规则 + * @param data 规则对象 + * @returns object + */ +export async function batchAddRule(data: Record) { + const result = await request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/${data.num}?neId=${data.neId}`, + method: 'post', + data: data, + }); + // 解析数据 + if (result.code === RESULT_CODE_SUCCESS && result.data?.status) { + return { + code: RESULT_CODE_ERROR, + msg: result.data?.cause, + data: result.data, + }; + } + return result; +} + +/** + * 删除规则 + * @param data 规则对象 + * @returns object + */ +export function delRule(neId: string, data: Record) { + return request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${neId}&imsi=${data.imsi}`, + method: 'delete', + }); +} + +/** + * 批量删除规则 + * @param data 规则对象 + * @returns object + */ +export async function batchDelRule(data: Record) { + return request({ + url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/${data.num}?neId=${data.neId}&imsi=${data.imsi}`, + method: 'delete', + }); +} diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index 8e31a135..3d7c782b 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -528,6 +528,24 @@ export default { hplmnOdbTip: 'HPLMN-ODB homing operator-determined blocking, i.e., the ability of a subscriber to access services in the EPS network is determined by the subscriber is homing operator', ardTip:'Access-Restriction-Data (Access-Restriction-Data), can be used to distinguish between 2G/3G/LTE users, to facilitate the coexistence of 2G/3G/LTE network for different types of users to distinguish between the service', }, + pcf: { + neType: 'PCF Object', + export: 'Export', + exportConfirm: 'Confirm exporting all user policy control information data?', + import: 'Import', + addTitle: 'Adding Policy Control Information', + updateTitle: '{imsi} Policy control information', + startIMSI: 'Start IMSI', + batchAddText: 'Batch Addition', + batchDelText: 'Batch Deletion', + batchUpdateText: 'Batch Update', + batchNum: 'Number of batches', + imsiTip: 'IMSI=MCC+MNC+MSIN', + imsiTip1: 'MCC=Mobile Country Code, consisting of three digits.', + imsiTip2: 'MNC = Mobile Network Number, consisting of two digits', + imsiTip3: 'MSIN = Mobile Subscriber Identification Number, consisting of 10 equal digits.', + delSure:'Are you sure you want to delete the user with IMSI number: {imsi}?', + }, base5G: { neType: 'AMF Object', }, diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index ec735a4b..acff204e 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -528,6 +528,24 @@ export default { hplmnOdbTip: 'HPLMN-ODB归属运营商决定的闭锁,即用户接入EPS网络的业务能力由用户归宿运营商决定.选中 --- 对应服务被允许 未选 -- 对应服务被禁止', ardTip:'接入控制标志(Access-Restriction-Data),可用于区分2G/3G/LTE用户,便于为2G/3G/LTE网络共存时,对不同类型用户进行区分服务', }, + pcf: { + neType: 'PCF网元对象', + export: '导出', + exportConfirm: '确认导出全部用户策略控制信息数据吗?', + import: '导入', + addTitle: '新增策略控制信息', + updateTitle: '{imsi} 策略控制信息', + startIMSI: '起始IMSI', + batchAddText: '批量新增', + batchDelText: '批量删除', + batchUpdateText: '批量更新', + batchNum: '批量个数', + imsiTip: 'IMSI=MCC+MNC+MSIN', + imsiTip1: 'MCC=移动国家号码, 由三位数字组成', + imsiTip2: 'MNC=移动网络号,由两位数字组成', + imsiTip3: 'MSIN=移动客户识别码,采用等长10位数字构成', + delSure:'确认删除IMSI编号为: {imsi} 的用户吗?', + }, base5G: { neType: 'AMF网元对象', }, diff --git a/src/views/neUser/pcf/index.vue b/src/views/neUser/pcf/index.vue new file mode 100644 index 00000000..bca38312 --- /dev/null +++ b/src/views/neUser/pcf/index.vue @@ -0,0 +1,946 @@ + + + + +