From c3a4f841d5499b74e9153fce421cebd1fb4ac72d Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期二, 15 七月 2025 10:55:52 +0800
Subject: [PATCH] 1、mdc设备多选输入框优化新增点击输入框同样触发查询按钮弹出抽屉或弹窗 2、解决进入过产品结构树页面后再进入设备日志页面后设备状态分布图样式变形问题以及优化组件代码

---
 src/components/jeecg/LxFilePreview.vue |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/components/jeecg/LxFilePreview.vue b/src/components/jeecg/LxFilePreview.vue
index 6017a26..9d01b89 100644
--- a/src/components/jeecg/LxFilePreview.vue
+++ b/src/components/jeecg/LxFilePreview.vue
@@ -9,10 +9,10 @@
     :footer="null"
     cancelText="鍏抽棴">
     <a-spin :spinning="confirmLoading">
-      <img v-if="isImage" :src="fileUrl" width="100%" height="100%" alt="鍥剧墖棰勮" />
-      <iframe v-else-if="isPdf" :src="fileUrl" width="100%" height="600px"></iframe>
+      <img v-if="isImage" :src="localFileUrl" width="100%" height="100%" alt="鍥剧墖棰勮" />
+      <iframe v-else-if="isPdf" :src="localFileUrl" width="100%" height="600px"></iframe>
       <video v-else-if="isVideo" controls>
-        <source :src="fileUrl" type="video/mp4">
+        <source :src="localFileUrl" type="video/mp4">
         鎮ㄧ殑娴忚鍣ㄤ笉鏀寔 video 鏍囩銆�
       </video>
       <pre v-else-if="isText">{{ textContent }}</pre>
@@ -33,25 +33,26 @@
       title: '棰勮',
       textContent: '',
       confirmLoading: false,
-      visible: false
+      visible: false,
+      localFileUrl: this.fileUrl,
     }
   },
   computed: {
     isImage() {
-      return /\.(jpeg|jpg|png|gif|bmp|webp)$/i.test(this.fileUrl)
+      return /\.(jpeg|jpg|png|gif|bmp|webp)$/i.test(this.localFileUrl)
     },
     isPdf() {
-      return /\.pdf$/i.test(this.fileUrl)
+      return /\.pdf$/i.test(this.localFileUrl)
     },
     isVideo() {
-      return /\.(mp4|webm|ogg)$/i.test(this.fileUrl)
+      return /\.(mp4|webm|ogg)$/i.test(this.localFileUrl)
     },
     isText() {
-      return /\.(txt|md|json|xml|yaml|yml)$/i.test(this.fileUrl)
+      return /\.(txt|md|json|xml|yaml|yml)$/i.test(this.localFileUrl)
     }
   },
   watch: {
-    fileUrl: 'fetchTextContent'
+    localFileUrl: 'fetchTextContent'
   },
   mounted() {
     if (this.isText) {
@@ -77,7 +78,7 @@
     preview(fileUrl) {
       let url = getFileAccessHttpUrl(fileUrl)
       this.visible = true
-      this.fileUrl = url
+      this.localFileUrl = url
     },
     handleOk() {
       this.close()

--
Gitblit v1.9.3