From 0c709fb497969d476a41b50e7293a0a66c891cb4 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Sat, 12 Jul 2025 16:23:14 +0800
Subject: [PATCH] feat:事件工单图片回显

---
 src/views/tickets/ticket.vue |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index 7551c9e..87eeb06 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -150,7 +150,7 @@
               <el-form-item label="附件图片" prop="photos" required class="upload-wrapper">
                 <el-upload ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
                   :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload"
-                  :file-list="form.photos" :limit="1" accept="image/*" class="create-upload">
+                  :file-list="popupShowImage(form.photos)" :limit="1" accept="image/*" class="create-upload">
                   <template v-if="form.photos.length < 1">
                     <!-- <i class="el-icon-plus">+</i> -->
                       <div class="el-icon-plus">
@@ -158,6 +158,7 @@
                     </div>
                   </template>
                 </el-upload>
+               
                 <div class="upload-tip">需上传含有地址信息的照片(jpg、jpeg、png),且不超过5M</div>
               </el-form-item>
             </el-col>
@@ -507,6 +508,7 @@
 </template>
 
 <script>
+import { getSmallImg,getShowImg } from '@/utils/util';
 import { ElMessageBox, ElLoading } from 'element-plus'
 import { calculateDefaultRange } from '@/utils/util'
 import { gcj02ToWgs84, wgs84ToGcj02 } from '@/utils/coordinateTransformation'
@@ -522,7 +524,6 @@
 } from '@/api/tickets/ticket'
 import { export_json_to_excel } from '@/utils/exportExcel'
 import geoJson from '@/assets/geoJson.json'
-
 import { mapGetters } from 'vuex'
 import { getAdcodeObj } from '@/utils/disposeData'
 function regExp (label, name) {
@@ -976,6 +977,16 @@
         return '/'
       }
     },
+
+    popupShowImage () {
+      return (list) => {
+
+        return list.map(item => ({
+          ...item,
+          url: getShowImg(item.url)
+        }))
+      }
+    }
   },
 
   methods: {
@@ -1528,6 +1539,7 @@
     },
 
     async handleViewDetail (row) {
+
       // 找到当前行在tableData中的索引
       this.currentIndex = this.tableData.findIndex(item => item.id === row.id)
       // 先设置workType,直接从row读取
@@ -2004,7 +2016,9 @@
         this.finalizeLoading = false
       }
     },
-
+//  getSmallImg(url) {
+// 	return url ? url.substring(0, url.lastIndexOf('.')) + '_small' + url.substring(url.lastIndexOf('.')) : ''
+// },
     // 添加编辑方法
     handleEdit (row) {
       console.log('编辑原始数据:', row)
@@ -2082,6 +2096,7 @@
         address: row.address || '',
         content: row.content,
         photos: [],
+    
       }
 
       let curLocation = []

--
Gitblit v1.9.3