Browse Source

瓦斯巡检图片识别修改更新

lxh 2 weeks ago
parent
commit
7bb6b76643

+ 1 - 0
common/service/config.service.js

@@ -13,6 +13,7 @@ if (process.env.NODE_ENV == "development") {
   // BASE_URL = "http://182.92.126.35:9999"; // 生产环境
   // BASE_URL = "http://172.16.53.16:9999"; // 
   BASE_URL = "http://10.246.167.205:9999"; //上湾
+  // BASE_URL = "http://172.30164.61:9999"; //元子沟
 
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";

+ 35 - 24
pages/gasreport/components/gasImgIdentify.vue

@@ -28,13 +28,18 @@
             </view>
             <!-- 识别列表 -->
             <view class="sb-list" v-if="indexList.length != 0">
-                <u-list>
+                <u-list :preLoadScreen="0.5">
                     <u-list-item v-for="(item, index) in indexList" :key="index">
-                        <u-cell :title="item['检查地点']">
+                        <u-cell :title="item['检查地点']" center>
                             <view slot="value" class="u-slot-title">
                                 <u-tag text="选择" plain size="mini" type="warning" @click="choiceSb(item)">
                                 </u-tag>
                             </view>
+                            <view slot="label" style="font-size: 12px;" class="u-slot-contents">
+                                <text>班次:{{ item['班次'] }}</text>
+                                <text style="margin:0px 10px">日期:{{ item['日期'] }}</text>
+                                <text>检查时间:{{ item['检查时间'] }}</text>
+                            </view>
                         </u-cell>
                     </u-list-item>
                 </u-list>
@@ -285,10 +290,10 @@ export default {
         //获取图片识别数据
         getGasIdentify() {
             let that = this
-            let apiUrl = configService.apiUrl;
             console.log(that.imageSrcList[0])
+            let apiUrlImg = `${configService.apiUrl.substring(0, configService.apiUrl.lastIndexOf(':'))}:6006`
             uni.uploadFile({
-                url: `${apiUrl}/gasIdentify`,
+                url: `${apiUrlImg}/gasIdentify`,
                 filePath: that.imageSrcList[0].path,
                 name: 'img',
                 formData: {
@@ -296,7 +301,8 @@ export default {
                 },
                 success: (res) => {
                     if (res) {
-                        that.indexList = res.data.dara
+                        console.log(JSON.parse(res.data), '识别数据------')
+                        that.indexList = JSON.parse(res.data).data || []
                         uni.showToast({
                             title: '识别成功!',
                             icon: 'none' // 可选图标,'success', 'loading', 'none'
@@ -1578,26 +1584,29 @@ export default {
         //瓦斯新增
         getAdd() {
             let that = this
-            that.isStatus = 'add'
-            that.isShowAdd = true
-            that.formState = {
-                id: '',
-                bc: that.indexParam['班次'],
-                count: '',
-                jcdd: '',
-                jcy: that.indexParam['检查人'],
-                time: '',
-                ch4: that.indexParam['CH4%'],
-                co2: that.indexParam['CO2%  '],
-                co: that.indexParam['CO(ppm)'],
-                o2: that.indexParam['O2%'],
-                jw: '',
-                gw: '',
-                bxy: '',
-                tbrq: '',
-                temp: that.indexParam['温度(℃)'],
-                mcgzm: '',
+            if (JSON.stringify(that.indexParam) != '{}') {
+                that.isStatus = 'add'
+                that.isShowAdd = true
+                that.formState = {
+                    id: '',
+                    bc: that.indexParam['班次'],
+                    count: '',
+                    jcdd: '',
+                    jcy: that.indexParam['检查人'],
+                    time: '',
+                    ch4: that.indexParam['CH4%'],
+                    co2: that.indexParam['CO2%'],
+                    co: that.indexParam['CO(ppm)'],
+                    o2: that.indexParam['O2%'],
+                    jw: '',
+                    gw: '',
+                    bxy: '',
+                    tbrq: '',
+                    temp: that.indexParam['温度(℃)'],
+                    mcgzm: '',
+                }
             }
+
         },
         getAddSave() {
             let that = this
@@ -2228,6 +2237,8 @@ export default {
             this.isShowAdd = false
             this.isDisabled = false
             this.saveShowList = {}
+            this.indexList = []
+            this.indexParam = {}
             this.clearData()
         },
 

+ 1 - 1
pages/gasreport/gasreport.vue

@@ -62,7 +62,7 @@ export default {
                     that.gasTitle = '瓦斯巡检记录卡管理'
                     that.showModel = false
                     break;
-                    case '图片识别':
+                case '图片识别':
                     that.loadComponent = 'gasImgIdentify'
                     that.gasTitle = '图片识别'
                     that.showModel = false