From 3845699a34ceb448b4d47a82bb928bf83203dcaf Mon Sep 17 00:00:00 2001
From: wl <173@qq.com>
Date: 星期三, 26 十月 2022 11:23:40 +0800
Subject: [PATCH] 上传处置图片上传过程展示

---
 src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/evidence/index.vue |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/evidence/index.vue b/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/evidence/index.vue
index 7d70c90..e952b39 100644
--- a/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/evidence/index.vue
+++ b/src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/evidence/index.vue
@@ -38,19 +38,20 @@
                 <!-- 鐓х墖闄勪欢 -->
                 <el-form-item label="鐓х墖闄勪欢:" prop="pic">
                     <div class="upImg">
-                        <div class="img-list" v-if="evidence.pic.length!==0">
+                        <!-- <div class="img-list" v-if="evidence.pic.length!==0">
                             <div class="img" v-for="(item,index) in evidence.pic" :key="index">
                                 <img :src="item" alt="">
                                 <i class="el-icon-close myicon" @click="handleRemove(index)"></i>
                             </div>
-                        </div>
-                        <div class="upload" v-if="evidence.pic.length<4">
+                        </div> -->
+                        <MyUpload  @setPictureUrl="setPicUrl" @delPictureUrl="delPicUrl"></MyUpload>
+                        <!-- <div class="upload" v-if="evidence.pic.length<4">
                             <el-upload :file-list="fileList" class="upload-demo"
                                 action="/sccg/file/medias" multiple :show-file-list="false"
                                 :limit="4" :on-success="handleSuccess2" :headers="getToken()">
                                 <i class="el-icon-plus"></i>
                             </el-upload>
-                        </div>
+                        </div> -->
                         <div class="tip">{{evidence.pic.length}} / 4</div>
                     </div>
                 </el-form-item>
@@ -151,7 +152,11 @@
 <script>
 import { getTypeList } from '@/utils/helper'
 import {validateName,validatePhone,validateCardId} from '@/utils/validate'
+import MyUpload from "@/components/myUpload"
 export default {
+    components: {
+        MyUpload
+    },
     data() {
         const checkName = (rule, value, callback) => {
             if (value) {
@@ -522,6 +527,21 @@
         // 鑾峰彇姘戞棌鍒楄〃
         async getNationList() {
             this.nationOptions = await getTypeList(1, '05');
+        },
+         // 璁剧疆涓婁紶鎴愬姛涔嬪悗鐨勫浘鐗囧湴鍧�
+         setPicUrl({ url }) {
+            const baseUrl = 'http://140.143.152.226:8410/';
+            if (this.evidence.pic.length < 4) {
+                this.evidence.pic.push(baseUrl + url)
+            }
+            console.log(url);
+        },
+        //鍒犻櫎鍥剧墖
+        delPicUrl({url}){
+            const baseUrl = 'http://140.143.152.226:8410/';
+            console.log(url);
+            this.evidence.pic.splice(this.evidence.pic.indexOf(baseUrl + url),1);
+            console.log(this.evidence.pic);
         }
     },
     watch: {

--
Gitblit v1.8.0