Merge remote-tracking branch 'origin/main' into multi-tenant

This commit is contained in:
TsMask
2024-09-20 19:18:04 +08:00
68 changed files with 16577 additions and 3315 deletions

View File

@@ -194,8 +194,6 @@ type ModalStateType = {
/**表单数据 */
from: Record<string, any>;
/**表单数据 */
BatchForm: Record<string, any>;
/**表单数据 */
BatchDelForm: Record<string, any>;
/**确定按钮 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<string, any>) {
}
/**
* 对话框弹出显示为 批量新增,批量删除
* 对话框弹出显示为 批量删除
* @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,29 +783,11 @@ onMounted(() => {
{{ t('common.addText') }}
</a-button>
<a-button type="primary" @click.prevent="fnModalVisibleByBatch(1)">
<template #icon>
<PlusOutlined />
</template>
{{ t('views.neUser.auth.batchAddText') }}
</a-button>
<a-button
type="default"
danger
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')"
>
<template #icon><DeleteOutlined /></template>
{{ t('views.neUser.auth.checkDel') }}
</a-button>
<a-button
type="primary"
danger
ghost
@click.prevent="fnModalVisibleByBatch(0)"
@click.prevent="fnModalVisibleByBatch()"
>
<template #icon>
<DeleteOutlined />
@@ -900,6 +834,17 @@ onMounted(() => {
</a-button>
</a-popconfirm>
<a-button
type="default"
danger
:disabled="tableState.selectedRowKeys.length <= 0"
:loading="modalState.loadDataLoading"
@click.prevent="fnRecordDelete('0')"
>
<template #icon><DeleteOutlined /></template>
{{ t('views.neUser.auth.checkDel') }}
</a-button>
<a-popconfirm
:title="t('views.neUser.auth.checkExportConfirm')"
placement="topRight"
@@ -1040,6 +985,24 @@ onMounted(() => {
:label-col="{ span: 6 }"
:labelWrap="true"
>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.neUser.auth.numAdd')"
name="num"
v-bind="modalStateFrom.validateInfos.num"
v-show="!modalState.from.id"
>
<a-input-number
v-model:value="modalState.from.num"
style="width: 100%"
:min="1"
:max="10000"
placeholder="<=10000"
></a-input-number>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
@@ -1175,175 +1138,6 @@ onMounted(() => {
</a-form>
</ProModal>
<!-- 批量新增框 -->
<ProModal
:drag="true"
:width="800"
:destroyOnClose="true"
:keyboard="false"
:mask-closable="false"
:visible="modalState.visibleByBatch"
:title="modalState.title"
:confirm-loading="modalState.confirmLoading"
@ok="fnBatchModalOk"
@cancel="fnBatchModalCancel"
>
<a-form
name="modalStateBatchFrom"
layout="horizontal"
:label-col="{ span: 6 }"
:labelWrap="true"
>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
:label="t('views.neUser.auth.numAdd')"
name="num"
v-bind="modalStateBatchFrom.validateInfos.num"
>
<a-input-number
v-model:value="modalState.BatchForm.num"
style="width: 100%"
:min="1"
:max="10000"
placeholder="<=10000"
></a-input-number>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="IMSI"
name="imsi"
v-bind="modalStateBatchFrom.validateInfos.imsi"
>
<a-input
v-model:value="modalState.BatchForm.imsi"
allow-clear
:maxlength="15"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.neUser.auth.imsiTip') }}<br />
{{ t('views.neUser.auth.imsiTip1') }}<br />
{{ t('views.neUser.auth.imsiTip2') }}<br />
{{ t('views.neUser.auth.imsiTip3') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item label="Status" name="status">
<a-select value="1">
<a-select-option value="1">Active</a-select-option>
<a-select-option value="0">Inactive</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="16">
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="AMF"
name="amf"
v-bind="modalStateBatchFrom.validateInfos.amf"
>
<a-input
v-model:value="modalState.BatchForm.amf"
allow-clear
:maxlength="4"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.neUser.auth.amfTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
</a-col>
<a-col :lg="12" :md="12" :xs="24">
<a-form-item
label="Algo Index"
name="algo"
v-bind="modalStateBatchFrom.validateInfos.algoIndex"
>
<a-input-number
v-model:value="modalState.BatchForm.algoIndex"
style="width: 100%"
:min="0"
:max="15"
placeholder="0 ~ 15"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.neUser.auth.algoIndexTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
</a-input-number>
</a-form-item>
</a-col>
</a-row>
<a-form-item
label="KI"
name="ki"
v-bind="modalStateBatchFrom.validateInfos.ki"
:label-col="{ span: 3 }"
:labelWrap="true"
>
<a-input
v-model:value="modalState.BatchForm.ki"
allow-clear
:maxlength="32"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.neUser.auth.kiTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
<a-form-item
label="OPC"
name="opc"
v-bind="modalStateBatchFrom.validateInfos.opc"
:label-col="{ span: 3 }"
:labelWrap="true"
>
<a-input
v-model:value="modalState.BatchForm.opc"
allow-clear
:maxlength="32"
>
<template #prefix>
<a-tooltip placement="topLeft">
<template #title>
{{ t('views.neUser.auth.opcTip') }}
</template>
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip>
</template>
</a-input>
</a-form-item>
</a-form>
</ProModal>
<!-- 批量删除框 -->
<ProModal
:drag="true"

View File

@@ -85,6 +85,15 @@ let tableColumns: ColumnsType = [
align: 'center',
width: 100,
},
{
title: 'NE Name',
dataIndex: 'neName',
align: 'left',
resizable: true,
width: 200,
minWidth: 150,
maxWidth: 400,
},
{
title: 'UE Number',
dataIndex: 'ueNum',
@@ -158,10 +167,11 @@ function fnGet45GList(pageNum?: number) {
queryParams.pageNum = pageNum;
}
if (!queryParams.neType) {
tableState.data = [];
promises.value = [];
//同时获取45G基站信息 且在每条信息中添加45G字段(原始数据没有) 已经筛选后的
neCascaderOptions.value.map((item: any) => {
item.children.forEach((child: any) => {
item.children.forEach((child: any) => {
promises.value.push(
listBase5G({
neId: child.neId,
@@ -169,6 +179,14 @@ function fnGet45GList(pageNum?: number) {
nbId: queryParams.id,
pageNum: queryParams.pageNum,
pageSize: 10000,
}).then(res => {
// 添加 neName 字段到每一项数据
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
res.rows.forEach(row => {
row.neName = `${child.neType}_${child.neId}`;
});
}
return res;
})
);
});
@@ -202,6 +220,7 @@ function fnGet45GList(pageNum?: number) {
}
});
});
return;
}

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@ import { message } from 'ant-design-vue/lib';
import { SizeType } from 'ant-design-vue/lib/config-provider';
import { MenuInfo } from 'ant-design-vue/lib/menu/src/interface';
import { ColumnsType } from 'ant-design-vue/lib/table';
import { listUEInfoBySMF } from '@/api/neUser/smf';
import { listSMFSubscribers } from '@/api/neData/smf';
import useNeInfoStore from '@/store/modules/neinfo';
import useI18n from '@/hooks/useI18n';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
@@ -59,8 +59,6 @@ type TabeStateType = {
seached: boolean;
/**记录数据 */
data: object[];
/**勾选记录 */
selectedRowKeys: (string | number)[];
};
/**表格状态 */
@@ -69,7 +67,6 @@ let tableState: TabeStateType = reactive({
size: 'middle',
seached: true,
data: [],
selectedRowKeys: [],
});
/**表格字段列 */
@@ -77,7 +74,7 @@ let tableColumns: ColumnsType = [
{
title: 'IMSI',
dataIndex: 'imsi',
align: 'center',
align: 'left',
sorter: (a: any, b: any) => Number(a.imsi) - Number(b.imsi),
customRender(opt) {
const idx = opt.value.lastIndexOf('-');
@@ -91,7 +88,7 @@ let tableColumns: ColumnsType = [
{
title: 'MSISDN',
dataIndex: 'msisdn',
align: 'center',
align: 'left',
sorter: (a: any, b: any) => Number(a.msisdn) - Number(b.msisdn),
customRender(opt) {
const idx = opt.value.lastIndexOf('-');
@@ -105,7 +102,7 @@ let tableColumns: ColumnsType = [
{
title: 'RAT Type',
dataIndex: 'ratType',
align: 'center',
align: 'left',
width: 100,
},
{
@@ -124,7 +121,7 @@ let tableColumns: ColumnsType = [
}
return '';
},
width: 150,
width: 200,
},
{
title: 'Tenant Name',
@@ -137,6 +134,12 @@ let tableColumns: ColumnsType = [
title: t('common.operate'),
key: 'imsi',
align: 'left',
width: 100,
},
{
title: 'Remark',
dataIndex: 'remark',
align: 'left',
},
];
@@ -238,12 +241,8 @@ function fnGetList(pageNum?: number) {
if (pageNum) {
queryParams.pageNum = pageNum;
}
listUEInfoBySMF(toRaw(queryParams)).then(res => {
listSMFSubscribers(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;
if (
@@ -321,7 +320,7 @@ onMounted(() => {
<!-- 表格搜索栏 -->
<a-form :model="queryParams" name="queryParams" layout="horizontal">
<a-row :gutter="16">
<a-col :lg="8" :md="12" :xs="24">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item :label="t('views.neUser.ue.neType')" name="neId ">
<a-select
v-model:value="queryParams.neId"
@@ -330,12 +329,12 @@ onMounted(() => {
/>
</a-form-item>
</a-col>
<a-col :lg="8" :md="12" :xs="24">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="IMSI" name="imsi">
<a-input v-model:value="queryParams.imsi" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="8" :md="12" :xs="24">
<a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn">
<a-input v-model:value="queryParams.msisdn" allow-clear></a-input>
</a-form-item>
@@ -434,7 +433,7 @@ onMounted(() => {
:data-source="tableState.data"
:size="tableState.size"
:pagination="tablePagination"
:scroll="{ x: 1000, y: 400 }"
:scroll="{ x: true, y: 400 }"
>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'imsi'">