From a4dff39e4fd1e29b4b94997c79a1dd5f575f56de Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期一, 29 七月 2024 11:15:42 +0800
Subject: [PATCH] 测试完成

---
 src/components/Regular/index.vue |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/components/Regular/index.vue b/src/components/Regular/index.vue
index 091e957..42b2e87 100644
--- a/src/components/Regular/index.vue
+++ b/src/components/Regular/index.vue
@@ -66,7 +66,7 @@
             </el-input> </el-form-item
         ></el-col>
       </el-row>
-      <el-form-item label="鍏抽敭瀛�(鍚�)" prop="desc">
+      <el-form-item label="鍏抽敭瀛�(鍚�)" prop="desc" v-if="hasValue">
         <div class="xinz-inf">
           <el-tag
             :key="crux"
@@ -108,7 +108,7 @@
           >
         </div>
       </el-form-item>
-      <el-form-item label="鍏抽敭瀛�(闈�)" prop="desc">
+      <el-form-item label="鍏抽敭瀛�(闈�)" prop="desc" v-if="hasValue">
         <div class="xinz-inf">
           <el-tag
             :key="crux"
@@ -156,7 +156,7 @@
             class="upload-demo"
             :action="uploadImgUrl"
             :headers="headers"
-            :accept="'image/*,video/*'"
+            accept=".jpg,.png,image/*"
             :on-success="handleChange.bind(this, item)"
           >
             <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button>
@@ -179,7 +179,6 @@
               class="upload-demo"
               style="display: flex"
               action="https://jsonplaceholder.typicode.com/posts/"
-              :on-change="handleChange"
               :file-list="fileList"
               :limit="1"
               :on-exceed="handleExceed"
@@ -268,6 +267,10 @@
       type: Boolean,
       default: true,
     },
+    hasValue: {
+      type: Boolean,
+      default: true,
+    },
   },
 
   created() {
@@ -314,9 +317,9 @@
       this.handleSelectionChange();
     },
     // 鎺у埗鏂囦欢
-    handleChange(file, fileList) {
-      this.fileList = fileList.slice(-3);
-    },
+    // handleChange(file, fileList) {
+    //   this.fileList = fileList.slice(-3);
+    // },
     // 鏂囦欢瓒呭嚭涓暟闄愬埗鏃剁殑閽╁瓙
     handleExceed(files, fileList) {
       this.$message.warning(
@@ -392,9 +395,13 @@
     },
     // 閫夐」鏂囦欢涓婁紶
     handleChange(item, response, file, fileList) {
+      console.log(response, "response");
+      console.log(item, "item");
+      console.log(this.TargetoptionList, "this.TargetoptionList");
       let index = this.TargetoptionList.findIndex(
-        (obj) => obj.id == item.id && obj.name == item.name
+        (obj) => obj.guid == item.guid
       );
+      console.log(index);
       this.TargetoptionList[index].picturePath = response.url;
     },
   },

--
Gitblit v1.9.3