Browse Source

瓦斯巡检图片识别开发完成

lxh 1 month ago
parent
commit
ceaffa1796
2 changed files with 12 additions and 10 deletions
  1. 0 4
      api/api.js
  2. 12 6
      pages/gasreport/components/gasImgIdentify.vue

+ 0 - 4
api/api.js

@@ -8,10 +8,6 @@ const apiService = {
   login(params) {
     return http.post("/sys/mLogin", params);
   },
-  gasIdentify(params) {
-    let header={ 'Content-Type': 'multipart/form-data' }
-    return http.post("/gasIdentify", params,'formdata', {header:header},);
-  },
   /**
    * 获取权限菜单
    */

+ 12 - 6
pages/gasreport/components/gasImgIdentify.vue

@@ -307,14 +307,20 @@ export default {
                     'user': that.username,
                 },
                 success: (res) => {
-                    console.log(res,'识别成功!');
-                    if(res){
-                        that.indexList=res.data.dara
+                    if (res) {
+                        that.indexList = res.data.dara
+                        uni.showToast({
+                            title: '识别成功!',
+                            icon: 'none' // 可选图标,'success', 'loading', 'none'
+                        });
                     }
 
                 },
-                fail:(errpr)=>{
-                    console.log(error.data,'识别失败!');
+                fail: (errpr) => {
+                    uni.showToast({
+                        title: '识别失败!',
+                        icon: 'none' // 可选图标,'success', 'loading', 'none'
+                    });
                 }
             });
         },
@@ -345,7 +351,7 @@ export default {
         delSb() {
             this.indexList = []
             this.indexParam = {}
-            this.imageSrc=''
+            this.imageSrc = ''
         },
         //班次下拉选项切换
         changeBc(e) {