瀏覽代碼

图像识别

zhujindu 1 年之前
父節點
當前提交
a52db17b73
共有 2 個文件被更改,包括 50 次插入69 次删除
  1. 1 0
      src/components/uploadVNormal.vue
  2. 49 69
      src/views/deviceWithin/addStoreVisit.vue

+ 1 - 0
src/components/uploadVNormal.vue

@@ -294,6 +294,7 @@ export default {
         fileUrl: res.data.url,
         id: res.data.fileId,
         type: 2,
+        photoIdentifyType: this.photoIdentifyType,
       });
     },
     progress() {

+ 49 - 69
src/views/deviceWithin/addStoreVisit.vue

@@ -3822,54 +3822,39 @@ export default {
     },
     newimgarr1(val) {
       this.show = false;
+      //是否开启图匠识别,(1:店招内容识别,2:门店代码识别,3:调色机识别,4:更换店招)
+      //  拍摄店招时只允许上传一张
+      let photoIdentifyType = val.photoIdentifyType;
       if (this.pType == 'D') {
-        if (
+        let fileInfoList =
           this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1]
             .collectionItems[this.childIndex].collectionOptionList[this.childIndex2]
             .collectionItems[this.childIndex3].collectionOptionList[this.childIndex4]
-            .collectionItems[this.childIndex5].fileInfoList == null
-        ) {
-          this.collectionItemList[this.indeximg].collectionOptionList[
-            this.childIndex1
-          ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
-            this.childIndex3
-          ].collectionOptionList[this.childIndex4].collectionItems[this.childIndex5].fileInfoList =
-            [];
+            .collectionItems[this.childIndex5].fileInfoList;
+        if (fileInfoList == null) {
+          fileInfoList = [];
+        }
+        if (photoIdentifyType == 1) {
+          fileInfoList = val;
+        } else {
+          fileInfoList.push(val);
         }
-        this.collectionItemList[this.indeximg].collectionOptionList[
-          this.childIndex1
-        ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
-          this.childIndex3
-        ].collectionOptionList[this.childIndex4].collectionItems[
-          this.childIndex5
-        ].fileInfoList.push(val);
       }
       if (this.pType == 'E') {
-        if (
+        let fileInfoList =
           this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1]
             .collectionItems[this.childIndex].collectionOptionList[this.childIndex2]
             .collectionItems[this.childIndex3].collectionOptionList[this.childIndex4]
             .collectionItems[this.childIndex5].collectionOptionList[this.childIndex6]
-            .collectionItems[this.childIndex7].fileInfoList == null
-        ) {
-          this.collectionItemList[this.indeximg].collectionOptionList[
-            this.childIndex1
-          ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
-            this.childIndex3
-          ].collectionOptionList[this.childIndex4].collectionItems[
-            this.childIndex5
-          ].collectionOptionList[this.childIndex6].collectionItems[this.childIndex7].fileInfoList =
-            [];
+            .collectionItems[this.childIndex7].fileInfoList;
+        if (fileInfoList == null) {
+          fileInfoList = [];
+        }
+        if (photoIdentifyType == 1) {
+          fileInfoList = val;
+        } else {
+          fileInfoList.push(val);
         }
-        this.collectionItemList[this.indeximg].collectionOptionList[
-          this.childIndex1
-        ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
-          this.childIndex3
-        ].collectionOptionList[this.childIndex4].collectionItems[
-          this.childIndex5
-        ].collectionOptionList[this.childIndex6].collectionItems[
-          this.childIndex7
-        ].fileInfoList.push(val);
       }
       if (this.pType == 'A' || this.pType == 'B') {
         var child = false;
@@ -3888,54 +3873,49 @@ export default {
           }
         }
         if (child) {
+          let fileInfoList =
+            this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
+              this.childIndex
+            ].fileInfoList;
           for (
             let childi = 0;
             childi < this.collectionItemList[this.indeximg].collectionOptionList.length;
             childi++
           ) {
-            if (
-              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
-                this.childIndex
-              ].fileInfoList == null ||
-              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
-                this.childIndex
-              ].fileInfoList == undefined
-            ) {
-              this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
-                this.childIndex
-              ].fileInfoList = [];
+            if (fileInfoList == null || fileInfoList == undefined) {
+              fileInfoList = [];
+            }
+            if (photoIdentifyType == 1) {
+              fileInfoList = val;
+            } else {
+              fileInfoList.push(val);
             }
-            this.collectionItemList[this.indeximg].collectionOptionList[childi].collectionItems[
-              this.childIndex
-            ].fileInfoList.push(val);
           }
         } else {
-          if (
-            this.collectionItemList[this.indeximg].fileInfoList == null ||
-            this.collectionItemList[this.indeximg].fileInfoList == undefined
-          ) {
-            this.collectionItemList[this.indeximg].fileInfoList = [];
+          let fileInfoList = this.collectionItemList[this.indeximg].fileInfoList;
+          if (fileInfoList == null || fileInfoList == undefined) {
+            fileInfoList = [];
+          }
+          if (photoIdentifyType == 1) {
+            fileInfoList = val;
+          } else {
+            fileInfoList.push(val);
           }
-          this.collectionItemList[this.indeximg].fileInfoList.push(val);
         }
       }
       if (this.pType == 'C') {
-        if (
+        let fileInfoList =
           this.collectionItemList[this.indeximg].collectionOptionList[this.childIndex1]
             .collectionItems[this.childIndex].collectionOptionList[this.childIndex2]
-            .collectionItems[this.childIndex3].fileInfoList == null
-        ) {
-          this.collectionItemList[this.indeximg].collectionOptionList[
-            this.childIndex1
-          ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
-            this.childIndex3
-          ].fileInfoList = [];
+            .collectionItems[this.childIndex3].fileInfoList;
+        if (fileInfoList == null) {
+          fileInfoList = [];
+        }
+        if (photoIdentifyType == 1) {
+          fileInfoList = val;
+        } else {
+          fileInfoList.push(val);
         }
-        this.collectionItemList[this.indeximg].collectionOptionList[
-          this.childIndex1
-        ].collectionItems[this.childIndex].collectionOptionList[this.childIndex2].collectionItems[
-          this.childIndex3
-        ].fileInfoList.push(val);
       }
     },
     zSelectVal(value) {