From 9025b9cf7ec8610003d445a31d93e35e7bd73c2e Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期三, 31 一月 2024 17:54:52 +0800
Subject: [PATCH] 修改

---
 web/packages/components/zt-uploader/src/zt-uploader.vue |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/web/packages/components/zt-uploader/src/zt-uploader.vue b/web/packages/components/zt-uploader/src/zt-uploader.vue
index 7f9fa0d..d93f8f7 100644
--- a/web/packages/components/zt-uploader/src/zt-uploader.vue
+++ b/web/packages/components/zt-uploader/src/zt-uploader.vue
@@ -1,5 +1,5 @@
 <template>
-  <div class="zt-upload">
+  <div class="zt-upload"  :class="[{'lineHeight':lineHeight}]">
     <!-- 鏂囦欢涓婁紶 -->
     <el-upload
       ref="upload"
@@ -59,7 +59,7 @@
     </el-upload>
     <br/>
     <div v-show="progressFlag">
-      <el-progress :text-inside="true" :stroke-width="30" :percentage="progressPercent" :format="format"></el-progress>
+      <el-progress :text-inside="true" :stroke-width="10" :percentage="progressPercent" :format="format"></el-progress>
     </div>
 
     <ul class="el-upload-list el-upload-list--text" v-if="!image && !crop && !onlyUploadFile">
@@ -206,6 +206,10 @@
         }
       },
       dataForm: Object,
+      lineHeight:{
+        type: Boolean,
+        default: false
+      },
       action: {
         type: String,
         default: '/sys/oss/uploadNew'
@@ -309,8 +313,7 @@
     inject: {
       elForm: {
         default: ''
-      }
-    },
+      }},
     data() {
       return {
         isUpload: false,
@@ -372,7 +375,7 @@
               src: this.value.url,
               title: this.value.name
             })
-          }
+         }
         }
         return urls
       },
@@ -396,6 +399,7 @@
     watch: {
       // eslint-disable-next-line no-unused-vars
       value(val, oldval) {
+        console.log(val,'zt-upload value(val')
         if (this.uploadList !== val) {
           this.uploadList = this.getUploadList(val)
           this.fileList = this.getUploadList(val)
@@ -420,10 +424,8 @@
         if (val) {
           if (val.length > 0) {
             if (!this.multiple) { // 鍗曢��
-              console.log(val, 'getUploadList val')
               return val
             } else {
-              console.log([...val], 'getUploadList [...val]')
               return [...val]
             }
           } else {
@@ -948,6 +950,15 @@
       if (this.crop && this.$refs.cropper) {
         document.body.appendChild(this.$refs.cropper.$el)
       }
+      if (this.value) {
+        console.log(this.value,'zt-upload value(val')
+        this.uploadList = this.getUploadList(this.value)
+        this.fileList = this.getUploadList(this.value)
+        if (this.fileList.length>0){
+          console.log(this.fileList[0].status, 'val.files[0].status23')
+          // alert('2222'+this.fileList[0].status)
+        }
+      }
     }
   }
 </script>
@@ -956,7 +967,9 @@
   .zt-upload {
     line-height: 1;
   }
-
+  .zt-upload.lineHeight{
+    line-height: 0;
+  }
   .zt .upload-input .upload-btn {
     padding: 8px 12px;
   }

--
Gitblit v1.9.1