From f4b2a437176e1311d77cb526328dee5b8f37006a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Fri, 6 Jun 2025 16:37:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9C=8B=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AlmModal/index.vue | 35 ++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/components/AlmModal/index.vue b/src/components/AlmModal/index.vue index 66de8b1..bd37b77 100644 --- a/src/components/AlmModal/index.vue +++ b/src/components/AlmModal/index.vue @@ -153,6 +153,17 @@ + +
+ +
+
@@ -182,6 +193,10 @@ export default { // 操作按钮loading alarmProcessing: false, + + previewImageUrl: '', + imagePreviewVisible: false, + } }, mounted() { @@ -484,7 +499,25 @@ export default { this.$set(this.almData[index], 'isWaiting', true) this.$router.push('/') - } + }, + + // 获取完整的图片URL + getFullImageUrl(relativePath) { + if (!relativePath) return ''; + + // 如果已经是完整URL,直接返回(兼容历史数据) + if (relativePath.startsWith('http')) { + return relativePath; + } + + // 动态拼接当前环境的baseURL + const baseURL = process.env.VUE_APP_BASE_API || ''; + return baseURL + relativePath; + }, + previewImage(url) { + this.previewImageUrl = url + this.imagePreviewVisible = true + }, } }