Merge remote-tracking branch 'origin/main' into lichang

This commit is contained in:
TsMask
2024-04-12 21:49:11 +08:00
4 changed files with 155 additions and 70 deletions

View File

@@ -136,6 +136,7 @@ export async function batchUpdateRule(data: Record<string, any>) {
url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}`, url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}`,
method: 'put', method: 'put',
data: data, data: data,
timeout: 60_000,
}); });
// 解析数据 // 解析数据
if (result.code === RESULT_CODE_SUCCESS) { if (result.code === RESULT_CODE_SUCCESS) {
@@ -164,6 +165,7 @@ export async function addRule(data: Record<string, any>) {
url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${data.neId}`, url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${data.neId}`,
method: 'post', method: 'post',
data: data, data: data,
timeout: 60_000,
}); });
// 解析数据 // 解析数据
if (result.code === RESULT_CODE_SUCCESS && result.data?.status) { if (result.code === RESULT_CODE_SUCCESS && result.data?.status) {
@@ -186,6 +188,7 @@ export async function batchAddRule(data: Record<string, any>) {
url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}`, url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}`,
method: 'post', method: 'post',
data: data, data: data,
timeout: 60_000,
}); });
// 解析数据 // 解析数据
if (result.code === RESULT_CODE_SUCCESS) { if (result.code === RESULT_CODE_SUCCESS) {
@@ -209,10 +212,11 @@ export async function batchAddRule(data: Record<string, any>) {
* @param data 规则对象 * @param data 规则对象
* @returns object * @returns object
*/ */
export function delRule(neId: string, data: Record<string, any>) { export function delRule(neId: string, imsi: string) {
return request({ return request({
url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${neId}&imsi=${data.imsi}`, url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo?neId=${neId}&imsi=${imsi}`,
method: 'delete', method: 'delete',
timeout: 60_000,
}); });
} }
@@ -225,5 +229,6 @@ export async function batchDelRule(data: Record<string, any>) {
return request({ return request({
url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}&imsi=${data.imsi}`, url: `/api/rest/ueManagement/v1/elementType/pcf/objectType/ueInfo/batch/${data.num}?neId=${data.neId}&imsi=${data.imsi}`,
method: 'delete', method: 'delete',
timeout: 60_000,
}); });
} }

View File

@@ -708,6 +708,7 @@ export default {
addTitle: 'Adding Policy Control Information', addTitle: 'Adding Policy Control Information',
updateTitle: '{imsi} Policy control information', updateTitle: '{imsi} Policy control information',
startIMSI: 'Start IMSI', startIMSI: 'Start IMSI',
batchOper: 'Batch Operations',
batchAddText: 'Batch Add', batchAddText: 'Batch Add',
batchDelText: 'Batch Delete', batchDelText: 'Batch Delete',
batchUpdateText: 'Batch Modify', batchUpdateText: 'Batch Modify',
@@ -716,17 +717,18 @@ export default {
imsiTip1: 'MCC=Mobile Country Code, consisting of three digits.', imsiTip1: 'MCC=Mobile Country Code, consisting of three digits.',
imsiTip2: 'MNC = Mobile Network Number, consisting of two digits', imsiTip2: 'MNC = Mobile Network Number, consisting of two digits',
imsiTip3: 'MSIN = Mobile Subscriber Identification Number, consisting of 10 equal digits.', imsiTip3: 'MSIN = Mobile Subscriber Identification Number, consisting of 10 equal digits.',
checkDel: 'Check Delete',
delSure:'Are you sure you want to delete the user with IMSI number: {imsi}?', delSure:'Are you sure you want to delete the user with IMSI number: {imsi}?',
uploadFileOk: 'File Upload Successful', uploadFileOk: 'File Upload Successful',
uploadFileErr: 'File Upload Failed', uploadFileErr: 'File Upload Failed',
pccRuleTip:'templates of PCC rule(pccRules.yaml)', pccRuleTip:'PCC policy rule template (corresponding to parameter configuration -PCC Rules)',
sessRuleTip:'templates of session rule(sessRules.yaml)', sessRuleTip:' Session policy rule template (corresponding to parameter configuration-session Rules)',
qosAudioTip:'QoS of audio call(qosTpl.yaml)', qosAudioTip:' Voice call QoS(corresponding parameter configuration -QoS Template QoS ID)',
qosVideoTip:'QoS of video call(qosTpl.yaml)', qosVideoTip:' Video call QoS(corresponding parameter configuration -QoS Template QoS ID)',
hdrTip:'HTTP header enrich(headerEnrichTpl.yaml)', hdrTip:'HTTP Header enhancement (corresponding parameter configuration -Header Enrich Template)',
ueTip:'template of UE Policy(ursp.yaml)', ueTip:'UE policy template (example: uep_001)',
sarTip1:'Service Area Restriction', sarTip1:' Service area Restriction ',
sarTip2:'(serviceAreaRestriction.yaml)', sarTip2:'(corresponding parameter setting -Service Area Restriction)',
rfsfTip:'RAT Frequency Selection Priority', rfsfTip:'RAT Frequency Selection Priority',
}, },
base5G: { base5G: {
@@ -1199,7 +1201,7 @@ export default {
cacheInfo: { cacheInfo: {
baseInfo: "Basic Info", baseInfo: "Basic Info",
version: "Service Versions", version: "Service Versions",
mode: "Perating Mode", mode: "Operating Mode",
modeStandalone: "stand-alone", modeStandalone: "stand-alone",
modeClusters: "clusters", modeClusters: "clusters",
port: "Port", port: "Port",

View File

@@ -708,6 +708,7 @@ export default {
addTitle: '新增策略控制信息', addTitle: '新增策略控制信息',
updateTitle: '{imsi} 策略控制信息', updateTitle: '{imsi} 策略控制信息',
startIMSI: '起始IMSI', startIMSI: '起始IMSI',
batchOper: '批量操作',
batchAddText: '批量新增', batchAddText: '批量新增',
batchDelText: '批量删除', batchDelText: '批量删除',
batchUpdateText: '批量更新', batchUpdateText: '批量更新',
@@ -716,17 +717,18 @@ export default {
imsiTip1: 'MCC=移动国家号码, 由三位数字组成', imsiTip1: 'MCC=移动国家号码, 由三位数字组成',
imsiTip2: 'MNC=移动网络号,由两位数字组成', imsiTip2: 'MNC=移动网络号,由两位数字组成',
imsiTip3: 'MSIN=移动客户识别码采用等长10位数字构成', imsiTip3: 'MSIN=移动客户识别码采用等长10位数字构成',
delSure:'确认删除IMSI编号为: {imsi} 的用户吗?', checkDel:'勾选删除',
delSure:'确认删除IMSI编号为: {imsi} 的数据项吗?',
uploadFileOk: '文件上传成功', uploadFileOk: '文件上传成功',
uploadFileErr: '文件上传失败', uploadFileErr: '文件上传失败',
pccRuleTip:'PCC策略规则模板(pccRules.yaml)', pccRuleTip:'PCC策略规则模板(对应参数配置-PCC Rules)',
sessRuleTip:'会话策略规则模板(sessRules.yaml)', sessRuleTip:'会话策略规则模板(对应参数配置-Session Rules)',
qosAudioTip:'语音呼叫QoS(qosTpl.yaml)', qosAudioTip:'语音呼叫QoS(对应参数配置-QoS Template的QoS ID)',
qosVideoTip:'视频呼叫QoS(qosTpl.yaml)', qosVideoTip:'视频呼叫QoS(对应参数配置-QoS Template的QoS ID)',
hdrTip:'HTTP头增强(headerEnrichTpl.yaml)', hdrTip:'HTTP头增强(对应参数配置-Header Enrich Template)',
ueTip:'UE策略模板(ursp.yaml)', ueTip:'UE策略模板(样例: uep_001)',
sarTip1:'服务区限制', sarTip1:'服务区限制',
sarTip2:'(serviceAreaRestriction.yaml)', sarTip2:'(对应参数配置-Service Area Restriction)',
rfsfTip:'无线频率选择优先级', rfsfTip:'无线频率选择优先级',
}, },
base5G: { base5G: {

View File

@@ -35,6 +35,10 @@ let queryParams = reactive({
imsi: '', imsi: '',
/**号码 */ /**号码 */
msisdn: '', msisdn: '',
/**当前页数 */
pageNum: 1,
/**每页条数 */
pageSize: 20,
}); });
/**查询参数重置 */ /**查询参数重置 */
@@ -58,6 +62,8 @@ type TabeStateType = {
seached: boolean; seached: boolean;
/**记录数据 */ /**记录数据 */
data: object[]; data: object[];
/**勾选记录 */
selectedRowKeys: (string | number)[];
}; };
/**表格状态 */ /**表格状态 */
@@ -67,6 +73,7 @@ let tableState: TabeStateType = reactive({
striped: false, striped: false,
seached: true, seached: true,
data: [], data: [],
selectedRowKeys: [],
}); });
/**表格字段列 */ /**表格字段列 */
@@ -144,6 +151,37 @@ let tableColumns = ref<TableColumnsType>([
}, },
]); ]);
/**表格字段列排序 */
let tableColumnsDnd = ref<TableColumnsType>([]);
/**表格分页器参数 */
let tablePagination = reactive({
/**当前页数 */
current: 1,
/**每页条数 */
pageSize: 20,
/**默认的每页条数 */
defaultPageSize: 20,
/**指定每页可以显示多少条 */
pageSizeOptions: ['10', '20', '50', '100'],
/**只有一页时是否隐藏分页器 */
hideOnSinglePage: false,
/**是否可以快速跳转至某页 */
showQuickJumper: true,
/**是否可以改变 pageSize */
showSizeChanger: true,
/**数据总数 */
total: 0,
showTotal: (total: number) => t('common.tablePaginationTotal', { total }),
onChange: (page: number, pageSize: number) => {
tablePagination.current = page;
tablePagination.pageSize = pageSize;
queryParams.pageNum = page;
queryParams.pageSize = pageSize;
// fnGetList();
},
});
/**表格紧凑型变更操作 */ /**表格紧凑型变更操作 */
function fnTableSize({ key }: MenuInfo) { function fnTableSize({ key }: MenuInfo) {
tableState.size = key as SizeType; tableState.size = key as SizeType;
@@ -154,6 +192,11 @@ function fnTableStriped(_record: unknown, index: number): any {
return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined; return tableState.striped && index % 2 === 1 ? 'table-striped' : undefined;
} }
/**表格多选 */
function fnTableSelectedRowKeys(keys: (string | number)[]) {
tableState.selectedRowKeys = keys;
}
/**对话框对象信息状态类型 */ /**对话框对象信息状态类型 */
type ModalStateType = { type ModalStateType = {
/**新增框或修改框是否显示 */ /**新增框或修改框是否显示 */
@@ -366,31 +409,36 @@ function fnModalVisibleByBatch(type: 'delete' | 'add' | 'update') {
/** /**
* 记录删除 * 记录删除
* @param row 网元编号ID * @param imsi 网元编号ID
*/ */
function fnRecordDelete(row: Record<string, any>) { function fnRecordDelete(imsi: string) {
const neID = queryParams.neId;
if (!neID) return;
let imsiMsg = imsi;
if (imsi === '0') {
imsiMsg = `${tableState.selectedRowKeys[0]}... ${tableState.selectedRowKeys.length}`;
imsi = tableState.selectedRowKeys.join(',');
}
Modal.confirm({ Modal.confirm({
title: t('common.tipTitle'), title: t('common.tipTitle'),
content: t('views.neUser.pcf.delSure', { imsi: row.imsi }), content: t('views.neUser.pcf.delSure', { imsi: imsiMsg }),
onOk() { onOk() {
const key = 'delRule'; const key = 'delRule';
message.loading({ content: t('common.loading'), key }); message.loading({ content: t('common.loading'), key });
const neID = queryParams.neId || '-'; delRule(neID, imsi).then(res => {
delRule(neID, row).then(res => {
if (res.code === RESULT_CODE_SUCCESS) { if (res.code === RESULT_CODE_SUCCESS) {
message.success({ message.success({
content: t('common.msgSuccess', { content: `${res.msg}`,
msg: `${t('common.deleteText')} ${row.imsi}`,
}),
key, key,
duration: 2, duration: 3,
}); });
fnGetList(); fnGetList();
} else { } else {
message.error({ message.error({
content: `${res.msg}`, content: `${res.msg}`,
key: key, key: key,
duration: 2, duration: 3,
}); });
} }
}); });
@@ -431,6 +479,10 @@ function fnGetList() {
tableState.loading = true; tableState.loading = true;
listRules(toRaw(queryParams)).then(res => { listRules(toRaw(queryParams)).then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.rows)) {
// 取消勾选
if (tableState.selectedRowKeys.length > 0) {
tableState.selectedRowKeys = [];
}
tableState.data = res.rows; tableState.data = res.rows;
} else { } else {
tableState.data = []; tableState.data = [];
@@ -560,12 +612,20 @@ onMounted(() => {
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item label="IMSI" name="imsi"> <a-form-item label="IMSI" name="imsi">
<a-input v-model:value="queryParams.imsi" allow-clear></a-input> <a-input
v-model:value="queryParams.imsi"
allow-clear
:placeholder="t('common.inputPlease')"
></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
<a-form-item label="MSISDN" name="msisdn"> <a-form-item label="MSISDN" name="msisdn">
<a-input v-model:value="queryParams.msisdn" allow-clear></a-input> <a-input
v-model:value="queryParams.msisdn"
allow-clear
:placeholder="t('common.inputPlease')"
></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :lg="6" :md="12" :xs="24"> <a-col :lg="6" :md="12" :xs="24">
@@ -602,42 +662,45 @@ onMounted(() => {
</a-button> </a-button>
<a-button <a-button
type="primary" type="default"
ghost
@click.prevent="fnModalVisibleByBatch('add')"
>
<template #icon>
<PlusOutlined />
</template>
{{ t('views.neUser.pcf.batchAddText') }}
</a-button>
<a-button
type="primary"
ghost
@click.prevent="fnModalVisibleByBatch('update')"
>
<template #icon>
<FormOutlined />
</template>
{{ t('views.neUser.pcf.batchUpdateText') }}
</a-button>
<a-button
type="primary"
danger danger
ghost :disabled="tableState.selectedRowKeys.length <= 0"
@click.prevent="fnModalVisibleByBatch('delete')" :loading="modalState.confirmLoading"
@click.prevent="fnRecordDelete('0')"
> >
<template #icon> <template #icon><DeleteOutlined /></template>
<DeleteOutlined /> {{ t('views.neUser.pcf.checkDel') }}
</template>
{{ t('views.neUser.pcf.batchDelText') }}
</a-button> </a-button>
<a-dropdown>
<a-button>
{{ t('views.neUser.pcf.batchOper') }}
<DownOutlined />
</a-button>
<template #overlay>
<a-menu @click="({ key }:any) => fnModalVisibleByBatch(key)">
<a-menu-item key="add">
<PlusOutlined />
{{ t('views.neUser.pcf.batchAddText') }}
</a-menu-item>
<a-menu-item key="update">
<FormOutlined />
{{ t('views.neUser.pcf.batchUpdateText') }}
</a-menu-item>
<a-menu-item key="delete">
<DeleteOutlined />
{{ t('views.neUser.pcf.batchDelText') }}
</a-menu-item>
</a-menu>
</template>
</a-dropdown>
<a-button type="dashed" @click.prevent="fnModalUploadImportOpen"> <a-button type="dashed" @click.prevent="fnModalUploadImportOpen">
<template #icon><ImportOutlined /></template> <template #icon><ImportOutlined /></template>
{{ t('views.neUser.pcf.import') }} {{ t('views.neUser.pcf.import') }}
</a-button> </a-button>
<a-popconfirm <a-popconfirm
placement="topRight"
:title="t('views.neUser.pcf.exportConfirm')" :title="t('views.neUser.pcf.exportConfirm')"
ok-text="TXT" ok-text="TXT"
ok-type="default" ok-type="default"
@@ -687,6 +750,11 @@ onMounted(() => {
size="small" size="small"
/> />
</a-tooltip> </a-tooltip>
<TableColumnsDnd
cache-id="pcfData"
:columns="tableColumns"
v-model:columns-dnd="tableColumnsDnd"
></TableColumnsDnd>
<a-tooltip> <a-tooltip>
<template #title>{{ t('common.reloadText') }}</template> <template #title>{{ t('common.reloadText') }}</template>
<a-button type="text" @click.prevent="fnGetList()"> <a-button type="text" @click.prevent="fnGetList()">
@@ -724,14 +792,19 @@ onMounted(() => {
<a-table <a-table
class="table" class="table"
row-key="imsi" row-key="imsi"
:columns="tableColumns" :columns="tableColumnsDnd"
:loading="tableState.loading" :loading="tableState.loading"
:data-source="tableState.data" :data-source="tableState.data"
:size="tableState.size" :size="tableState.size"
:row-class-name="fnTableStriped" :row-class-name="fnTableStriped"
:pagination="false" :pagination="tablePagination"
:scroll="{ y: 'calc(100vh - 480px)' }" :scroll="{ y: 'calc(100vh - 480px)' }"
@resizeColumn="(w:number, col:any) => (col.width = w)" @resizeColumn="(w:number, col:any) => (col.width = w)"
:row-selection="{
type: 'checkbox',
selectedRowKeys: tableState.selectedRowKeys,
onChange: fnTableSelectedRowKeys,
}"
> >
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'imsi'"> <template v-if="column.key === 'imsi'">
@@ -749,7 +822,10 @@ onMounted(() => {
</a-tooltip> </a-tooltip>
<a-tooltip> <a-tooltip>
<template #title>{{ t('common.deleteText') }}</template> <template #title>{{ t('common.deleteText') }}</template>
<a-button type="link" @click.prevent="fnRecordDelete(record)"> <a-button
type="link"
@click.prevent="fnRecordDelete(record.imsi)"
>
<template #icon> <template #icon>
<DeleteOutlined /> <DeleteOutlined />
</template> </template>
@@ -898,7 +974,7 @@ onMounted(() => {
allow-clear allow-clear
:maxlength="64" :maxlength="64"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.pccRuleTip') }} {{ t('views.neUser.pcf.pccRuleTip') }}
@@ -916,7 +992,7 @@ onMounted(() => {
allow-clear allow-clear
:maxlength="64" :maxlength="64"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.sessRuleTip') }} {{ t('views.neUser.pcf.sessRuleTip') }}
@@ -937,7 +1013,7 @@ onMounted(() => {
allow-clear allow-clear
:maxlength="64" :maxlength="64"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.qosAudioTip') }} {{ t('views.neUser.pcf.qosAudioTip') }}
@@ -955,7 +1031,7 @@ onMounted(() => {
allow-clear allow-clear
:maxlength="64" :maxlength="64"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.qosVideoTip') }} {{ t('views.neUser.pcf.qosVideoTip') }}
@@ -976,7 +1052,7 @@ onMounted(() => {
allow-clear allow-clear
:maxlength="64" :maxlength="64"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.hdrTip') }} {{ t('views.neUser.pcf.hdrTip') }}
@@ -994,7 +1070,7 @@ onMounted(() => {
allow-clear allow-clear
:maxlength="64" :maxlength="64"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.ueTip') }} {{ t('views.neUser.pcf.ueTip') }}
@@ -1015,7 +1091,7 @@ onMounted(() => {
allow-clear allow-clear
:maxlength="64" :maxlength="64"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.sarTip1') }}<br /> {{ t('views.neUser.pcf.sarTip1') }}<br />
@@ -1036,7 +1112,7 @@ onMounted(() => {
:max="255" :max="255"
placeholder="0~255" placeholder="0~255"
> >
<template #prefix> <template #prefix>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template #title> <template #title>
{{ t('views.neUser.pcf.rfsfTip') }} {{ t('views.neUser.pcf.rfsfTip') }}
@@ -1044,7 +1120,7 @@ onMounted(() => {
<InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" /> <InfoCircleOutlined style="color: rgba(0, 0, 0, 0.45)" />
</a-tooltip> </a-tooltip>
</template> </template>
</a-input-number> </a-input-number>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>