From c742c1f1e4e999d38ac5dbadb063b707885845af Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 15 Jul 2025 10:59:59 +0800
Subject: [PATCH] feat:事件工单图片预览

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

diff --git a/src/views/tickets/ticket.vue b/src/views/tickets/ticket.vue
index 8f0b377..fa4abff 100644
--- a/src/views/tickets/ticket.vue
+++ b/src/views/tickets/ticket.vue
@@ -148,9 +148,9 @@
             </el-col>
             <el-col :span="12">
               <el-form-item label="附件图片" prop="photos" required class="upload-wrapper">
-                <el-upload ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
+                <el-upload v-if="createoredit === 1" ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
                   :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload"
-                  :file-list="popupShowImage(form.photos)" :limit="1" accept="image/*" class="create-upload">
+                  :file-list="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,7 +158,16 @@
                     </div>
                   </template>
                 </el-upload>
-               
+                  <el-upload v-else ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card"
+                  :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload"
+                  :file-list="popupShowImage(form.photos)" :limit="1" accept="image/*" class="create-upload">
+                  <template v-if="form.photos.length < 1">
+                   
+                      <div class="el-icon-plus">
+                      <span>+</span>
+                    </div>
+                  </template>
+                </el-upload>
                 <div class="upload-tip">需上传含有地址信息的照片(jpg、jpeg、png),且不超过5M</div>
               </el-form-item>
             </el-col>
@@ -543,6 +552,7 @@
       dispatchLoading: false,
       completeLoading: false,
       finalizeLoading: false,
+      createoredit:'',
       activeTab: 'all',
       // tabs 只保留静态结构,不做权限判断
       tabs: [
@@ -1508,6 +1518,8 @@
     },
 
     handleAdd () {
+  
+    this.createoredit =1
       this.dialogVisible = true
       this.mapParams.center = null
       this.form.location = []
@@ -2019,6 +2031,7 @@
 
     // 添加编辑方法
     handleEdit (row) {
+    this.createoredit = 2
       console.log('编辑原始数据:', row)
 
       // 尝试从row.dept_id或通过部门名称查找对应的部门ID

--
Gitblit v1.9.3