From 9413a5ea5c2fe4c98b92bb9cee96752622507b3e Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Tue, 23 Jun 2026 12:04:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(sourcemap):=20=E9=9A=90=E8=97=8F=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=B7=AF=E5=BE=84=EF=BC=8C=E6=98=BE=E7=A4=BA=20Build?= =?UTF-8?q?=20ID=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E5=80=92=E5=BA=8F=E6=8E=92=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- tenant-platform/src/api/bugcollect.ts | 6 ++- .../bug-collect/BugCollectSourcemaps.vue | 41 +++++++++++++++++-- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/tenant-platform/src/api/bugcollect.ts b/tenant-platform/src/api/bugcollect.ts index 1731ef0..54ea3e9 100644 --- a/tenant-platform/src/api/bugcollect.ts +++ b/tenant-platform/src/api/bugcollect.ts @@ -107,7 +107,7 @@ export interface BugCollectSourcemap { platform: string appVersion: string bundleName: string - storageKey: string + buildId: string | null uploadedAt: string } @@ -251,5 +251,9 @@ export const bugCollectApi = { sourcemaps: { list: (appKey: string) => client.get<{ data: BugCollectSourcemap[] }>('/bugcollect/v1/sourcemaps', { params: { appKey } }), + delete: (id: number) => + client.delete(`/bugcollect/v1/sourcemaps/${id}`), + pruneAll: () => + client.post<{ data: string }>('/bugcollect/v1/sourcemaps/prune-all'), }, } diff --git a/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue b/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue index a666935..053258d 100644 --- a/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue +++ b/tenant-platform/src/views/bug-collect/BugCollectSourcemaps.vue @@ -39,11 +39,30 @@ - - + + + + + + + @@ -97,7 +116,7 @@ import { ref, onMounted, watch } from 'vue' import { ElMessage } from 'element-plus' import { bugCollectApi, type BugCollectSourcemap } from '@/api/bugcollect' import { useBugCollectApp } from '@/composables/useBugCollectApp' -import { levelTag, statusTag, statusLabel, formatTime } from '@/utils/bugCollect' +import { formatTime } from '@/utils/bugCollect' const { apps, loadingApps, appKey, setApp, gateStatus, applyDialogVisible, applyReason, applyLoading, submitActivation } = useBugCollectApp() @@ -113,7 +132,6 @@ function platformTagType(platform: string): '' | 'success' | 'warning' | 'info' return map[platform?.toLowerCase()] ?? 'info' } - async function loadData() { if (!appKey.value || gateStatus.value !== 'enabled') return loading.value = true @@ -128,6 +146,16 @@ async function loadData() { } } +async function handleDelete(id: number) { + try { + await bugCollectApi.sourcemaps.delete(id) + ElMessage.success('已删除') + sourcemaps.value = sourcemaps.value.filter(s => s.id !== id) + } catch { + ElMessage.error('删除失败') + } +} + watch(gateStatus, (s) => { if (s === 'enabled') loadData() }) onMounted(loadData) @@ -140,6 +168,11 @@ onMounted(loadData) justify-content: space-between; align-items: center; } +.buildid-text { + font-family: monospace; + font-size: 12px; + color: #606266; +} .usage-guide h4 { margin: 16px 0 8px; font-size: 14px;