Browse Source

拉布拉特修改提交

lxh 1 month ago
parent
commit
69e1819efd

+ 4 - 5
pages/gasreport/components/gasFill.vue

@@ -266,10 +266,10 @@ export default {
     },
     watch: {
         cardIds: {
-           async handler(newV, oldV) {
+            async handler(newV, oldV) {
                 if (newV) {
-                  await  this.getCardLists(newV)
-                  this.change()
+                    await this.getCardLists(newV)
+                    this.change()
                 }
             },
             immediate: true
@@ -908,7 +908,7 @@ export default {
                                             jcy: that.formState.jcy,
                                             time: that.formState.time,
                                             // ch4: that.saveShowList.bxySdzNoon1 || '',
-                                             ch4: that.saveShowList.ch4Noon1 || '',
+                                            ch4: that.saveShowList.ch4Noon1 || '',
                                             co2: that.saveShowList.co2Noon1 || '',
                                             co: that.saveShowList.coNoon1 || '',
                                             o2: that.saveShowList.o2Noon1 || '',
@@ -1554,7 +1554,6 @@ export default {
             if (that.nfcShow) {
                 testNfc.listenNFCStatus()
                 testNfc.readData();
-                // that.change()
             }
 
         },

+ 932 - 944
pages/gasreport/components/gasImgIdentify.vue

@@ -22,10 +22,10 @@
         >
         <!-- 图片预览 -->
         <view class="imgView">
-          <image
-            v-if="imageSrc"
+           <image
+            v-if="saveImg || imageSrc"
             style="width: 100%"
-            :src="imageSrc"
+            :src="imageSrc ? imageSrc : saveImg"
             @click="getPreview"
           >
           </image>
@@ -39,7 +39,7 @@
             margin: 2px 0px;
           "
         >
-          <!-- <u-button
+          <u-button
             icon="eye"
             type="primary"
             size="small"
@@ -48,17 +48,17 @@
             style="width: 49%; margin: 0"
             @click="getGasIdentify"
             >识别</u-button
-          > -->
+          >
           <u-button
             icon="trash"
             type="primary"
             size="small"
-            style="width: 100%; margin: 0"
+            style="width: 49%; margin: 0"
             @click="delSb"
             >删除</u-button
           >
         </view>
-        <!-- <helang-compress ref="helangCompress"></helang-compress> -->
+        <helang-compress ref="helangCompress"></helang-compress>
       </view>
     </view>
 
@@ -93,6 +93,8 @@
           ? '295px 0px 10px 0px'
           : imageSrc
           ? '330px 0px 10px 0px'
+          : saveImg
+          ? '330px 0px 10px 0px'
           : '54px 0px 10px 0px',
       }"
       :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'"
@@ -289,12 +291,12 @@
 import api from "@/api/api";
 import moment from "moment";
 import configService from "@/common/service/config.service.js";
-// import { RHFselcet } from "@/uni_modules/fz-media-selcet";
-// import helangCompress from "@/components/helang-compress/helang-compress";
+import { RHFselcet } from "@/uni_modules/fz-media-selcet";
+import helangCompress from "@/components/helang-compress/helang-compress";
 export default {
   name: "gasFill",
   components: {
-    // helangCompress,
+    helangCompress,
   },
   props: {
     Ids: {
@@ -337,6 +339,10 @@ export default {
       type: String,
       default: "",
     },
+     saveImg: {
+      type: String,
+      default: "",
+    },
   },
 
   data() {
@@ -499,7 +505,7 @@ export default {
         });
       } else {
         uni.previewImage({
-          urls: this.tempFilePaths,
+          urls: this.saveImg ? [this.saveImg] : this.tempFilePaths,
           current: 0,
         });
       }
@@ -935,942 +941,924 @@ export default {
       }
     },
     //先压缩后识别
-    // getScale() {
-    //   let that = this;
-    //   // 单张压缩
-    //   that.$refs.helangCompress
-    //     .compress({
-    //       src: that.imageSrc,
-    //       maxSize: 800,
-    //       fileType: "png",
-    //       quality: 0.85,
-    //       minSize: 640, //最小压缩尺寸,图片尺寸小于该时值不压缩,非H5平台有效。若需要忽略该设置,可设置为一个极小的值,比如负数。
-    //     })
-    //     .then((res) => {
-    //       that.imageSrc = res;
-    //       // 压缩成功回调
-    //       that.loading = true;
-    //       let jcNum = that.deviceName.indexOf("第三次") != -1 ? 3 : null;
-    //       let apiUrlImg = `${configService.apiUrlP}:6008`;
-    //       uni.uploadFile({
-    //         url: `${apiUrlImg}/gasIdentify`,
-    //         filePath: that.imageSrc,
-    //         name: "img",
-    //         formData: {
-    //           user: that.username,
-    //           order: that.classType,
-    //           reportdate: that.searchTime,
-    //           checkorder: jcNum ? jcNum : Number(that.checkNum),
-    //           checkpath: that.deviceName,
-    //           imgpath: that.imageSrc,
-    //         },
-
-    //         success: (res) => {
-    //           if (res) {
-    //             uni.showToast({
-    //               title: "识别成功!",
-    //               icon: "none", // 可选图标,'success', 'loading', 'none'
-    //             });
-    //             that.indexList = JSON.parse(res.data).data || [];
-    //             that.isShowAdd = true;
-    //             that.loading = false;
-    //             that.isShowAdd = true;
-    //             that.statusShow = "add";
-    //             that.deviceId = that.deviceID;
-
-    //             if (that.indexList.length != 0) {
-    //               that.indexParam = that.indexList[0];
-    //               that.formState = {
-    //                 id: "",
-    //                 bc: that.classType || "",
-    //                 count:
-    //                   that.checkNum == "1"
-    //                     ? "第一次"
-    //                     : that.checkNum == "2"
-    //                     ? "第二次"
-    //                     : "",
-    //                 jcdd: that.deviceName || "",
-    //                 jcy:
-    //                   that.indexParam && that.indexParam["检查人"]
-    //                     ? that.indexParam["检查人"]
-    //                     : that.username,
-    //                 time:
-    //                   that.indexParam && that.indexParam["检查时间"]
-    //                     ? that.indexParam["检查时间"]
-    //                     : "",
-    //                 ch4:
-    //                   that.indexParam && that.indexParam["CH4%"]
-    //                     ? that.indexParam["CH4%"]
-    //                     : "",
-    //                 co2:
-    //                   that.indexParam && that.indexParam["CO2%"]
-    //                     ? that.indexParam["CO2%"]
-    //                     : "",
-    //                 co:
-    //                   that.indexParam && that.indexParam["CO(ppm)"]
-    //                     ? that.indexParam["CO(ppm)"]
-    //                     : "",
-    //                 o2:
-    //                   that.indexParam && that.indexParam["O2%"]
-    //                     ? that.indexParam["O2%"]
-    //                     : "",
-    //                 jw: that.isSensor == "1" ? "0" : "-",
-    //                 bxy: "0",
-    //                 tbrq:
-    //                   that.indexParam && that.indexParam["检查时间"]
-    //                     ? that.indexParam["检查时间"].substring(
-    //                         0,
-    //                         that.indexParam["检查时间"].indexOf(" ")
-    //                       )
-    //                     : "",
-    //                 temp:
-    //                   that.indexParam && that.indexParam["温度(℃)"]
-    //                     ? that.indexParam["温度(℃)"]
-    //                     : "",
-    //               };
-
-    //               new Promise((resolve, reject) => {
-    //                 api
-    //                   .getGas({
-    //                     reportTime: that.formState.tbrq,
-    //                     deviceId: that.deviceId,
-    //                   })
-    //                   .then((response) => {
-    //                     if (response.data.code == 200) {
-    //                       let data = response.data.result.records;
-    //                       if (data.length != 0) {
-    //                         that.saveShowList = data[0];
-    //                         if (
-    //                           that.formState.bc == "早班" &&
-    //                           that.formState.count == "第一次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzEarly1: that.formState.bxy,
-    //                             ch4Early1: that.formState.ch4,
-    //                             checkPersonEarly: that.formState.jcy,
-    //                             co2Early1: that.formState.co2,
-    //                             coEarly1: that.formState.co,
-    //                             gwSdzEarly1: that.formState.ch4,
-    //                             jwSdzEarly1: that.formState.jw,
-    //                             o2Early1: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeEarly1: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tearly1: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "早班" &&
-    //                           that.formState.count == "第二次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzEarly2: that.formState.bxy,
-    //                             ch4Early2: that.formState.ch4,
-    //                             checkPersonEarly: that.formState.jcy,
-    //                             co2Early2: that.formState.co2,
-    //                             coEarly2: that.formState.co,
-    //                             gwSdzEarly2: that.formState.ch4,
-    //                             jwSdzEarly2: that.formState.jw,
-    //                             o2Early2: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeEarly2: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tearly2: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "中班" &&
-    //                           that.formState.count == "第一次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNoon1: that.formState.bxy,
-    //                             ch4Noon1: that.formState.ch4,
-    //                             checkPersonNoon: that.formState.jcy,
-    //                             co2Noon1: that.formState.co2,
-    //                             coNoon1: that.formState.co,
-    //                             gwSdzNoon1: that.formState.ch4,
-    //                             jwSdzNoon1: that.formState.jw,
-    //                             o2Noon1: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNoon1: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnoon1: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "中班" &&
-    //                           that.formState.count == "第二次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNoon2: that.formState.bxy,
-    //                             ch4Noon2: that.formState.ch4,
-    //                             checkPersonNoon: that.formState.jcy,
-    //                             co2Noon2: that.formState.co2,
-    //                             coNoon2: that.formState.co,
-    //                             gwSdzNoon2: that.formState.ch4,
-    //                             jwSdzNoon2: that.formState.jw,
-    //                             o2Noon2: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNoon2: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnoon2: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "夜班" &&
-    //                           that.formState.count == "第一次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNight1: that.formState.bxy,
-    //                             ch4Night1: that.formState.ch4,
-    //                             checkPersonNight: that.formState.jcy,
-    //                             co2Night1: that.formState.co2,
-    //                             coNight1: that.formState.co,
-    //                             gwSdzNight1: that.formState.ch4,
-    //                             jwSdzNight1: that.formState.jw,
-    //                             o2Night1: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNight1: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnight1: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "夜班" &&
-    //                           that.formState.count == "第二次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNight2: that.formState.bxy,
-    //                             ch4Night2: that.formState.ch4,
-    //                             checkPersonNight: that.formState.jcy,
-    //                             co2Night2: that.formState.co2,
-    //                             coNight2: that.formState.co,
-    //                             gwSdzNight2: that.formState.ch4,
-    //                             jwSdzNight2: that.formState.jw,
-    //                             o2Night2: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNight2: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnight2: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         }
-    //                       } else {
-    //                         that.saveShowList = {};
-    //                         if (
-    //                           that.formState.bc == "早班" &&
-    //                           that.formState.count == "第一次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzEarly1: that.formState.bxy,
-    //                             ch4Early1: that.formState.ch4,
-    //                             checkPersonEarly: that.formState.jcy,
-    //                             co2Early1: that.formState.co2,
-    //                             coEarly1: that.formState.co,
-    //                             gwSdzEarly1: that.formState.ch4,
-    //                             jwSdzEarly1: that.formState.jw,
-    //                             o2Early1: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeEarly1: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tearly1: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "早班" &&
-    //                           that.formState.count == "第二次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzEarly2: that.formState.bxy,
-    //                             ch4Early2: that.formState.ch4,
-    //                             checkPersonEarly: that.formState.jcy,
-    //                             co2Early2: that.formState.co2,
-    //                             coEarly2: that.formState.co,
-    //                             gwSdzEarly2: that.formState.ch4,
-    //                             jwSdzEarly2: that.formState.jw,
-    //                             o2Early2: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeEarly2: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tearly2: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "中班" &&
-    //                           that.formState.count == "第一次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNoon1: that.formState.bxy,
-    //                             ch4Noon1: that.formState.ch4,
-    //                             checkPersonNoon: that.formState.jcy,
-    //                             co2Noon1: that.formState.co2,
-    //                             coNoon1: that.formState.co,
-    //                             gwSdzNoon1: that.formState.ch4,
-    //                             jwSdzNoon1: that.formState.jw,
-    //                             o2Noon1: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNoon1: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnoon1: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "中班" &&
-    //                           that.formState.count == "第二次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNoon2: that.formState.bxy,
-    //                             ch4Noon2: that.formState.ch4,
-    //                             checkPersonNoon: that.formState.jcy,
-    //                             co2Noon2: that.formState.co2,
-    //                             coNoon2: that.formState.co,
-    //                             gwSdzNoon2: that.formState.ch4,
-    //                             jwSdzNoon2: that.formState.jw,
-    //                             o2Noon2: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNoon2: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnoon2: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "夜班" &&
-    //                           that.formState.count == "第一次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNight1: that.formState.bxy,
-    //                             ch4Night1: that.formState.ch4,
-    //                             checkPersonNight: that.formState.jcy,
-    //                             co2Night1: that.formState.co2,
-    //                             coNight1: that.formState.co,
-    //                             gwSdzNight1: that.formState.ch4,
-    //                             jwSdzNight1: that.formState.jw,
-    //                             o2Night1: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNight1: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnight1: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         } else if (
-    //                           that.formState.bc == "夜班" &&
-    //                           that.formState.count == "第二次"
-    //                         ) {
-    //                           let param = {
-    //                             taskDetailsId: that.Ids,
-    //                             deviceId: that.deviceId,
-    //                             bxySdzNight2: that.formState.bxy,
-    //                             ch4Night2: that.formState.ch4,
-    //                             checkPersonNight: that.formState.jcy,
-    //                             co2Night2: that.formState.co2,
-    //                             coNight2: that.formState.co,
-    //                             gwSdzNight2: that.formState.ch4,
-    //                             jwSdzNight2: that.formState.jw,
-    //                             o2Night2: that.formState.o2,
-    //                             strInstallPos: that.formState.jcdd,
-    //                             timeNight2: that.formState.time,
-    //                             reportTime: that.formState.tbrq,
-    //                             tnight2: that.formState.temp,
-    //                           };
-    //                           that.paramData = Object.assign(
-    //                             {},
-    //                             that.saveShowList,
-    //                             param
-    //                           );
-    //                         }
-    //                       }
-    //                     } else {
-    //                       reject(response);
-    //                     }
-    //                   })
-    //                   .catch((error) => {
-    //                     console.log("catch===>response", response);
-    //                     reject(error);
-    //                   });
-    //               });
-    //             } else {
-    //               that.formState = {
-    //                 id: "",
-    //                 bc: that.classType || "",
-    //                 count:
-    //                   that.checkNum == "1"
-    //                     ? "第一次"
-    //                     : that.checkNum == "2"
-    //                     ? "第二次"
-    //                     : "",
-    //                 jcdd: that.deviceName || "",
-    //                 jcy: that.username,
-    //                 time: "",
-    //                 ch4: "",
-    //                 co2: "",
-    //                 co: "",
-    //                 o2: "",
-    //                 jw: that.isSensor == "1" ? "0" : "-",
-    //                 bxy: "0",
-    //                 tbrq: "",
-    //                 temp: "",
-    //               };
-    //             }
-    //           }
-    //         },
-    //         fail: (error) => {
-    //           uni.showToast({
-    //             title: "识别失败!",
-    //             icon: "none", // 可选图标,'success', 'loading', 'none'
-    //           });
-    //           that.loading = false;
-    //         },
-    //       });
-    //     })
-    //     .catch((err) => {
-    //       // 压缩失败回调
-    //       uni.showToast({
-    //         title: "压缩失败!",
-    //         icon: "none", // 可选图标,'success', 'loading', 'none'
-    //       });
-    //       that.loading = false;
-    //     });
-    // },
+    getScale() {
+      let that = this;
+      // 单张压缩
+      that.$refs.helangCompress
+        .compress({
+          src: that.imageSrc,
+          maxSize: 800,
+          fileType: "png",
+          quality: 0.85,
+          minSize: 640, //最小压缩尺寸,图片尺寸小于该时值不压缩,非H5平台有效。若需要忽略该设置,可设置为一个极小的值,比如负数。
+        })
+        .then((res) => {
+          that.imageSrc = res;
+          // 压缩成功回调
+          that.loading = true;
+          let jcNum = that.deviceName.indexOf("第三次") != -1 ? 3 : null;
+          let apiUrlImg = `${configService.apiUrlP}:6008`;
+          uni.uploadFile({
+            url: `${apiUrlImg}/gasIdentify`,
+            filePath: that.imageSrc,
+            name: "img",
+            formData: {
+              user: that.username,
+              order: that.classType,
+              reportdate: that.searchTime,
+              checkorder: jcNum ? jcNum : Number(that.checkNum),
+              checkpath: that.deviceName,
+              imgpath: that.imageSrc,
+            },
+
+            success: (res) => {
+              if (res) {
+                uni.showToast({
+                  title: "识别成功!",
+                  icon: "none", // 可选图标,'success', 'loading', 'none'
+                });
+                that.indexList = JSON.parse(res.data).data || [];
+                that.isShowAdd = true;
+                that.loading = false;
+                that.isShowAdd = true;
+                that.statusShow = "add";
+                that.deviceId = that.deviceID;
+
+                if (that.indexList.length != 0) {
+                  that.indexParam = that.indexList[0];
+                  that.formState = {
+                    id: "",
+                    bc: that.classType || "",
+                    count:
+                      that.checkNum == "1"
+                        ? "第一次"
+                        : that.checkNum == "2"
+                        ? "第二次"
+                        : "",
+                    jcdd: that.deviceName || "",
+                    jcy:
+                      that.indexParam && that.indexParam["检查人"]
+                        ? that.indexParam["检查人"]
+                        : that.username,
+                    time:
+                      that.indexParam && that.indexParam["检查时间"]
+                        ? that.indexParam["检查时间"]
+                        : "",
+                    ch4:
+                      that.indexParam && that.indexParam["CH4%"]
+                        ? that.indexParam["CH4%"]
+                        : "",
+                    co2:
+                      that.indexParam && that.indexParam["CO2%"]
+                        ? that.indexParam["CO2%"]
+                        : "",
+                    co:
+                      that.indexParam && that.indexParam["CO(ppm)"]
+                        ? that.indexParam["CO(ppm)"]
+                        : "",
+                    o2:
+                      that.indexParam && that.indexParam["O2%"]
+                        ? that.indexParam["O2%"]
+                        : "",
+                    jw: that.isSensor == "1" ? "0" : "-",
+                    bxy: "0",
+                    tbrq:
+                      that.indexParam && that.indexParam["检查时间"]
+                        ? that.indexParam["检查时间"].substring(
+                            0,
+                            that.indexParam["检查时间"].indexOf(" ")
+                          )
+                        : "",
+                    temp:
+                      that.indexParam && that.indexParam["温度(℃)"]
+                        ? that.indexParam["温度(℃)"]
+                        : "",
+                  };
+
+                  new Promise((resolve, reject) => {
+                    api
+                      .getGas({
+                        reportTime: that.formState.tbrq,
+                        deviceId: that.deviceId,
+                      })
+                      .then((response) => {
+                        if (response.data.code == 200) {
+                          let data = response.data.result.records;
+                          if (data.length != 0) {
+                            that.saveShowList = data[0];
+                            if (
+                              that.formState.bc == "早班" &&
+                              that.formState.count == "第一次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzEarly1: that.formState.bxy,
+                                ch4Early1: that.formState.ch4,
+                                checkPersonEarly: that.formState.jcy,
+                                co2Early1: that.formState.co2,
+                                coEarly1: that.formState.co,
+                                gwSdzEarly1: that.formState.ch4,
+                                jwSdzEarly1: that.formState.jw,
+                                o2Early1: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeEarly1: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tearly1: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "早班" &&
+                              that.formState.count == "第二次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzEarly2: that.formState.bxy,
+                                ch4Early2: that.formState.ch4,
+                                checkPersonEarly: that.formState.jcy,
+                                co2Early2: that.formState.co2,
+                                coEarly2: that.formState.co,
+                                gwSdzEarly2: that.formState.ch4,
+                                jwSdzEarly2: that.formState.jw,
+                                o2Early2: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeEarly2: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tearly2: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "中班" &&
+                              that.formState.count == "第一次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNoon1: that.formState.bxy,
+                                ch4Noon1: that.formState.ch4,
+                                checkPersonNoon: that.formState.jcy,
+                                co2Noon1: that.formState.co2,
+                                coNoon1: that.formState.co,
+                                gwSdzNoon1: that.formState.ch4,
+                                jwSdzNoon1: that.formState.jw,
+                                o2Noon1: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNoon1: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnoon1: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "中班" &&
+                              that.formState.count == "第二次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNoon2: that.formState.bxy,
+                                ch4Noon2: that.formState.ch4,
+                                checkPersonNoon: that.formState.jcy,
+                                co2Noon2: that.formState.co2,
+                                coNoon2: that.formState.co,
+                                gwSdzNoon2: that.formState.ch4,
+                                jwSdzNoon2: that.formState.jw,
+                                o2Noon2: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNoon2: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnoon2: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "夜班" &&
+                              that.formState.count == "第一次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNight1: that.formState.bxy,
+                                ch4Night1: that.formState.ch4,
+                                checkPersonNight: that.formState.jcy,
+                                co2Night1: that.formState.co2,
+                                coNight1: that.formState.co,
+                                gwSdzNight1: that.formState.ch4,
+                                jwSdzNight1: that.formState.jw,
+                                o2Night1: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNight1: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnight1: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "夜班" &&
+                              that.formState.count == "第二次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNight2: that.formState.bxy,
+                                ch4Night2: that.formState.ch4,
+                                checkPersonNight: that.formState.jcy,
+                                co2Night2: that.formState.co2,
+                                coNight2: that.formState.co,
+                                gwSdzNight2: that.formState.ch4,
+                                jwSdzNight2: that.formState.jw,
+                                o2Night2: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNight2: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnight2: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            }
+                          } else {
+                            that.saveShowList = {};
+                            if (
+                              that.formState.bc == "早班" &&
+                              that.formState.count == "第一次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzEarly1: that.formState.bxy,
+                                ch4Early1: that.formState.ch4,
+                                checkPersonEarly: that.formState.jcy,
+                                co2Early1: that.formState.co2,
+                                coEarly1: that.formState.co,
+                                gwSdzEarly1: that.formState.ch4,
+                                jwSdzEarly1: that.formState.jw,
+                                o2Early1: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeEarly1: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tearly1: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "早班" &&
+                              that.formState.count == "第二次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzEarly2: that.formState.bxy,
+                                ch4Early2: that.formState.ch4,
+                                checkPersonEarly: that.formState.jcy,
+                                co2Early2: that.formState.co2,
+                                coEarly2: that.formState.co,
+                                gwSdzEarly2: that.formState.ch4,
+                                jwSdzEarly2: that.formState.jw,
+                                o2Early2: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeEarly2: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tearly2: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "中班" &&
+                              that.formState.count == "第一次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNoon1: that.formState.bxy,
+                                ch4Noon1: that.formState.ch4,
+                                checkPersonNoon: that.formState.jcy,
+                                co2Noon1: that.formState.co2,
+                                coNoon1: that.formState.co,
+                                gwSdzNoon1: that.formState.ch4,
+                                jwSdzNoon1: that.formState.jw,
+                                o2Noon1: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNoon1: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnoon1: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "中班" &&
+                              that.formState.count == "第二次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNoon2: that.formState.bxy,
+                                ch4Noon2: that.formState.ch4,
+                                checkPersonNoon: that.formState.jcy,
+                                co2Noon2: that.formState.co2,
+                                coNoon2: that.formState.co,
+                                gwSdzNoon2: that.formState.ch4,
+                                jwSdzNoon2: that.formState.jw,
+                                o2Noon2: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNoon2: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnoon2: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "夜班" &&
+                              that.formState.count == "第一次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNight1: that.formState.bxy,
+                                ch4Night1: that.formState.ch4,
+                                checkPersonNight: that.formState.jcy,
+                                co2Night1: that.formState.co2,
+                                coNight1: that.formState.co,
+                                gwSdzNight1: that.formState.ch4,
+                                jwSdzNight1: that.formState.jw,
+                                o2Night1: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNight1: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnight1: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            } else if (
+                              that.formState.bc == "夜班" &&
+                              that.formState.count == "第二次"
+                            ) {
+                              let param = {
+                                taskDetailsId: that.Ids,
+                                deviceId: that.deviceId,
+                                bxySdzNight2: that.formState.bxy,
+                                ch4Night2: that.formState.ch4,
+                                checkPersonNight: that.formState.jcy,
+                                co2Night2: that.formState.co2,
+                                coNight2: that.formState.co,
+                                gwSdzNight2: that.formState.ch4,
+                                jwSdzNight2: that.formState.jw,
+                                o2Night2: that.formState.o2,
+                                strInstallPos: that.formState.jcdd,
+                                timeNight2: that.formState.time,
+                                reportTime: that.formState.tbrq,
+                                tnight2: that.formState.temp,
+                              };
+                              that.paramData = Object.assign(
+                                {},
+                                that.saveShowList,
+                                param
+                              );
+                            }
+                          }
+                        } else {
+                          reject(response);
+                        }
+                      })
+                      .catch((error) => {
+                        console.log("catch===>response", response);
+                        reject(error);
+                      });
+                  });
+                } else {
+                  that.formState = {
+                    id: "",
+                    bc: that.classType || "",
+                    count:
+                      that.checkNum == "1"
+                        ? "第一次"
+                        : that.checkNum == "2"
+                        ? "第二次"
+                        : "",
+                    jcdd: that.deviceName || "",
+                    jcy: that.username,
+                    time: "",
+                    ch4: "",
+                    co2: "",
+                    co: "",
+                    o2: "",
+                    jw: that.isSensor == "1" ? "0" : "-",
+                    bxy: "0",
+                    tbrq: "",
+                    temp: "",
+                  };
+                }
+              }
+            },
+            fail: (error) => {
+              uni.showToast({
+                title: "识别失败!",
+                icon: "none", // 可选图标,'success', 'loading', 'none'
+              });
+              that.loading = false;
+            },
+          });
+        })
+        .catch((err) => {
+          // 压缩失败回调
+          uni.showToast({
+            title: "压缩失败!",
+            icon: "none", // 可选图标,'success', 'loading', 'none'
+          });
+          that.loading = false;
+        });
+    },
     //直接识别
-    // getIdentyfe() {
-    //   let that = this;
-    //   that.loading = true;
-    //   let jcNum = that.deviceName.indexOf("第三次") != -1 ? 3 : null;
-    //   let apiUrlImg = `${configService.apiUrlP}:6008`;
-    //   uni.uploadFile({
-    //     url: `${apiUrlImg}/gasIdentify`,
-    //     filePath: that.saveImg,
-    //     name: "img",
-    //     formData: {
-    //       user: that.username,
-    //       order: that.classType,
-    //       reportdate: that.searchTime,
-    //       checkorder: jcNum ? jcNum : Number(that.checkNum),
-    //       checkpath: that.deviceName,
-    //       imgpath: that.saveImg,
-    //     },
-    //     success: (res) => {
-    //       if (res) {
-    //         uni.showToast({
-    //           title: "识别成功!",
-    //           icon: "none", // 可选图标,'success', 'loading', 'none'
-    //         });
-    //         that.indexList = JSON.parse(res.data).data || [];
-    //         that.isShowAdd = true;
-    //         that.loading = false;
-    //         that.isShowAdd = true;
-    //         that.statusShow = "add";
-    //         that.deviceId = that.deviceID;
-
-    //         if (that.indexList.length != 0) {
-    //           that.indexParam = that.indexList[0];
-    //           that.formState = {
-    //             id: "",
-    //             bc: that.classType || "",
-    //             count:
-    //               that.checkNum == "1"
-    //                 ? "第一次"
-    //                 : that.checkNum == "2"
-    //                   ? "第二次"
-    //                   : "",
-    //             jcdd: that.deviceName || "",
-    //             jcy:
-    //               that.indexParam && that.indexParam["检查人"]
-    //                 ? that.indexParam["检查人"]
-    //                 : that.username,
-    //             time:
-    //               that.indexParam && that.indexParam["检查时间"]
-    //                 ? that.indexParam["检查时间"]
-    //                 : "",
-    //             ch4:
-    //               that.indexParam && that.indexParam["CH4%"]
-    //                 ? that.indexParam["CH4%"]
-    //                 : "",
-    //             co2:
-    //               that.indexParam && that.indexParam["CO2%"]
-    //                 ? that.indexParam["CO2%"]
-    //                 : "",
-    //             co:
-    //               that.indexParam && that.indexParam["CO(ppm)"]
-    //                 ? that.indexParam["CO(ppm)"]
-    //                 : "",
-    //             o2:
-    //               that.indexParam && that.indexParam["O2%"]
-    //                 ? that.indexParam["O2%"]
-    //                 : "",
-    //             jw: that.isSensor == "1" ? "0" : "-",
-    //             bxy: "0",
-    //             tbrq:
-    //               that.indexParam && that.indexParam["检查时间"]
-    //                 ? that.indexParam["检查时间"].substring(
-    //                   0,
-    //                   that.indexParam["检查时间"].indexOf(" ")
-    //                 )
-    //                 : "",
-    //             temp:
-    //               that.indexParam && that.indexParam["温度(℃)"]
-    //                 ? that.indexParam["温度(℃)"]
-    //                 : "",
-    //           };
-
-    //           new Promise((resolve, reject) => {
-    //             api
-    //               .getGas({
-    //                 reportTime: that.formState.tbrq,
-    //                 deviceId: that.deviceId,
-    //               })
-    //               .then((response) => {
-    //                 if (response.data.code == 200) {
-    //                   let data = response.data.result.records;
-    //                   if (data.length != 0) {
-    //                     that.saveShowList = data[0];
-    //                     if (
-    //                       that.formState.bc == "早班" &&
-    //                       that.formState.count == "第一次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzEarly1: that.formState.bxy,
-    //                         ch4Early1: that.formState.ch4,
-    //                         checkPersonEarly: that.formState.jcy,
-    //                         co2Early1: that.formState.co2,
-    //                         coEarly1: that.formState.co,
-    //                         gwSdzEarly1: that.formState.ch4,
-    //                         jwSdzEarly1: that.formState.jw,
-    //                         o2Early1: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeEarly1: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tearly1: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "早班" &&
-    //                       that.formState.count == "第二次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzEarly2: that.formState.bxy,
-    //                         ch4Early2: that.formState.ch4,
-    //                         checkPersonEarly: that.formState.jcy,
-    //                         co2Early2: that.formState.co2,
-    //                         coEarly2: that.formState.co,
-    //                         gwSdzEarly2: that.formState.ch4,
-    //                         jwSdzEarly2: that.formState.jw,
-    //                         o2Early2: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeEarly2: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tearly2: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "中班" &&
-    //                       that.formState.count == "第一次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNoon1: that.formState.bxy,
-    //                         ch4Noon1: that.formState.ch4,
-    //                         checkPersonNoon: that.formState.jcy,
-    //                         co2Noon1: that.formState.co2,
-    //                         coNoon1: that.formState.co,
-    //                         gwSdzNoon1: that.formState.ch4,
-    //                         jwSdzNoon1: that.formState.jw,
-    //                         o2Noon1: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNoon1: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnoon1: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "中班" &&
-    //                       that.formState.count == "第二次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNoon2: that.formState.bxy,
-    //                         ch4Noon2: that.formState.ch4,
-    //                         checkPersonNoon: that.formState.jcy,
-    //                         co2Noon2: that.formState.co2,
-    //                         coNoon2: that.formState.co,
-    //                         gwSdzNoon2: that.formState.ch4,
-    //                         jwSdzNoon2: that.formState.jw,
-    //                         o2Noon2: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNoon2: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnoon2: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "夜班" &&
-    //                       that.formState.count == "第一次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNight1: that.formState.bxy,
-    //                         ch4Night1: that.formState.ch4,
-    //                         checkPersonNight: that.formState.jcy,
-    //                         co2Night1: that.formState.co2,
-    //                         coNight1: that.formState.co,
-    //                         gwSdzNight1: that.formState.ch4,
-    //                         jwSdzNight1: that.formState.jw,
-    //                         o2Night1: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNight1: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnight1: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "夜班" &&
-    //                       that.formState.count == "第二次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNight2: that.formState.bxy,
-    //                         ch4Night2: that.formState.ch4,
-    //                         checkPersonNight: that.formState.jcy,
-    //                         co2Night2: that.formState.co2,
-    //                         coNight2: that.formState.co,
-    //                         gwSdzNight2: that.formState.ch4,
-    //                         jwSdzNight2: that.formState.jw,
-    //                         o2Night2: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNight2: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnight2: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     }
-    //                   } else {
-    //                     that.saveShowList = {};
-    //                     if (
-    //                       that.formState.bc == "早班" &&
-    //                       that.formState.count == "第一次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzEarly1: that.formState.bxy,
-    //                         ch4Early1: that.formState.ch4,
-    //                         checkPersonEarly: that.formState.jcy,
-    //                         co2Early1: that.formState.co2,
-    //                         coEarly1: that.formState.co,
-    //                         gwSdzEarly1: that.formState.ch4,
-    //                         jwSdzEarly1: that.formState.jw,
-    //                         o2Early1: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeEarly1: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tearly1: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "早班" &&
-    //                       that.formState.count == "第二次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzEarly2: that.formState.bxy,
-    //                         ch4Early2: that.formState.ch4,
-    //                         checkPersonEarly: that.formState.jcy,
-    //                         co2Early2: that.formState.co2,
-    //                         coEarly2: that.formState.co,
-    //                         gwSdzEarly2: that.formState.ch4,
-    //                         jwSdzEarly2: that.formState.jw,
-    //                         o2Early2: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeEarly2: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tearly2: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "中班" &&
-    //                       that.formState.count == "第一次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNoon1: that.formState.bxy,
-    //                         ch4Noon1: that.formState.ch4,
-    //                         checkPersonNoon: that.formState.jcy,
-    //                         co2Noon1: that.formState.co2,
-    //                         coNoon1: that.formState.co,
-    //                         gwSdzNoon1: that.formState.ch4,
-    //                         jwSdzNoon1: that.formState.jw,
-    //                         o2Noon1: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNoon1: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnoon1: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "中班" &&
-    //                       that.formState.count == "第二次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNoon2: that.formState.bxy,
-    //                         ch4Noon2: that.formState.ch4,
-    //                         checkPersonNoon: that.formState.jcy,
-    //                         co2Noon2: that.formState.co2,
-    //                         coNoon2: that.formState.co,
-    //                         gwSdzNoon2: that.formState.ch4,
-    //                         jwSdzNoon2: that.formState.jw,
-    //                         o2Noon2: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNoon2: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnoon2: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "夜班" &&
-    //                       that.formState.count == "第一次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNight1: that.formState.bxy,
-    //                         ch4Night1: that.formState.ch4,
-    //                         checkPersonNight: that.formState.jcy,
-    //                         co2Night1: that.formState.co2,
-    //                         coNight1: that.formState.co,
-    //                         gwSdzNight1: that.formState.ch4,
-    //                         jwSdzNight1: that.formState.jw,
-    //                         o2Night1: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNight1: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnight1: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     } else if (
-    //                       that.formState.bc == "夜班" &&
-    //                       that.formState.count == "第二次"
-    //                     ) {
-    //                       let param = {
-    //                         taskDetailsId: that.Ids,
-    //                         deviceId: that.deviceId,
-    //                         bxySdzNight2: that.formState.bxy,
-    //                         ch4Night2: that.formState.ch4,
-    //                         checkPersonNight: that.formState.jcy,
-    //                         co2Night2: that.formState.co2,
-    //                         coNight2: that.formState.co,
-    //                         gwSdzNight2: that.formState.ch4,
-    //                         jwSdzNight2: that.formState.jw,
-    //                         o2Night2: that.formState.o2,
-    //                         strInstallPos: that.formState.jcdd,
-    //                         timeNight2: that.formState.time,
-    //                         reportTime: that.formState.tbrq,
-    //                         tnight2: that.formState.temp,
-    //                       };
-    //                       that.paramData = Object.assign(
-    //                         {},
-    //                         that.saveShowList,
-    //                         param
-    //                       );
-    //                     }
-    //                   }
-    //                 } else {
-    //                   reject(response);
-    //                 }
-    //               })
-    //               .catch((error) => {
-    //                 console.log("catch===>response", response);
-    //                 reject(error);
-    //               });
-    //           });
-    //         } else {
-    //           that.formState = {
-    //             id: "",
-    //             bc: that.classType || "",
-    //             count:
-    //               that.checkNum == "1"
-    //                 ? "第一次"
-    //                 : that.checkNum == "2"
-    //                   ? "第二次"
-    //                   : "",
-    //             jcdd: that.deviceName || "",
-    //             jcy: that.username,
-    //             time: "",
-    //             ch4: "",
-    //             co2: "",
-    //             co: "",
-    //             o2: "",
-    //             jw: that.isSensor == "1" ? "0" : "-",
-    //             bxy: "0",
-    //             tbrq: "",
-    //             temp: "",
-    //           };
-    //         }
-    //       }
-    //     },
-    //     fail: (error) => {
-    //       uni.showToast({
-    //         title: "识别失败!",
-    //         icon: "none", // 可选图标,'success', 'loading', 'none'
-    //       });
-    //       that.loading = false;
-    //     },
-    //   });
-    // },
+    getIdentyfe() {
+      let that = this;
+      that.loading = true;
+      let jcNum = that.deviceName.indexOf("第三次") != -1 ? 3 : null;
+      let apiUrlImg = `${configService.apiUrlP}:6008`;
+      uni.uploadFile({
+        url: `${apiUrlImg}/gasIdentify`,
+        filePath: that.saveImg,
+        name: "img",
+        formData: {
+          user: that.username,
+          order: that.classType,
+          reportdate: that.searchTime,
+          checkorder: jcNum ? jcNum : Number(that.checkNum),
+          checkpath: that.deviceName,
+          imgpath: that.saveImg,
+        },
+        success: (res) => {
+          if (res) {
+            uni.showToast({
+              title: "识别成功!",
+              icon: "none", // 可选图标,'success', 'loading', 'none'
+            });
+            that.indexList = JSON.parse(res.data).data || [];
+            that.isShowAdd = true;
+            that.loading = false;
+            that.isShowAdd = true;
+            that.statusShow = "add";
+            that.deviceId = that.deviceID;
+
+            if (that.indexList.length != 0) {
+              that.indexParam = that.indexList[0];
+              that.formState = {
+                id: "",
+                bc: that.classType || "",
+                count:
+                  that.checkNum == "1"
+                    ? "第一次"
+                    : that.checkNum == "2"
+                      ? "第二次"
+                      : "",
+                jcdd: that.deviceName || "",
+                jcy:
+                  that.indexParam && that.indexParam["检查人"]
+                    ? that.indexParam["检查人"]
+                    : that.username,
+                time:
+                  that.indexParam && that.indexParam["检查时间"]
+                    ? that.indexParam["检查时间"]
+                    : "",
+                ch4:
+                  that.indexParam && that.indexParam["CH4%"]
+                    ? that.indexParam["CH4%"]
+                    : "",
+                co2:
+                  that.indexParam && that.indexParam["CO2%"]
+                    ? that.indexParam["CO2%"]
+                    : "",
+                co:
+                  that.indexParam && that.indexParam["CO(ppm)"]
+                    ? that.indexParam["CO(ppm)"]
+                    : "",
+                o2:
+                  that.indexParam && that.indexParam["O2%"]
+                    ? that.indexParam["O2%"]
+                    : "",
+                jw: that.isSensor == "1" ? "0" : "-",
+                bxy: "0",
+                tbrq:
+                  that.indexParam && that.indexParam["检查时间"]
+                    ? that.indexParam["检查时间"].substring(
+                      0,
+                      that.indexParam["检查时间"].indexOf(" ")
+                    )
+                    : "",
+                temp:
+                  that.indexParam && that.indexParam["温度(℃)"]
+                    ? that.indexParam["温度(℃)"]
+                    : "",
+              };
+
+              new Promise((resolve, reject) => {
+                api
+                  .getGas({
+                    reportTime: that.formState.tbrq,
+                    deviceId: that.deviceId,
+                  })
+                  .then((response) => {
+                    if (response.data.code == 200) {
+                      let data = response.data.result.records;
+                      if (data.length != 0) {
+                        that.saveShowList = data[0];
+                        if (
+                          that.formState.bc == "早班" &&
+                          that.formState.count == "第一次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzEarly1: that.formState.bxy,
+                            ch4Early1: that.formState.ch4,
+                            checkPersonEarly: that.formState.jcy,
+                            co2Early1: that.formState.co2,
+                            coEarly1: that.formState.co,
+                            gwSdzEarly1: that.formState.ch4,
+                            jwSdzEarly1: that.formState.jw,
+                            o2Early1: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeEarly1: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tearly1: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "早班" &&
+                          that.formState.count == "第二次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzEarly2: that.formState.bxy,
+                            ch4Early2: that.formState.ch4,
+                            checkPersonEarly: that.formState.jcy,
+                            co2Early2: that.formState.co2,
+                            coEarly2: that.formState.co,
+                            gwSdzEarly2: that.formState.ch4,
+                            jwSdzEarly2: that.formState.jw,
+                            o2Early2: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeEarly2: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tearly2: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "中班" &&
+                          that.formState.count == "第一次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNoon1: that.formState.bxy,
+                            ch4Noon1: that.formState.ch4,
+                            checkPersonNoon: that.formState.jcy,
+                            co2Noon1: that.formState.co2,
+                            coNoon1: that.formState.co,
+                            gwSdzNoon1: that.formState.ch4,
+                            jwSdzNoon1: that.formState.jw,
+                            o2Noon1: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNoon1: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnoon1: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "中班" &&
+                          that.formState.count == "第二次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNoon2: that.formState.bxy,
+                            ch4Noon2: that.formState.ch4,
+                            checkPersonNoon: that.formState.jcy,
+                            co2Noon2: that.formState.co2,
+                            coNoon2: that.formState.co,
+                            gwSdzNoon2: that.formState.ch4,
+                            jwSdzNoon2: that.formState.jw,
+                            o2Noon2: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNoon2: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnoon2: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "夜班" &&
+                          that.formState.count == "第一次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNight1: that.formState.bxy,
+                            ch4Night1: that.formState.ch4,
+                            checkPersonNight: that.formState.jcy,
+                            co2Night1: that.formState.co2,
+                            coNight1: that.formState.co,
+                            gwSdzNight1: that.formState.ch4,
+                            jwSdzNight1: that.formState.jw,
+                            o2Night1: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNight1: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnight1: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "夜班" &&
+                          that.formState.count == "第二次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNight2: that.formState.bxy,
+                            ch4Night2: that.formState.ch4,
+                            checkPersonNight: that.formState.jcy,
+                            co2Night2: that.formState.co2,
+                            coNight2: that.formState.co,
+                            gwSdzNight2: that.formState.ch4,
+                            jwSdzNight2: that.formState.jw,
+                            o2Night2: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNight2: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnight2: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        }
+                      } else {
+                        that.saveShowList = {};
+                        if (
+                          that.formState.bc == "早班" &&
+                          that.formState.count == "第一次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzEarly1: that.formState.bxy,
+                            ch4Early1: that.formState.ch4,
+                            checkPersonEarly: that.formState.jcy,
+                            co2Early1: that.formState.co2,
+                            coEarly1: that.formState.co,
+                            gwSdzEarly1: that.formState.ch4,
+                            jwSdzEarly1: that.formState.jw,
+                            o2Early1: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeEarly1: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tearly1: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "早班" &&
+                          that.formState.count == "第二次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzEarly2: that.formState.bxy,
+                            ch4Early2: that.formState.ch4,
+                            checkPersonEarly: that.formState.jcy,
+                            co2Early2: that.formState.co2,
+                            coEarly2: that.formState.co,
+                            gwSdzEarly2: that.formState.ch4,
+                            jwSdzEarly2: that.formState.jw,
+                            o2Early2: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeEarly2: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tearly2: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "中班" &&
+                          that.formState.count == "第一次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNoon1: that.formState.bxy,
+                            ch4Noon1: that.formState.ch4,
+                            checkPersonNoon: that.formState.jcy,
+                            co2Noon1: that.formState.co2,
+                            coNoon1: that.formState.co,
+                            gwSdzNoon1: that.formState.ch4,
+                            jwSdzNoon1: that.formState.jw,
+                            o2Noon1: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNoon1: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnoon1: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "中班" &&
+                          that.formState.count == "第二次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNoon2: that.formState.bxy,
+                            ch4Noon2: that.formState.ch4,
+                            checkPersonNoon: that.formState.jcy,
+                            co2Noon2: that.formState.co2,
+                            coNoon2: that.formState.co,
+                            gwSdzNoon2: that.formState.ch4,
+                            jwSdzNoon2: that.formState.jw,
+                            o2Noon2: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNoon2: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnoon2: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "夜班" &&
+                          that.formState.count == "第一次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNight1: that.formState.bxy,
+                            ch4Night1: that.formState.ch4,
+                            checkPersonNight: that.formState.jcy,
+                            co2Night1: that.formState.co2,
+                            coNight1: that.formState.co,
+                            gwSdzNight1: that.formState.ch4,
+                            jwSdzNight1: that.formState.jw,
+                            o2Night1: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNight1: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnight1: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        } else if (
+                          that.formState.bc == "夜班" &&
+                          that.formState.count == "第二次"
+                        ) {
+                          let param = {
+                            taskDetailsId: that.Ids,
+                            deviceId: that.deviceId,
+                            bxySdzNight2: that.formState.bxy,
+                            ch4Night2: that.formState.ch4,
+                            checkPersonNight: that.formState.jcy,
+                            co2Night2: that.formState.co2,
+                            coNight2: that.formState.co,
+                            gwSdzNight2: that.formState.ch4,
+                            jwSdzNight2: that.formState.jw,
+                            o2Night2: that.formState.o2,
+                            strInstallPos: that.formState.jcdd,
+                            timeNight2: that.formState.time,
+                            reportTime: that.formState.tbrq,
+                            tnight2: that.formState.temp,
+                          };
+                          that.paramData = Object.assign(
+                            {},
+                            that.saveShowList,
+                            param
+                          );
+                        }
+                      }
+                    } else {
+                      reject(response);
+                    }
+                  })
+                  .catch((error) => {
+                    console.log("catch===>response", response);
+                    reject(error);
+                  });
+              });
+            } else {
+              that.formState = {
+                id: "",
+                bc: that.classType || "",
+                count:
+                  that.checkNum == "1"
+                    ? "第一次"
+                    : that.checkNum == "2"
+                      ? "第二次"
+                      : "",
+                jcdd: that.deviceName || "",
+                jcy: that.username,
+                time: "",
+                ch4: "",
+                co2: "",
+                co: "",
+                o2: "",
+                jw: that.isSensor == "1" ? "0" : "-",
+                bxy: "0",
+                tbrq: "",
+                temp: "",
+              };
+            }
+          }
+        },
+        fail: (error) => {
+          uni.showToast({
+            title: "识别失败!",
+            icon: "none", // 可选图标,'success', 'loading', 'none'
+          });
+          that.loading = false;
+        },
+      });
+    },
 
     //获取图片识别数据
-    // getGasIdentify() {
-    //   let that = this;
-    //   if (that.imageSrc) {
-    //     that.getScale();
-    //   } else if (that.saveImg) {
-    //     that.getIdentyfe();
-    //   } else {
-    //     uni.showToast({
-    //       title: "请选择上传图片!",
-    //       icon: "none", // 可选图标,'success', 'loading', 'none'
-    //     });
-    //   }
-    // },
-    // // 选择图片的方法
-    // chooseImage() {
-    //     uni.chooseImage({
-    //         count: 1, // 默认9,设置图片的最大选择数
-    //         sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有
-    //         sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机,默认二者都有
-    //         success: (res) => {
-    //             console.log(res, 'res===')
-    //             // 获取选中的图片路径,这里我们只取第一张图进行预览
-    //             this.imageSrc = res.tempFilePaths[0];
-    //             this.tempFilePaths = res.tempFilePaths
-    //             this.imageSrcList = res.tempFiles
-    //         },
-    //         fail: (err) => {
-    //             console.error('选择图片失败:', err);
-    //         }
-    //     });
-    // },
+    getGasIdentify() {
+      let that = this;
+      if (that.imageSrc) {
+        that.getScale();
+      } else if (that.saveImg) {
+        that.getIdentyfe();
+      } else {
+        uni.showToast({
+          title: "请选择上传图片!",
+          icon: "none", // 可选图标,'success', 'loading', 'none'
+        });
+      }
+    },
 
     //删除
     delSb() {

+ 1 - 1
pages/gasreport/components/taskBoard.vue

@@ -53,7 +53,7 @@ export default {
             showCalendar: false,//控制日期选型下拉开启
             // timeRan: Number(new Date()),
             minDate: moment().subtract(30, 'days').format('YYYY-MM-DD'),
-            // minDate: moment().subtract(125, 'days').format('YYYY-MM-DD'),
+            // minDate: moment().subtract(160, 'days').format('YYYY-MM-DD'),
             maxDate:moment().add(30, 'days').format('YYYY-MM-DD'),
             isShow: true,
             loadComponent: '',

+ 34 - 41
pages/ipConfig/ipConfig.vue

@@ -1,27 +1,15 @@
   <template>
-  <view class="zai-box">
-    <scroll-view scroll-y class="page">
-      <view class="IPSet">
-        <span class="text-style"
-          ><u-button
-            :plain="true"
-            color="#18a5ff"
-            size="small"
-            :text="IPSet ? IPSet : '选择IP地址'"
-            @tap="changeIP()"
-          ></u-button
-        ></span>
-        <u-picker
-          :show="ipShow"
-          :columns="IpConfig"
-          @cancel="ipShow = false"
-          @confirm="selectIpAddr"
-          keyName="label"
-        ></u-picker>
-      </view>
-    </scroll-view>
-  </view>
-</template>
+    <view class="zai-box">
+      <scroll-view scroll-y class="page">
+        <view class="IPSet">
+          <span class="text-style"><u-button :plain="true" color="#18a5ff" size="small" :text="IPSet ? IPSet : '选择IP地址'"
+              @tap="changeIP()"></u-button></span>
+          <u-picker :show="ipShow" :columns="IpConfig" @cancel="ipShow = false" @confirm="selectIpAddr"
+            keyName="label"></u-picker>
+        </view>
+      </scroll-view>
+    </view>
+  </template>
 
 <script>
 import configService from "@/common/service/config.service.js";
@@ -33,23 +21,24 @@ export default {
       IPSet: "",
       IpConfig: [
         [
-            { label: "准东二矿", value: "http://172.19.7.101:9999" },
-          { label: "大海则煤矿", value: "http://172.16.53.16:9999" },
-          { label: "大柳塔井", value: "http://10.248.135.10:9999" },
-          { label: "活鸡兔井", value: "http://10.248.135.121:9999" },
-          { label: "寸草塔二矿", value: "http://10.246.63.5:9999" },
-          { label: "乌兰木伦", value: "http://10.246.183.35:9999" },
-          { label: "哈拉沟煤矿", value: "http://10.248.223.12:9999" },
-          { label: "布尔台", value: "http://10.246.95.4:9999" },
-          { label: "上湾", value: "http://10.246.167.205:9999" },
-          { label: "锦界", value: "http://10.248.151.42:9999" },
-          { label: "补连塔", value: "http://10.246.175.16:9999" },
-          { label: "寸草塔", value: "http://10.246.23.171:9999" },
-          { label: "柳塔", value: "http://10.246.87.121:9999" },
-          { label: "石圪台", value: "http://10.246.191.13:9999" },
-          { label: "榆家梁", value: "http://10.248.143.211:9999" },
-          { label: "开发", value: "http://182.92.126.35:9999" },
-          { label: "测试", value: "http://182.92.126.35:9998" },
+          { label: "准东二矿", value: "http://172.19.7.101:9999", code: 'zdrk' },
+          { label: "大海则煤矿", value: "http://172.16.53.16:9999", code: 'dhz' },
+          { label: "大柳塔井", value: "http://10.248.135.10:9999", code: 'dlt' },
+          { label: "活鸡兔井", value: "http://10.248.135.121:9999", code: 'hjt' },
+          { label: "寸草塔二矿", value: "http://10.246.63.5:9999", code: 'cctr' },
+          { label: "乌兰木伦", value: "http://10.246.183.35:9999", code: 'wlml' },
+          { label: "哈拉沟煤矿", value: "http://10.248.223.12:9999", code: 'hlg' },
+          { label: "布尔台", value: "http://10.246.95.4:9999", code: 'brt' },
+          { label: "上湾", value: "http://10.246.167.205:9999", code: 'sw' },
+          { label: "锦界", value: "http://10.248.151.42:9999", code: 'jj' },
+          { label: "补连塔", value: "http://10.246.175.16:9999", code: 'blt' },
+          { label: "寸草塔", value: "http://10.246.23.171:9999", code: 'cct' },
+          { label: "柳塔", value: "http://10.246.87.121:9999", code: 'lt' },
+          { label: "石圪台", value: "http://10.246.191.13:9999", code: 'sgt' },
+          { label: "榆家梁", value: "http://10.248.143.211:9999", code: 'yjl' },
+          { label: "开发", value: "http://182.92.126.35:9999", code: 'kf' },
+          { label: "测试", value: "http://182.92.126.35:9998", code: 'cs' },
+          { label: "特拉布拉", value: "http://10.7.0.19:9999", code: 'lblt' },
         ],
       ],
       fromSetting: false, // 是否来自设置页
@@ -66,9 +55,13 @@ export default {
       this.ipShow = false;
       this.ip = e.value[0].value;
       const fullURL = e.value[0].value;
+      console.log(fullURL,'fullURL')
+      const apicode = e.value[0].code
+      console.log(apicode,'9900')
       this.IPSet = e.value[0].label;
       configService.apiUrl = fullURL;
       uni.setStorageSync("selectedIP", true);
+      uni.setStorageSync("apiCode", apicode);
       uni.setStorageSync("apiUrl", fullURL);
       // uni.showModal({
       //   title: "提示",
@@ -84,7 +77,7 @@ export default {
       this.ipShow = true;
     },
   },
-  beforeDestroy() {},
+  beforeDestroy() { },
 };
 </script>
 

+ 24 - 20
pages/login/login.vue

@@ -1,9 +1,10 @@
   <template>
     <view class="zai-box">
-      <u-icon name="setting-fill" color="#2979ff" size="28" @click="setIp" ></u-icon>
+      <u-icon name="setting-fill" color="#2979ff" size="28" @click="setIp"></u-icon>
       <scroll-view scroll-y class="page" v-if="!ipShow">
         <view class="text-center" :style="[{ animation: 'show ' + 0.4 + 's 1' }]">
-          <image src="/static/desk-img/logo.png" mode='aspectFit' class="zai-logo "></image>
+            <image src="/static/desk-img/logo-lblt.png" mode='aspectFit' class="zai-logo "></image>
+          <!-- <image src="/static/desk-img/logo.png" mode='aspectFit' class="zai-logo "></image> -->
           <!-- <image src="/static/dhz-logo.png" mode='aspectFit' class="zai-logo "></image> -->
         </view>
         <view class="text-center" :style="[{ animation: 'show ' + 0.4 + 's 1' }]">
@@ -107,23 +108,24 @@ export default {
       IPSet: "",
       IpConfig: [
         [
-           { label: "准东二矿", value: "http://172.19.7.101:9999" },
-          { label: "大海则煤矿", value: "http://172.16.53.16:9999" },
-          { label: "大柳塔井", value: "http://10.248.135.10:9999" },
-          { label: "活鸡兔井", value: "http://10.248.135.121:9999" },
-          { label: "寸草塔二矿", value: "http://10.246.63.5:9999" },
-          { label: "乌兰木伦", value: "http://10.246.183.35:9999" },
-          { label: "哈拉沟煤矿", value: "http://10.248.223.12:9999" },
-          { label: "布尔台", value: "http://10.246.95.4:9999" },
-          { label: "上湾", value: "http://10.246.167.205:9999" },
-          { label: "锦界", value: "http://10.248.151.42:9999" },
-          { label: "补连塔", value: "http://10.246.175.16:9999" },
-          { label: "寸草塔", value: "http://10.246.23.171:9999" },
-          { label: "柳塔", value: "http://10.246.87.121:9999" },
-          { label: "石圪台", value: "http://10.246.191.13:9999" },
-          { label: "榆家梁", value: "http://10.248.143.211:9999" },
-          { label: "开发", value: "http://182.92.126.35:9999" },
-          { label: "测试", value: "http://182.92.126.35:9998" },
+          { label: "准东二矿", value: "http://172.19.7.101:9999", code: 'zdrk' },
+          { label: "大海则煤矿", value: "http://172.16.53.16:9999", code: 'dhz' },
+          { label: "大柳塔井", value: "http://10.248.135.10:9999", code: 'dlt' },
+          { label: "活鸡兔井", value: "http://10.248.135.121:9999", code: 'hjt' },
+          { label: "寸草塔二矿", value: "http://10.246.63.5:9999", code: 'cctr' },
+          { label: "乌兰木伦", value: "http://10.246.183.35:9999", code: 'wlml' },
+          { label: "哈拉沟煤矿", value: "http://10.248.223.12:9999", code: 'hlg' },
+          { label: "布尔台", value: "http://10.246.95.4:9999", code: 'brt' },
+          { label: "上湾", value: "http://10.246.167.205:9999", code: 'sw' },
+          { label: "锦界", value: "http://10.248.151.42:9999", code: 'jj' },
+          { label: "补连塔", value: "http://10.246.175.16:9999", code: 'blt' },
+          { label: "寸草塔", value: "http://10.246.23.171:9999", code: 'cct' },
+          { label: "柳塔", value: "http://10.246.87.121:9999", code: 'lt' },
+          { label: "石圪台", value: "http://10.246.191.13:9999", code: 'sgt' },
+          { label: "榆家梁", value: "http://10.248.143.211:9999", code: 'yjl' },
+          { label: "开发", value: "http://182.92.126.35:9999", code: 'kf' },
+          { label: "测试", value: "http://182.92.126.35:9998", code: 'cs' },
+          { label: "特拉布拉", value: "http://10.7.0.19:9999", code: 'lblt' },
         ],
       ],
     };
@@ -176,7 +178,7 @@ export default {
       let loginParams = {
         username: this.userName,
         password: this.password,
-        clientId:uni.getStorageSync('push_cid')
+        clientId: uni.getStorageSync('push_cid')
       };
       // 加密
       const loginCipher = getLoginCipher();
@@ -414,8 +416,10 @@ export default {
       this.ipShow1 = false;
       const fullURL = e.value[0].value;
       this.IPSet = e.value[0].label;
+      const apiCode = e.value[0].code
       configService.apiUrl = fullURL;
       uni.setStorageSync("apiUrl", configService.apiUrl);
+      uni.setStorageSync("apiCode", apiCode);
       setTimeout(() => {
         uni.getStorageSync("apiUrl");
       }, 100);

+ 75 - 122
pages/warndata/warndata.vue

@@ -1,13 +1,7 @@
 <template>
   <view class="container">
-    <u-navbar
-      :title="titleName"
-      :bgStatusImage="backPic0"
-      :bgImage="backPic"
-      :safeAreaInsetTop="true"
-      left-icon=""
-      @leftClick="menuShow"
-    >
+    <u-navbar :title="titleName" :bgStatusImage="backPic0" :bgImage="backPic" :safeAreaInsetTop="true" left-icon=""
+      @leftClick="menuShow">
       <view class="u-nav-slot" slot="left" v-if="!isShowDetail">
         <u-icon name="arrow-left" size="20"> </u-icon>
       </view>
@@ -34,28 +28,22 @@
             <view style="margin-top: 10rpx">
               <text class="text-style1">{{ windData.zongjinfeng }}</text>
             </view>
-            <view class="nameStyle" style="margin-top: 10rpx; margin-left: 5px"
-              >总进风量(m³/min)</view
-            >
+            <view class="nameStyle" style="margin-top: 10rpx; margin-left: 5px">总进风量(m³/min)</view>
           </view>
           <view class="datacard demo-layout bg-purple-light">
             <view style="margin-top: 10rpx">
               <text class="text-style1">{{ windData.zonghuifeng }}</text>
             </view>
-            <view class="nameStyle" style="margin-top: 10rpx; margin-left: 5px"
-              >总回风量(m³/min)</view
-            >
+            <view class="nameStyle" style="margin-top: 10rpx; margin-left: 5px">总回风量(m³/min)</view>
           </view>
           <view class="datacard demo-layout bg-purple-light">
             <view style="margin-top: 10rpx">
               <text class="text-style1">{{ xufengliang }}</text>
             </view>
-            <view class="nameStyle" style="margin-top: 10rpx; margin-left: 5px"
-              >总需风量(m³/min)</view
-            >
+            <view class="nameStyle" style="margin-top: 10rpx; margin-left: 5px">总需风量(m³/min)</view>
           </view>
         </view>
-        <view class="flcard" v-if="isShow2">
+        <view class="flcard" v-if="isShow2 && getCode != 'lblt'">
           <view class="typeBar">
             <view class="icon-vent">
               <text class="text-style">火灾监测预警</text>
@@ -63,41 +51,34 @@
             <u-icon @click="toggleIsShow2" name="arrow-up-fill"></u-icon>
           </view>
         </view>
-        <view class="flcard" v-else>
+        <view class="flcard" v-if="!isShow2 && getCode != 'lblt'">
           <view class="typeBar">
             <text class="text-style">火灾监测预警</text>
             <u-icon @click="toggleIsShow2" name="arrow-down-fill"></u-icon>
           </view>
         </view>
-        <view class="flcard" v-show="isShow2" @click="getDetail('fire')">
+        <view class="flcard" v-show="isShow2 && getCode != 'lblt'" @click="getDetail('fire')">
           <view class="firecontainer">
             <view class="title">
               <span class="firetext">内因火灾</span>
             </view>
             <view class="fire-style">
-              <view
-                v-for="(item, index) in internalInfo"
-                :key="index"
-                class="fire-item1"
-                v-if="item && Object.keys(item).length > 0"
-              >
+              <view v-for="(item, index) in internalInfo" :key="index" class="fire-item1"
+                v-if="item && Object.keys(item).length > 0">
                 <view class="firecard">
-                  <text
-                    :class="
-                      item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'
-                    "
-                    >{{ item.value
+                  <text :class="item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'
+                    ">{{ item.value
                     }}{{
                       item.code === "o2val" ||
-                      item.code === "co2val" ||
-                      item.code === "ch4val" ||
-                      item.code === "smokeval"
+                        item.code === "co2val" ||
+                        item.code === "ch4val" ||
+                        item.code === "smokeval"
                         ? "(%)"
                         : item.code === "fmax" ||
                           item.code === "temperature" ||
                           item.code === "fireval"
-                        ? "(℃)"
-                        : "(ppm)"
+                          ? "(℃)"
+                          : "(ppm)"
                     }}
                   </text>
                   <view class="nameStyle" style="margin-top: 10rpx">{{
@@ -112,28 +93,21 @@
               <span class="firetext">外因火灾</span>
             </view>
             <view class="fire-style">
-              <view
-                v-for="(item, index) in externalInfo"
-                :key="index"
-                class="fire-item1"
-              >
+              <view v-for="(item, index) in externalInfo" :key="index" class="fire-item1">
                 <view class="firecard">
-                  <text
-                    :class="
-                      item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'
-                    "
-                    >{{ item.value
+                  <text :class="item.Maxlevel > 0 ? 'red-text-style' : 'text-style1'
+                    ">{{ item.value
                     }}{{
                       item.code === "o2val" ||
-                      item.code === "co2val" ||
-                      item.code === "ch4val" ||
-                      item.code === "smokeval"
+                        item.code === "co2val" ||
+                        item.code === "ch4val" ||
+                        item.code === "smokeval"
                         ? "(%)"
                         : item.code === "fmax" ||
                           item.code === "temperature" ||
                           item.code === "fireval"
-                        ? "(℃)"
-                        : "(ppm)"
+                          ? "(℃)"
+                          : "(ppm)"
                     }}
                   </text>
                   <view class="nameStyle" style="margin-top: 10rpx">{{
@@ -144,7 +118,7 @@
             </view>
           </view>
         </view>
-        <view class="flcard" v-if="isShow3">
+        <view class="flcard" v-if="isShow3 && getCode != 'lblt'">
           <view class="typeBar">
             <view class="icon-vent">
               <text class="text-style">粉尘监测预警</text>
@@ -152,13 +126,13 @@
             <u-icon @click="toggleIsShow3" name="arrow-up-fill"></u-icon>
           </view>
         </view>
-        <view class="flcard" v-else>
+        <view class="flcard" v-if="!isShow3 && getCode != 'lblt'">
           <view class="typeBar">
             <text class="text-style">粉尘监测预警</text>
             <u-icon @click="toggleIsShow3" name="arrow-down-fill"></u-icon>
           </view>
         </view>
-        <view class="flcard" v-show="isShow3" @click="getDetail('dust')">
+        <view class="flcard" v-show="isShow3 && getCode != 'lblt'" @click="getDetail('dust')">
           <view style="display: flex">
             <view class="dustcard">
               <view class="demo-layout bg-purple-light">
@@ -181,7 +155,7 @@
           </view>
         </view>
 
-        <view class="flcard" v-if="isShow4">
+        <view class="flcard" v-if="isShow4 && getCode != 'lblt'">
           <view class="typeBar">
             <view class="icon-vent">
               <text class="text-style">瓦斯监测预警</text>
@@ -189,26 +163,20 @@
             <u-icon @click="toggleIsShow4" name="arrow-up-fill"></u-icon>
           </view>
         </view>
-        <view class="flcard" v-else>
+        <view class="flcard" v-if="!isShow4 && getCode != 'lblt'">
           <view class="typeBar">
             <text class="text-style">瓦斯监测预警</text>
             <u-icon @click="toggleIsShow4" name="arrow-down-fill"></u-icon>
           </view>
         </view>
-        <view class="flcard" v-show="isShow4" @click="getDetail('gas')">
+        <view class="flcard" v-show="isShow4 && getCode != 'lblt'" @click="getDetail('gas')">
           <view class="firecontainer">
             <view class="title">
-              <span class="firetext" v-if="gasDevice.length > 0"
-                >安全监测系统监测点</span
-              >
+              <span class="firetext" v-if="gasDevice.length > 0">安全监测系统监测点</span>
             </view>
           </view>
           <view class="safe-container">
-            <view
-              class="safecard"
-              v-for="(item, index) in gasDevice"
-              :key="index"
-            >
+            <view class="safecard" v-for="(item, index) in gasDevice" :key="index">
               <view class="left" style="margin-top: 20rpx; float: left">
                 <text class="text-style1">{{ item.gasNumber }}</text>
                 <view class="nameStyle" style="margin: 10rpx">{{
@@ -220,16 +188,10 @@
           </view>
           <view class="firecontainer">
             <view class="title">
-              <span class="firetext" v-if="gasDevice.length > 0"
-                >瓦斯抽采系统监测点</span
-              >
+              <span class="firetext" v-if="gasDevice.length > 0">瓦斯抽采系统监测点</span>
             </view>
             <view class="gascontainer">
-              <view
-                class="gascard"
-                v-for="(item, index) in gasDevice"
-                :key="index"
-              >
+              <view class="gascard" v-for="(item, index) in gasDevice" :key="index">
                 <view class="left" style="margin-top: 20rpx; float: left">
                   <text class="text-style1">{{ item.pumpNumber }}</text>
                   <view class="nameStyle" style="margin: 10rpx">{{
@@ -255,21 +217,10 @@
             <u-icon @click="toggleIsShow5" name="arrow-down-fill"></u-icon>
           </view>
         </view>
-        <view
-          class="flcard demo-layout bg-purple-light"
-          v-show="isShow5"
-          @click="getDetail('device')"
-        >
+        <view class="flcard demo-layout bg-purple-light" v-show="isShow5" @click="getDetail('device')">
           <view class="deviceCard">
-            <view
-              class="item-container"
-              v-for="(item, index) in devicekindData"
-              :key="index"
-            >
-              <view
-                class="item"
-                :style="{ backgroundImage: itemBackground(item) }"
-              >
+            <view class="item-container" v-for="(item, index) in devicekindData" :key="index">
+              <view class="item" :style="{ backgroundImage: itemBackground(item) }">
                 <view class="deviceItem">
                   <text class="nameStyle" style="margin-right: 10px">{{
                     item.name
@@ -352,10 +303,10 @@ export default {
         yellow: "一般风险",
       },
       isShow1: true,
-      isShow2: true,
+      isShow2: false,
       isShow3: false,
       isShow4: false,
-      isShow5: false,
+      isShow5: true,
       Type: "", // 当前点击的类型
     };
   },
@@ -494,6 +445,9 @@ export default {
         return `url('/static/warndata/${imageName}')`;
       };
     },
+    getCode() {
+      return uni.getStorageSync("apiCode");
+    }
   },
 };
 </script>
@@ -503,6 +457,7 @@ export default {
   color: #7484a4;
   font-size: 15px;
 }
+
 .container {
   display: flex;
   flex-direction: column;
@@ -536,30 +491,28 @@ export default {
   line-height: 27px;
   border-radius: 5px;
   background: url(/static/model/windM3.png),
-    linear-gradient(
-      to right,
+    linear-gradient(to right,
       rgba(55, 135, 254, 0.08),
       rgba(4, 184, 255, 0.08),
-      rgba(60, 161, 237, 0.08)
-    );
+      rgba(60, 161, 237, 0.08));
   background-repeat: no-repeat;
   background-size: 100% 100%;
   background-position: right;
 }
+
 .dustcard {
   width: 47%;
   border-radius: 10px;
   margin: 10px;
   display: flex;
-  background: linear-gradient(
-    to right,
-    rgba(55, 135, 254, 0.08),
-    rgba(4, 184, 255, 0.08),
-    rgba(60, 161, 237, 0.08)
-  );
+  background: linear-gradient(to right,
+      rgba(55, 135, 254, 0.08),
+      rgba(4, 184, 255, 0.08),
+      rgba(60, 161, 237, 0.08));
   flex-direction: row;
   justify-content: space-between;
 }
+
 .dust-right {
   margin-right: 10px;
   width: 60px;
@@ -568,6 +521,7 @@ export default {
   background-repeat: no-repeat;
   background-size: 100% 100%;
 }
+
 .datacard1 {
   width: 100%;
   margin: 2px;
@@ -575,12 +529,10 @@ export default {
   height: 200rpx;
   text-align: center;
   border-radius: 10px;
-  background: linear-gradient(
-    to right,
-    rgba(55, 135, 254, 0.08),
-    rgba(4, 184, 255, 0.08),
-    rgba(60, 161, 237, 0.08)
-  );
+  background: linear-gradient(to right,
+      rgba(55, 135, 254, 0.08),
+      rgba(4, 184, 255, 0.08),
+      rgba(60, 161, 237, 0.08));
 }
 
 .title {
@@ -615,6 +567,7 @@ export default {
   background-size: 100% 100%;
   background-repeat: no-repeat;
 }
+
 .deviceItem {
   position: absolute;
   width: 76%;
@@ -625,6 +578,7 @@ export default {
   align-items: center;
   justify-content: space-around;
 }
+
 .firetext {
   margin: 20px;
 }
@@ -654,11 +608,9 @@ export default {
 .fire-item1 {
   width: 45%;
   margin: 16rpx;
-  background: linear-gradient(
-    to right,
-    rgba(55, 135, 254, 0.08),
-    rgba(4, 184, 255, 0.08)
-  );
+  background: linear-gradient(to right,
+      rgba(55, 135, 254, 0.08),
+      rgba(4, 184, 255, 0.08));
 }
 
 .gascontainer {
@@ -670,15 +622,14 @@ export default {
   border-radius: 10px;
   margin: 10px;
   display: flex;
-  background: linear-gradient(
-    to right,
-    rgba(55, 135, 254, 0.08),
-    rgba(4, 184, 255, 0.08),
-    rgba(60, 161, 237, 0.08)
-  );
+  background: linear-gradient(to right,
+      rgba(55, 135, 254, 0.08),
+      rgba(4, 184, 255, 0.08),
+      rgba(60, 161, 237, 0.08));
   flex-direction: row;
   justify-content: space-between;
 }
+
 .gas-right {
   margin-right: 10px;
   width: 60px;
@@ -687,20 +638,20 @@ export default {
   background-repeat: no-repeat;
   background-size: 100% 100%;
 }
+
 .safecard {
   width: 47%;
   border-radius: 10px;
   margin: 10px;
   display: flex;
-  background: linear-gradient(
-    to right,
-    rgba(55, 135, 254, 0.08),
-    rgba(4, 184, 255, 0.08),
-    rgba(60, 161, 237, 0.08)
-  );
+  background: linear-gradient(to right,
+      rgba(55, 135, 254, 0.08),
+      rgba(4, 184, 255, 0.08),
+      rgba(60, 161, 237, 0.08));
   flex-direction: row;
   justify-content: space-between;
 }
+
 .safe-container {
   display: flex;
   width: 100%;
@@ -709,6 +660,7 @@ export default {
   display: flex;
   justify-content: space-between;
 }
+
 .right {
   margin-right: 10px;
   width: 60px;
@@ -717,6 +669,7 @@ export default {
   background-repeat: no-repeat;
   background-size: 100% 100%;
 }
+
 .icon-style {
   margin-right: 8px;
   width: 13px;

BIN
static/desk-img/logo-lblt.png