feat: 根据网元类型过滤导出备份数据可选的数据来源

This commit is contained in:
TsMask
2025-05-13 18:28:36 +08:00
parent 6062170556
commit 6eea86f4e7
3 changed files with 29 additions and 3 deletions

View File

@@ -93,7 +93,7 @@ const useNeListStore = defineStore('ne_list', {
},
/**
* 含有网元
* @param metaNeType udm|ims|udm+ims
* @param metaNeType ['udm', 'ims', 'udm+ims', 'SGWC'] 支持大小写
* @returns boolean
*/
fnHasNe(metaNeType: string[]) {

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { reactive, ref, toRaw } from 'vue';
import { onMounted, reactive, ref, toRaw } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { ColumnsType } from 'ant-design-vue/es/table';
@@ -8,11 +8,13 @@ import BackupModal from '@/views/ne/neConfigBackup/components/BackupModal.vue';
import { parseDateToStr } from '@/utils/date-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
import useNeListStore from '@/store/modules/ne_list';
import saveAs from 'file-saver';
import { delFile, getFile, listFile } from '@/api/tool/file';
import { parseSizeFromFile } from '@/utils/parse-utils';
import { pushBackupFTP } from '@/api/neData/backup';
const { t } = useI18n();
const neListStore = useNeListStore();
/**文件来源 */
let sourceState = reactive({
@@ -32,21 +34,25 @@ let sourceState = reactive({
value: '/cdr/ims_cdr_event',
label: t('views.logManage.exportFile.cdrIMS'),
path: '/usr/local/omc/backup',
neType: 'IMS',
},
{
value: '/cdr/smf_cdr_event',
label: t('views.logManage.exportFile.cdrSMF'),
path: '/usr/local/omc/backup',
neType: 'SMF',
},
{
value: '/cdr/smsc_cdr_event',
label: t('views.logManage.exportFile.cdrSMSC'),
path: '/usr/local/omc/backup',
neType: 'SMSC',
},
{
value: '/cdr/sgwc_cdr_event',
label: t('views.logManage.exportFile.cdrSGWC'),
path: '/usr/local/omc/backup',
neType: 'SGWC',
},
],
/**选择value */
@@ -308,6 +314,13 @@ function fnSyncFileToFTP(fileName: string) {
}
});
}
onMounted(() => {
sourceState.list = sourceState.list.filter(item => {
if (!item.neType) return true;
return neListStore.fnHasNe([item.neType]);
});
});
</script>
<template>

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { reactive, ref, toRaw } from 'vue';
import { onMounted, reactive, ref, toRaw } from 'vue';
import { PageContainer } from 'antdv-pro-layout';
import { SizeType } from 'ant-design-vue/es/config-provider';
import { ColumnsType } from 'ant-design-vue/es/table';
@@ -8,11 +8,13 @@ import BackupModal from '@/views/ne/neConfigBackup/components/BackupModal.vue';
import { parseDateToStr } from '@/utils/date-utils';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
import useNeListStore from '@/store/modules/ne_list';
import saveAs from 'file-saver';
import { delFile, getFile, listFile } from '@/api/tool/file';
import { parseSizeFromFile } from '@/utils/parse-utils';
import { pushBackupFTP } from '@/api/neData/backup';
const { t } = useI18n();
const neListStore = useNeListStore();
/**文件来源 */
let sourceState = reactive({
@@ -22,21 +24,25 @@ let sourceState = reactive({
value: '/auth',
label: t('views.neData.backupData.auth'),
path: '/usr/local/omc/backup/udm_data',
neType: 'UDM',
},
{
value: '/sub',
label: t('views.neData.backupData.sub'),
path: '/usr/local/omc/backup/udm_data',
neType: 'UDM',
},
{
value: '/voip',
label: t('views.neData.backupData.voip'),
path: '/usr/local/omc/backup/udm_data',
neType: 'UDM',
},
{
value: '/volte',
label: t('views.neData.backupData.volte'),
path: '/usr/local/omc/backup/udm_data',
neType: 'UDM+IMS',
},
],
/**选择value */
@@ -298,6 +304,13 @@ function fnSyncFileToFTP(fileName: string) {
}
});
}
onMounted(() => {
sourceState.list = sourceState.list.filter(item => {
if (!item.neType) return true;
return neListStore.fnHasNe([item.neType]);
});
});
</script>
<template>