feat: UDM-auth数据导出按钮权限定义

This commit is contained in:
TsMask
2025-09-28 19:31:42 +08:00
parent 22b0b7e204
commit b1d0771d56
2 changed files with 42 additions and 0 deletions

View File

@@ -140,3 +140,17 @@ export function exportUDMAuth(data: Record<string, any>) {
timeout: 180_000,
});
}
/**
* UDM鉴权用户导出DecAuth
* @param neId 网元ID
* @returns bolb
*/
export function exportUDMDecAuth(neId: string) {
return request({
url: `/neData/udm/auth/export-dec?neId=${neId}`,
method: 'GET',
responseType: 'blob',
timeout: 180_000,
});
}

View File

@@ -23,6 +23,7 @@ import {
importUDMAuth,
resetUDMAuth,
listUDMAuth,
exportUDMDecAuth,
} from '@/api/neData/udm_auth';
import { uploadFile } from '@/api/tool/file';
import { getNeViewFile } from '@/api/tool/neFile';
@@ -532,6 +533,25 @@ function fnExportList(type: string) {
});
}
/** UDM鉴权用户导出DecAuth */
function fnExportDec() {
const neId = queryParams.neId;
if (!neId) return;
const hide = message.loading(t('common.loading'), 0);
exportUDMDecAuth(neId)
.then(res => {
if (res.code === RESULT_CODE_SUCCESS) {
message.success(t('common.msgSuccess', { msg: t('common.export') }), 3);
saveAs(res.data, `UDMAuth_dec_${Date.now()}.txt`);
} else {
message.error(`${res.msg}`, 3);
}
})
.finally(() => {
hide();
});
}
/**重新加载数据 */
function fnLoadData() {
const neId = queryParams.neId;
@@ -894,6 +914,14 @@ onMounted(() => {
{{ t('views.neUser.auth.export') }}
</a-button>
</a-popconfirm>
<a-button
type="dashed"
@click="fnExportDec()"
v-perms:has="['neData:udm-auth:export-dec']"
>
<template #icon><ExportOutlined /></template>
Export DecData
</a-button>
<a-button
type="default"