feat: UE AMBR配置功能
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
|||||||
resetUDMSub,
|
resetUDMSub,
|
||||||
updateUDMSub,
|
updateUDMSub,
|
||||||
} from '@/api/neData/udm_sub';
|
} from '@/api/neData/udm_sub';
|
||||||
|
import { getNeConfigData, addNeConfigData } from '@/api/ne/neConfig';
|
||||||
import { uploadFile } from '@/api/tool/file';
|
import { uploadFile } from '@/api/tool/file';
|
||||||
import { getNeViewFile } from '@/api/tool/neFile';
|
import { getNeViewFile } from '@/api/tool/neFile';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@@ -111,39 +112,42 @@ let tableColumns = ref<ColumnsType>([
|
|||||||
{
|
{
|
||||||
title: 'Subscribed AMBR',
|
title: 'Subscribed AMBR',
|
||||||
dataIndex: 'ambr',
|
dataIndex: 'ambr',
|
||||||
align: 'center',
|
align: 'left',
|
||||||
width: 100,
|
resizable: true,
|
||||||
|
width: 150,
|
||||||
|
minWidth: 150,
|
||||||
|
maxWidth: 300,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Subscribed SNSSAIs',
|
title: 'Subscribed SNSSAIs',
|
||||||
dataIndex: 'nssai',
|
dataIndex: 'nssai',
|
||||||
align: 'center',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Forbidden Areas',
|
title: 'Forbidden Areas',
|
||||||
dataIndex: 'arfb',
|
dataIndex: 'arfb',
|
||||||
align: 'center',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'Service Area Restrict',
|
title: 'Service Area Restrict',
|
||||||
dataIndex: 'sar',
|
dataIndex: 'sar',
|
||||||
align: 'center',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '5G',
|
title: '5G',
|
||||||
dataIndex: 'cn',
|
dataIndex: 'cn',
|
||||||
key: 'cnFlag',
|
key: 'cnFlag',
|
||||||
align: 'center',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '4G',
|
title: '4G',
|
||||||
dataIndex: 'epsFlag',
|
dataIndex: 'epsFlag',
|
||||||
key: 'epsFlag',
|
key: 'epsFlag',
|
||||||
align: 'center',
|
align: 'left',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -237,6 +241,10 @@ type ModalStateType = {
|
|||||||
confirmLoading: boolean;
|
confirmLoading: boolean;
|
||||||
/**更新加载数据按钮 loading */
|
/**更新加载数据按钮 loading */
|
||||||
loadDataLoading: boolean;
|
loadDataLoading: boolean;
|
||||||
|
/**5G Subscribed UE AMBR 模板对象 */
|
||||||
|
ambr: Record<string, any>;
|
||||||
|
/**已有AMBE数据 */
|
||||||
|
ambrData: Record<string, any>[];
|
||||||
};
|
};
|
||||||
|
|
||||||
/**对话框对象信息状态 */
|
/**对话框对象信息状态 */
|
||||||
@@ -288,6 +296,36 @@ let modalState: ModalStateType = reactive({
|
|||||||
},
|
},
|
||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
loadDataLoading: false,
|
loadDataLoading: false,
|
||||||
|
// 5G Subscribed UE AMBR
|
||||||
|
ambr: {
|
||||||
|
uplink: 1,
|
||||||
|
uplinkUnit: 'Gbps',
|
||||||
|
downlink: 2,
|
||||||
|
downlinkUnit: 'Gbps',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'bps',
|
||||||
|
value: 'bps',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Kbps',
|
||||||
|
value: 'Kbps',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Mbps',
|
||||||
|
value: 'Mbps',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Gbps',
|
||||||
|
value: 'Gbps',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Tbps',
|
||||||
|
value: 'Tbps',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
ambrData: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
/**表单中多选的OPTION */
|
/**表单中多选的OPTION */
|
||||||
@@ -386,7 +424,23 @@ function fnModalVisibleByBatch() {
|
|||||||
* 对话框弹出显示为 新增或者修改
|
* 对话框弹出显示为 新增或者修改
|
||||||
* @param noticeId 网元id, 不传为新增
|
* @param noticeId 网元id, 不传为新增
|
||||||
*/
|
*/
|
||||||
function fnModalVisibleByEdit(imsi?: string) {
|
async function fnModalVisibleByEdit(imsi?: string) {
|
||||||
|
const neId = queryParams.neId || '-';
|
||||||
|
|
||||||
|
// 获取AMBR数据
|
||||||
|
const ambrRes = await getNeConfigData({
|
||||||
|
neType: 'UDM',
|
||||||
|
neId: neId,
|
||||||
|
paramName: 'subsUEAmbr',
|
||||||
|
});
|
||||||
|
if (ambrRes.code === RESULT_CODE_SUCCESS) {
|
||||||
|
modalState.ambr.uplink = 1;
|
||||||
|
modalState.ambr.uplinkUnit = 'Gbps';
|
||||||
|
modalState.ambr.downlink = 2;
|
||||||
|
modalState.ambr.downlinkUnit = 'Gbps';
|
||||||
|
modalState.ambrData = ambrRes.data;
|
||||||
|
}
|
||||||
|
|
||||||
if (!imsi) {
|
if (!imsi) {
|
||||||
modalStateFrom.resetFields();
|
modalStateFrom.resetFields();
|
||||||
modalState.title = t('common.addText') + t('views.neUser.sub.subInfo');
|
modalState.title = t('common.addText') + t('views.neUser.sub.subInfo');
|
||||||
@@ -395,60 +449,68 @@ function fnModalVisibleByEdit(imsi?: string) {
|
|||||||
if (modalState.confirmLoading) return;
|
if (modalState.confirmLoading) return;
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
const neId = queryParams.neId || '-';
|
// 获取IMSI数据
|
||||||
getUDMSub(neId, imsi)
|
const res = await getUDMSub(neId, imsi);
|
||||||
.then(res => {
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
transformFormData(res.data.smData);
|
||||||
transformFormData(res.data.smData);
|
let ardAll = parseInt(res.data.ard).toString(2).padStart(8, '0');
|
||||||
let ardAll = parseInt(res.data.ard).toString(2).padStart(8, '0');
|
let hplAll = parseInt(res.data.hplmnOdb).toString(2).padStart(8, '0');
|
||||||
let hplAll = parseInt(res.data.hplmnOdb).toString(2).padStart(8, '0');
|
let odbAll = parseInt(res.data.epsOdb).toString(2).padStart(9, '0');
|
||||||
let odbAll = parseInt(res.data.epsOdb).toString(2).padStart(9, '0');
|
const ardArray: any[] = [];
|
||||||
const ardArray: any[] = [];
|
const hplmnArray: any[] = [];
|
||||||
const hplmnArray: any[] = [];
|
const epsOdbArray: any[] = [];
|
||||||
const epsOdbArray: any[] = [];
|
for (let i = 0; i < ardAll.length; i++) {
|
||||||
for (let i = 0; i < ardAll.length; i++) {
|
if (PrefixZero(ardAll, ardAll.length).charAt(i) === '1') {
|
||||||
if (PrefixZero(ardAll, ardAll.length).charAt(i) === '1') {
|
ardArray.push(i);
|
||||||
ardArray.push(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < hplAll.length; i++) {
|
|
||||||
if (PrefixZero(hplAll, hplAll.length).charAt(i) === '1') {
|
|
||||||
hplmnArray.push(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i = 0; i < odbAll.length; i++) {
|
|
||||||
if (PrefixZero(odbAll, odbAll.length).charAt(i) === '1') {
|
|
||||||
epsOdbArray.push(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
res.data.ard = ardArray;
|
|
||||||
res.data.hplmnOdb = hplmnArray;
|
|
||||||
res.data.epsOdb = epsOdbArray;
|
|
||||||
|
|
||||||
// 4G APN Context List
|
|
||||||
const apnContextStr = res.data.apnContext;
|
|
||||||
const apnContextArr = [];
|
|
||||||
for (let i = 0; i < apnContextStr.length; i += 2) {
|
|
||||||
const num = Number(`${apnContextStr[i]}${apnContextStr[i + 1]}`);
|
|
||||||
apnContextArr.push(num);
|
|
||||||
}
|
|
||||||
|
|
||||||
modalState.from = Object.assign(modalState.from, res.data, {
|
|
||||||
apnContext: apnContextArr,
|
|
||||||
});
|
|
||||||
|
|
||||||
modalState.title =
|
|
||||||
t('common.editText') + t('views.neUser.sub.subInfo');
|
|
||||||
modalState.openByEdit = true;
|
|
||||||
} else {
|
|
||||||
message.error(t('common.getInfoFail'), 2);
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
.finally(() => {
|
|
||||||
hide();
|
for (let i = 0; i < hplAll.length; i++) {
|
||||||
modalState.confirmLoading = false;
|
if (PrefixZero(hplAll, hplAll.length).charAt(i) === '1') {
|
||||||
|
hplmnArray.push(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < odbAll.length; i++) {
|
||||||
|
if (PrefixZero(odbAll, odbAll.length).charAt(i) === '1') {
|
||||||
|
epsOdbArray.push(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.data.ard = ardArray;
|
||||||
|
res.data.hplmnOdb = hplmnArray;
|
||||||
|
res.data.epsOdb = epsOdbArray;
|
||||||
|
|
||||||
|
// 4G APN Context List
|
||||||
|
const apnContextStr = res.data.apnContext;
|
||||||
|
const apnContextArr = [];
|
||||||
|
for (let i = 0; i < apnContextStr.length; i += 2) {
|
||||||
|
const num = Number(`${apnContextStr[i]}${apnContextStr[i + 1]}`);
|
||||||
|
apnContextArr.push(num);
|
||||||
|
}
|
||||||
|
|
||||||
|
modalState.from = Object.assign(modalState.from, res.data, {
|
||||||
|
apnContext: apnContextArr,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// AMBR数据
|
||||||
|
const ambrItem = modalState.ambrData.find(
|
||||||
|
item => item.name === modalState.from.ambr
|
||||||
|
);
|
||||||
|
if (ambrItem) {
|
||||||
|
const uplinkItme = ambrItem.uplink.split(' ');
|
||||||
|
modalState.ambr.uplink = uplinkItme[0] || 1;
|
||||||
|
modalState.ambr.uplinkUnit = uplinkItme[1] || 'Gbps';
|
||||||
|
const downlinkItme = ambrItem.downlink.split(' ');
|
||||||
|
modalState.ambr.downlink = downlinkItme[0] || 2;
|
||||||
|
modalState.ambr.downlinkUnit = downlinkItme[1] || 'Gbps';
|
||||||
|
}
|
||||||
|
|
||||||
|
modalState.title = t('common.editText') + t('views.neUser.sub.subInfo');
|
||||||
|
modalState.openByEdit = true;
|
||||||
|
} else {
|
||||||
|
message.error(t('common.getInfoFail'), 2);
|
||||||
|
}
|
||||||
|
hide();
|
||||||
|
modalState.confirmLoading = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -614,7 +676,7 @@ function fnModalOk() {
|
|||||||
|
|
||||||
modalStateFrom
|
modalStateFrom
|
||||||
.validate()
|
.validate()
|
||||||
.then(e => {
|
.then(async e => {
|
||||||
modalState.confirmLoading = true;
|
modalState.confirmLoading = true;
|
||||||
let ardArr = [0, 0, 0, 0, 0, 0, 0, 0];
|
let ardArr = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
let hplmnArr = [0, 0, 0, 0, 0, 0, 0, 0];
|
let hplmnArr = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
@@ -646,58 +708,107 @@ function fnModalOk() {
|
|||||||
from.regTimer = `${from.regTimer}`;
|
from.regTimer = `${from.regTimer}`;
|
||||||
from.ueUsageType = `${from.ueUsageType}`;
|
from.ueUsageType = `${from.ueUsageType}`;
|
||||||
from.neId = queryParams.neId || '-';
|
from.neId = queryParams.neId || '-';
|
||||||
const result = from.id
|
|
||||||
? updateUDMSub(from)
|
// 组合检查ambr
|
||||||
: from.num === 1
|
from.ambr = await fnAMBRName();
|
||||||
? addUDMSub(from)
|
|
||||||
: batchAddUDMSub(from, from.num);
|
let res = null;
|
||||||
|
if (from.id) {
|
||||||
|
res = await updateUDMSub(from);
|
||||||
|
} else {
|
||||||
|
if (from.num === 1) {
|
||||||
|
res = await addUDMSub(from);
|
||||||
|
} else {
|
||||||
|
res = await batchAddUDMSub(from, from.num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!res) return;
|
||||||
|
|
||||||
const hide = message.loading(t('common.loading'), 0);
|
const hide = message.loading(t('common.loading'), 0);
|
||||||
result
|
if (res.code === RESULT_CODE_SUCCESS) {
|
||||||
.then(res => {
|
if (from.num === 1) {
|
||||||
if (res.code === RESULT_CODE_SUCCESS) {
|
message.success({
|
||||||
if (from.num === 1) {
|
content: t('common.msgSuccess', { msg: modalState.title }),
|
||||||
message.success({
|
duration: 3,
|
||||||
content: t('common.msgSuccess', { msg: modalState.title }),
|
});
|
||||||
duration: 3,
|
fnGetList(1);
|
||||||
});
|
} else {
|
||||||
fnGetList(1);
|
const timerS = Math.ceil(+from.num / 800) + 1;
|
||||||
} else {
|
notification.success({
|
||||||
const timerS = Math.ceil(+from.num / 800) + 1;
|
message: modalState.title,
|
||||||
notification.success({
|
description: t('common.operateOk'),
|
||||||
message: modalState.title,
|
duration: timerS,
|
||||||
description: t('common.operateOk'),
|
});
|
||||||
duration: timerS,
|
setTimeout(() => {
|
||||||
});
|
fnGetList(1);
|
||||||
setTimeout(() => {
|
}, timerS * 1000);
|
||||||
fnGetList(1);
|
}
|
||||||
}, timerS * 1000);
|
} else {
|
||||||
}
|
if (from.num === 1) {
|
||||||
} else {
|
message.error({
|
||||||
if (from.num === 1) {
|
content: `${res.msg}`,
|
||||||
message.error({
|
duration: 3,
|
||||||
content: `${res.msg}`,
|
});
|
||||||
duration: 3,
|
} else {
|
||||||
});
|
notification.error({
|
||||||
} else {
|
message: modalState.title,
|
||||||
notification.error({
|
description: res.msg,
|
||||||
message: modalState.title,
|
duration: 3,
|
||||||
description: res.msg,
|
});
|
||||||
duration: 3,
|
}
|
||||||
});
|
}
|
||||||
}
|
|
||||||
}
|
hide();
|
||||||
})
|
fnModalCancel();
|
||||||
.finally(() => {
|
modalState.confirmLoading = false;
|
||||||
hide();
|
|
||||||
fnModalCancel();
|
|
||||||
modalState.confirmLoading = false;
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch(e => {
|
.catch(e => {
|
||||||
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
message.error(t('common.errorFields', { num: e.errorFields.length }), 3);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查ambr是否存在,不存在则新增
|
||||||
|
*/
|
||||||
|
async function fnAMBRName() {
|
||||||
|
const ambrItem = modalState.ambrData.find(
|
||||||
|
item =>
|
||||||
|
item.downlink ===
|
||||||
|
`${modalState.ambr.downlink} ${modalState.ambr.downlinkUnit}` &&
|
||||||
|
item.uplink === `${modalState.ambr.uplink} ${modalState.ambr.uplinkUnit}`
|
||||||
|
);
|
||||||
|
if (ambrItem) {
|
||||||
|
return ambrItem.name;
|
||||||
|
} else {
|
||||||
|
// 新增
|
||||||
|
const ambrData = modalState.ambrData.sort((a: any, b: any) => {
|
||||||
|
return b.index - a.index;
|
||||||
|
});
|
||||||
|
if (ambrData.length > 0) {
|
||||||
|
const neId = queryParams.neId || '-';
|
||||||
|
const loc = ambrData[0].index + 1;
|
||||||
|
const name = `ambr_${modalState.ambr.uplink}${modalState.ambr.uplinkUnit}_${modalState.ambr.downlink}${modalState.ambr.downlinkUnit}`;
|
||||||
|
const ambrRes = await addNeConfigData({
|
||||||
|
neType: 'UDM',
|
||||||
|
neId: neId,
|
||||||
|
paramName: 'subsUEAmbr',
|
||||||
|
paramData: {
|
||||||
|
index: loc,
|
||||||
|
name: name,
|
||||||
|
uplink: `${modalState.ambr.uplink} ${modalState.ambr.uplinkUnit}`,
|
||||||
|
downlink: `${modalState.ambr.downlink} ${modalState.ambr.downlinkUnit}`,
|
||||||
|
},
|
||||||
|
loc: `${loc}`,
|
||||||
|
});
|
||||||
|
if (ambrRes.code === RESULT_CODE_SUCCESS) {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return 'def_ambr';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**对话框内批量添加表单属性和校验规则 */
|
/**对话框内批量添加表单属性和校验规则 */
|
||||||
const modalStateBatchDelFrom = Form.useForm(
|
const modalStateBatchDelFrom = Form.useForm(
|
||||||
modalState.BatchDelForm,
|
modalState.BatchDelForm,
|
||||||
@@ -1700,7 +1811,7 @@ onMounted(() => {
|
|||||||
</a-select>
|
</a-select>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="24" :md="24" :xs="24">
|
<!-- <a-col :lg="24" :md="24" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="5G Subscribed UE AMBR Template"
|
label="5G Subscribed UE AMBR Template"
|
||||||
name="ambr"
|
name="ambr"
|
||||||
@@ -1723,7 +1834,41 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
</a-col> -->
|
||||||
|
|
||||||
|
<a-col :lg="24" :md="24" :xs="24">
|
||||||
|
<a-form-item label="5G Subscribed UE AMBR" name="ambr">
|
||||||
|
<a-row :gutter="8">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-input v-model:value="modalState.ambr.uplink">
|
||||||
|
<template #addonBefore>Uplink</template>
|
||||||
|
<template #addonAfter>
|
||||||
|
<a-select
|
||||||
|
v-model:value="modalState.ambr.uplinkUnit"
|
||||||
|
style="width: 100px"
|
||||||
|
:options="modalState.ambr.options"
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
</a-input>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-input v-model:value="modalState.ambr.downlink">
|
||||||
|
<template #addonBefore>Downlink</template>
|
||||||
|
<template #addonAfter>
|
||||||
|
<a-select
|
||||||
|
v-model:value="modalState.ambr.downlinkUnit"
|
||||||
|
style="width: 100px"
|
||||||
|
:options="modalState.ambr.options"
|
||||||
|
>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
</a-input>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :lg="24" :md="24" :xs="24">
|
<a-col :lg="24" :md="24" :xs="24">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="5G Subscribed SNSSAIs Template"
|
label="5G Subscribed SNSSAIs Template"
|
||||||
|
|||||||
Reference in New Issue
Block a user