From 21a4ad986d05f1ee37e0fa4acf3b0ae61d7cc1c3 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 25 Sep 2023 15:04:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=A1=E4=BB=A4=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/trace/analysis.ts | 24 +++--- src/views/trace/analysis/index.vue | 126 ++++++++++++++++++++--------- src/views/trace/pcap/index.vue | 8 +- 3 files changed, 101 insertions(+), 57 deletions(-) diff --git a/src/api/trace/analysis.ts b/src/api/trace/analysis.ts index 1c7a2b34..14ee1419 100644 --- a/src/api/trace/analysis.ts +++ b/src/api/trace/analysis.ts @@ -54,21 +54,15 @@ export async function listTraceData(query: Record) { return result; } -// 网元抓包pcap文件下载 -export function tcpdumpPcapDownload(data: Record) { +/** + * 信令数据解析HTML + * @param id 任务ID + * @returns + */ +export function getTraceRawInfo(id: Record) { return request({ - url: '/traceManagement/v1/tcpdumpPcapDownload', - method: 'post', - data: data, - responseType: 'blob', - }); -} - -// 网元抓包生成pcap -export function tcpdumpNeUPFTask(data: Record) { - return request({ - url: '/traceManagement/v1/tcpdumpNeUPFTask', - method: 'post', - data: data, + url: `/traceManagement/v1/decMessage/${id}`, + method: 'get', + responseType: 'text', }); } diff --git a/src/views/trace/analysis/index.vue b/src/views/trace/analysis/index.vue index 00f382ba..08508377 100644 --- a/src/views/trace/analysis/index.vue +++ b/src/views/trace/analysis/index.vue @@ -11,7 +11,7 @@ import { RESULT_CODE_SUCCESS } from '@/constants/result-constants'; import { downloadNeBackup } from '@/api/configManage/backupManage'; import { saveAs } from 'file-saver'; import useI18n from '@/hooks/useI18n'; -import { listTraceData } from '@/api/trace/analysis'; +import { getTraceRawInfo, listTraceData } from '@/api/trace/analysis'; const { t } = useI18n(); const route = useRoute(); @@ -151,34 +151,6 @@ function fnTableSize({ key }: MenuInfo) { tableState.size = key as SizeType; } -/**信息文件下载 */ -function fnDownloadFile(row: Record) { - Modal.confirm({ - title: '提示', - content: `确认下载记录编号为 【${row.id}】 的数据项文件?`, - onOk() { - const key = 'downloadNeBackup'; - message.loading({ content: t('common.loading'), key }); - downloadNeBackup(toRaw(row)).then(res => { - if (res.code === RESULT_CODE_SUCCESS) { - message.success({ - content: `已完成下载`, - key, - duration: 2, - }); - saveAs(res.data, `user_${Date.now()}.xlsx`); - } else { - message.error({ - content: `${res.msg}`, - key, - duration: 2, - }); - } - }); - }, - }); -} - /**查询备份信息列表 */ function fnGetList() { if (tableState.loading) return; @@ -209,6 +181,7 @@ let modalState: ModalStateType = reactive({ title: '信令信息', from: { rawData: '', + rawDataHTML: '', }, }); @@ -221,7 +194,28 @@ function fnModalVisible(row: Record) { const hexString = parseBase64Data(row.rawMsg); const rawData = convertToReadableFormat(hexString); modalState.from.rawData = rawData; - modalState.title = `任务 ${row.taskId} 信令信息`; + // RAW解析HTML + getTraceRawInfo(row.id).then(res => { + if (res.code === RESULT_CODE_SUCCESS) { + const htmlString = res.msg; + // 删除所有 标签 + const withoutATags = htmlString.replace(/]*>(.*?)<\/a>/gi, ''); + // 删除所有