feat: 历史抓包文件页面

This commit is contained in:
TsMask
2024-08-22 10:19:23 +08:00
parent 32ec55d44e
commit 4c9fe192f2
4 changed files with 448 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts" setup>
import { onMounted, reactive } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { message, Modal } from 'ant-design-vue/lib';
import { ColumnsType } from 'ant-design-vue/lib/table';
import { PageContainer } from 'antdv-pro-layout';
@@ -14,6 +15,9 @@ import { getNeFile } from '@/api/tool/neFile';
import saveAs from 'file-saver';
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
import useI18n from '@/hooks/useI18n';
import { MENU_PATH_INLINE } from '@/constants/menu-constants';
const router = useRouter();
const route = useRoute();
const { t } = useI18n();
/**对话框对象信息状态类型 */
@@ -412,11 +416,18 @@ function fnDownPCAP(row?: Record<string, any>) {
if (from.data.neType === 'UPF' && taskCode.startsWith('/tmp')) {
const fileName = taskCode.substring(taskCode.lastIndexOf('/') + 1);
reqArr.push(
getNeFile(Object.assign({ path: '/tmp', fileName }, from.data))
getNeFile(
Object.assign(
{ path: '/tmp', fileName, delTemp: true },
from.data
)
)
);
} else {
reqArr.push(
dumpDownload(Object.assign({ taskCode: taskCode }, from.data))
dumpDownload(
Object.assign({ taskCode: taskCode, delTemp: true }, from.data)
)
);
}
}
@@ -483,7 +494,7 @@ function fnBatchOper(key: string) {
/**
* 对话框弹出显示为 查看
* @param dictId 字典编号id
* @param dictId 编号id
*/
function fnModalVisibleByVive(id: string | number) {
const from = modalState.from[id];
@@ -501,6 +512,22 @@ function fnModalCancel() {
modalState.logMsg = '';
}
/**跳转文件数据页面 */
function fnFileView(row?: Record<string, any>) {
let query = undefined;
if (row) {
const from = modalState.from[row.id];
query = {
neId: from.data.neId,
neType: from.data.neType,
};
}
router.push({
path: `${route.path}${MENU_PATH_INLINE}/file`,
query: query,
});
}
onMounted(() => {
// 获取网元列表
fnGetList();
@@ -513,6 +540,11 @@ onMounted(() => {
<!-- 插槽-卡片左侧侧 -->
<template #title>
<a-space :size="8" align="center">
<a-button @click="fnFileView()">
<FileSearchOutlined />
{{ t('views.traceManage.pcap.fileView') }}
</a-button>
<a-dropdown trigger="click">
<a-button :disabled="tableState.selectedRowKeys.length <= 0">
{{ t('views.traceManage.pcap.batchOper') }}
@@ -661,7 +693,7 @@ onMounted(() => {
</a-table>
</a-card>
<!-- 详情框 -->
<!-- 日志信息框 -->
<ProModal
:drag="true"
:width="800"