From e788995330a3fd588d0d80f28ee7510e4b7c787f Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 12 二月 2025 15:35:07 +0800
Subject: [PATCH] 只在项目中心展示审核按钮

---
 src/components/FileUpload/index.vue |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue
index e396687..2cb9b1b 100644
--- a/src/components/FileUpload/index.vue
+++ b/src/components/FileUpload/index.vue
@@ -2,6 +2,7 @@
   <div class="upload-file">
     <el-upload
       multiple
+      :accept="acceptList"
       :action="uploadFileUrl"
       :before-upload="handleBeforeUpload"
       :file-list="fileList"
@@ -55,7 +56,7 @@
     // 澶у皬闄愬埗(MB)
     fileSize: {
       type: Number,
-      default: 5,
+      default: 20,
     },
     // 鏂囦欢绫诲瀷, 渚嬪['png', 'jpg', 'jpeg']
     fileType: {
@@ -109,6 +110,11 @@
     showTip() {
       return this.isShowTip && (this.fileType || this.fileSize);
     },
+    acceptList () {
+      let temp = '.*'
+      temp = this.fileType.map(item => '.' + item).join(',')
+      return temp
+    }
   },
   methods: {
     // 涓婁紶鍓嶆牎妫�鏍煎紡鍜屽ぇ灏�
@@ -147,7 +153,7 @@
     // 涓婁紶鎴愬姛鍥炶皟
     handleUploadSuccess(res, file) {
       if (res.code === 200) {
-        this.uploadList.push({ name: res.fileName, url: res.fileName });
+        this.uploadList.push({ name: res.newFileName, originalName: res.originalFilename , url: res.fileName });
         this.uploadedSuccessfully();
       } else {
         this.number--;
@@ -160,7 +166,9 @@
     // 鍒犻櫎鏂囦欢
     handleDelete(index) {
       this.fileList.splice(index, 1);
-      this.$emit("input", this.listToString(this.fileList));
+      // this.$emit("input", this.listToString(this.fileList));
+      //淇敼涓鸿繑鍥炴暟缁�
+      this.$emit("input", this.fileList);
     },
     // 涓婁紶缁撴潫澶勭悊
     uploadedSuccessfully() {
@@ -168,7 +176,9 @@
         this.fileList = this.fileList.concat(this.uploadList);
         this.uploadList = [];
         this.number = 0;
-        this.$emit("input", this.listToString(this.fileList));
+        // this.$emit("input", this.listToString(this.fileList));
+        //淇敼涓鸿繑鍥炴暟缁�
+        this.$emit("input", this.fileList);
         this.$modal.closeLoading();
       }
     },

--
Gitblit v1.8.0