zhujindu 2 nedēļas atpakaļ
vecāks
revīzija
4207833583

+ 10 - 6
src/components/deleteUploadImgTaskPhoto.vue

@@ -43,10 +43,10 @@ export default {
   name: 'deleteUploadImgTaskPhoto',
   components: { uploadVNormalTaskPhoto },
   props: {
-    imgs: {
-      type: Array,
+    formData: {
+      type: Object,
       default() {
-        return [];
+        return {};
       },
     },
     photoIdentifyType: {
@@ -94,9 +94,12 @@ export default {
     },
   },
   watch: {
-    imgs: {
+    formData: {
       handler(val) {
-        if (val) this.imgArr = val;
+        this.imgArr = [];
+        if (val) {
+          this.imgArr = val.collectionItemList.fileInfoList || val.mediaInfos;
+        }
       },
       deep: true,
       immediate: true,
@@ -115,7 +118,7 @@ export default {
       this.imgArr.splice(index, 1);
     },
     previewsImg(index) {
-      let urls = this.imgArr.map((item) => item.serverId);
+      let urls = this.imgArr.map((item) => item.fileUrl);
       ImagePreview({
         images: urls,
         startPosition: index,
@@ -124,6 +127,7 @@ export default {
     newimgarr(data) {
       const { localIds, locationRemark, source } = data;
       this.locationRemark = locationRemark;
+      console.log(source);
       if (source == 'weixin') {
         this.syncUpload(localIds);
       } else {

+ 1 - 1
src/views/deviceWithin/taskPhotoTaking.vue

@@ -43,7 +43,7 @@
               </van-cell>
               <deleteUploadImgTaskPhoto
                 ref="taskPhoto"
-                :imgs="formData.mediaInfos"
+                :formData="formData"
                 :storeGroupId="storeGroupId"
                 :taskIds="taskIds"
                 :visitsId="visitsId"