Bladeren bron

Merge branch 'master' of http://182.92.126.35:3000/msx/Vent-App

bobo04052021@163.com 4 dagen geleden
bovenliggende
commit
9df99daee8

+ 1 - 1
.hbuilderx/launch.json

@@ -2,7 +2,7 @@
     "version" : "1.0",
     "configurations" : [
         {
-            "playground" : "standard",
+            "playground" : "custom",
             "type" : "uni-app:app-android"
         },
         {

+ 5 - 0
api/api.js

@@ -264,6 +264,11 @@ const apiService = {
       return configService.staticDomainURL + "/" + avatar;
     }
   },
+  // 获取瓦斯巡检详情图片
+  gasServerImg(params) {
+    const url = buildURL("/gasServerImg", params);
+    return http.post(url);
+  },
 };
 
 export default apiService;

+ 2 - 2
common/service/config.service.js

@@ -4,9 +4,9 @@ if (process.env.NODE_ENV == "development") {
 } else {
   //如果是神东项目  ip地址配置在 login.vue 和 ipConfig.vue中进行配置
   //如果是其他项目  ip地址在本文件中配置 BASE_URL 例如 BASE_URL = "http://182.92.126.35:9999";
-  // BASE_URL = "http://10.35.116.82:9999";//棋盘井东区 
+  // BASE_URL = "http://10.35.116.82:9999";//棋盘井东区
   // BASE_URL = "http://192.168.126.12:9999";//王洼二矿
-  BASE_URL = "http://172.17.3.15:9999";//黑龙煤矿
+  BASE_URL = "http://172.17.3.15:9999"; //黑龙煤矿
 }
 let staticDomainURL = BASE_URL + "/sys/common/static";
 const configService = {

+ 1 - 1
manifest.json

@@ -110,7 +110,7 @@
         }
     },
     "h5" : {
-        "title" : "瓦斯巡检",
+        "title" : "智能通风",
         "domain" : "myhjdc.cn",
         "router" : {
             "mode" : "history"

+ 20 - 17
package.json

@@ -1,18 +1,21 @@
 {
-    "id": "helang-compress",
-    "name": "图片压缩 - 可以自定义压缩尺寸和压缩质量",
-    "displayName": "图片压缩 - 可以自定义压缩尺寸和压缩质量",
-    "version": "1.1.5",
-    "description": "简单实用的图片压缩插件,对大体积图片的压缩率显著。能大大的提高图片上传速度。",
-    "keywords": [
-        "图片",
-        "压缩",
-        "批量压缩"
-    ],
-    "dcloudext": {
-        "category": [
-            "前端组件",
-            "通用组件"
-        ]
-    }
-}
+  "id": "helang-compress",
+  "name": "图片压缩 - 可以自定义压缩尺寸和压缩质量",
+  "displayName": "图片压缩 - 可以自定义压缩尺寸和压缩质量",
+  "version": "1.1.5",
+  "description": "简单实用的图片压缩插件,对大体积图片的压缩率显著。能大大的提高图片上传速度。",
+  "keywords": [
+    "图片",
+    "压缩",
+    "批量压缩"
+  ],
+  "dcloudext": {
+    "category": [
+      "前端组件",
+      "通用组件"
+    ]
+  },
+  "dependencies": {
+    "formdata-polyfill": "^4.0.10"
+  }
+}

+ 10 - 3
pages/gasreport/components/gasFill.vue

@@ -253,6 +253,7 @@ export default {
             zcList: [],//暂存列表
             zcShow: false,//是否显示暂存列表
             isShowSave: false,//控制保存提示弹窗显示隐藏
+            zcParamData: {},//当前所选中暂存数据
         };
     },
     computed: {
@@ -1547,7 +1548,7 @@ export default {
             that.isStatus = 'add'
             that.formState.jcy = this.username
             that.formState.time = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
-            that.formState. tbrq = moment(new Date()).format('YYYY-MM-DD')
+            that.formState.tbrq = moment(new Date()).format('YYYY-MM-DD')
             if (that.nfcShow) {
                 testNfc.listenNFCStatus()
                 testNfc.readData();
@@ -1557,7 +1558,6 @@ export default {
         getAddSave() {
             let that = this
             let param = {}
-
             if (that.formState.bc == '早班' && that.formState.count == '第一次') {
                 param = {
                     // id: that.formState.id,
@@ -1676,6 +1676,8 @@ export default {
                             that.isShowAdd = false
                             that.isDisabled = false
                             that.saveShowList = {}
+                            that.zcList = that.zcList.filter(v => v.cardId != that.zcParamData.cardId) || []
+                            uni.setStorageSync('zcList', that.zcList)
                             that.clearData()
                         } else {
                             reject(response);
@@ -1692,7 +1694,6 @@ export default {
         getEditSave() {
             let that = this
             let param = {}
-
             if (that.formState.bc == '早班' && that.formState.count == '第一次') {
                 param = {
                     id: that.saveShowList.id,
@@ -2136,6 +2137,8 @@ export default {
                             that.isShowAdd = false
                             that.isDisabled = false
                             that.saveShowList = {}
+                            that.zcList = that.zcList.filter(v => v.cardId != that.zcParamData.cardId) || []
+                            uni.setStorageSync('zcList', that.zcList)
                             that.clearData()
                         } else {
                             reject(response);
@@ -2276,6 +2279,7 @@ export default {
             that.zcList.push({ cardId: that.cardIds, bc: that.formState.bc, count: that.formState.count, info: that.formState })
             uni.setStorageSync('zcList', that.zcList)
             that.isShowAdd = false
+            that.clearData()
         },
         //进入暂存列表
         openZc() {
@@ -2290,6 +2294,9 @@ export default {
                 that.zcShow = false
                 that.isShowAdd = true
                 that.formState = Object.assign({}, param.info)
+                that.zcParamData = Object.assign({}, param)
+                // that.zcList = that.zcList.filter(v => v.cardId != that.zcParamData.cardId) || []
+                // uni.setStorageSync('zcList', that.zcList)
                 that.getCardLists(param.cardId)
             } else {
                 that.zcShow = false

+ 127 - 25
pages/gasreport/components/gasImgIdentify.vue

@@ -9,8 +9,8 @@
                     style="margin: 2px 0px;">图片选取</u-button>
                 <!-- 图片预览 -->
                 <view class="imgView">
-                    <image v-if="saveImg || imageSrc" style="width:300px;" :src="imageSrc ? imageSrc : saveImg"
-                        mode="aspectFit" @click="getPreview">
+                    <image v-if="saveImg || imageSrc" style="width:100%" :src="imageSrc ? imageSrc : saveImg"
+                        @click="getPreview">
                     </image>
                 </view>
 
@@ -24,8 +24,22 @@
             </view>
         </view>
 
+        <view v-if="statusShow == 'edit'">
+            <view class="top-gas-list">
+                <u-button type="primary" icon="camera-fill" size="small" @click="GalleryFile"
+                    style="margin: 2px 0px;">图片更新</u-button>
+                <!-- 图片预览 -->
+                <view class="imgView">
+                    <image v-if="imageSrcView" style="width:100%" :src="imageSrcView" @click="getPreview">
+                    </image>
+                </view>
+            </view>
+        </view>
+
         <!-- 新增弹窗 -->
-        <view v-if="isShowAdd" :class="statusShow == 'edit' ? 'bot-gas-list1' : 'bot-gas-list'">
+        <view v-if="isShowAdd"
+            :style="{ padding: imageSrcView ? '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'">
             <view class="top-dialog-area">
                 <view class="dialog-item">
                     <text class="dialog-label">班次:</text>
@@ -54,7 +68,7 @@
                         :disabled="statusShow == 'edit'"></u--input>
                 </view>
                 <view class="dialog-item">
-                    <text class="dialog-label">瓦斯检查工:</text>
+                    <text class="dialog-label">检查工:</text>
                     <u--input inputAlign="center" disabled v-model="formState.jcy" placeholder="请输入"></u--input>
                 </view>
             </view>
@@ -99,13 +113,13 @@
                             @input="changeInput($event, 'jw')"></u--input>
                     </view>
                     <view class="dialog-item">
-                        <text class="dialog-label">光瓦测量数据:</text>
+                        <text class="dialog-label">光瓦:</text>
 
                         <u--input inputAlign="center" type="number" v-model="formState.ch4" placeholder="请输入" clearable
                             @input="changeInput($event, 'ch4')"></u--input>
                     </view>
                     <view class="dialog-item">
-                        <text class="dialog-label">便携仪测量数据:</text>
+                        <text class="dialog-label">便携仪:</text>
                         <u--input inputAlign="center" :placeholderStyle="isRule3 ? 'color:#c0c4cc' : 'color:#ff0000'"
                             :placeholder="isRule3 ? '请输入' : '数据有误'" type="number" v-model="formState.bxy" clearable
                             @blur="getBlurBxy" @input="changeInput($event, 'bxy')"></u--input>
@@ -172,6 +186,7 @@ export default {
 
     data() {
         return {
+            imageSrcView: '',//任务明细查看图片详情
             tempFilePaths: [],
             gasTitle: '数据采集',//标题
             backPic0: "url(/static/topnavbar0.png)",
@@ -183,7 +198,6 @@ export default {
             indexList: [],//识别数据
             indexParam: {},//当前选中识别的数据
             imageSrc: '',
-            imageSrcList: '',
             deviceId: '',
             rangeBc: [
                 { value: '夜班', text: "夜班" },
@@ -250,6 +264,8 @@ export default {
                     this.statusShow = 'edit'
                     this.gasTitle = '数据详情'
                     this.getGasList()
+                    //获取任务详情图片
+                    this.getTaskImg()
                 } else {
                     that.isShowAdd = false
                     that.statusShow = 'add'
@@ -297,13 +313,19 @@ export default {
                 }
             }
             RHFselcet.getPicture(parameter, (data) => {
+                that.tempFilePaths = []
                 let arrData = data.mediaArray
                 console.log(arrData)
-                that.imageSrc = arrData[0].Pathurl
-                that.imageSrcList = arrData[0].path
-                that.tempFilePaths = []
-                that.tempFilePaths.push(that.imageSrc)
-                uni.setStorageSync(that.deviceID, that.imageSrc);
+                if (that.statusShow == 'edit') {
+                    that.imageSrcView = arrData[0].Pathurl
+                    that.tempFilePaths.push(that.imageSrcView)
+                    //更新图片
+                    that.getUpdateImg()
+                } else {
+                    that.imageSrc = arrData[0].Pathurl
+                    that.tempFilePaths.push(that.imageSrc)
+                    uni.setStorageSync(that.deviceID, that.imageSrc);
+                }
             });
         },
         //点击返回上一级
@@ -312,11 +334,19 @@ export default {
         },
         //图片点击预览
         getPreview() {
+            let that = this
             // 预览图片
-            uni.previewImage({
-                urls: this.saveImg ? [this.saveImg] : this.tempFilePaths,
-                current: 0
-            });
+            if (statusShow == 'edit') {
+                uni.previewImage({
+                    urls: this.tempFilePaths,
+                    current: 0
+                });
+            } else {
+                uni.previewImage({
+                    urls: this.saveImg ? [this.saveImg] : this.tempFilePaths,
+                    current: 0
+                });
+            }
         },
         //先压缩后识别
         getScale() {
@@ -329,12 +359,11 @@ export default {
                 quality: 0.85,
                 minSize: 640 //最小压缩尺寸,图片尺寸小于该时值不压缩,非H5平台有效。若需要忽略该设置,可设置为一个极小的值,比如负数。
             }).then((res) => {
-                console.log(res, '9900===')
                 that.imageSrc = res
                 // 压缩成功回调
                 that.loading = true
                 let jcNum = that.deviceName.indexOf('第三次') != -1 ? 3 : null
-                let apiUrlImg = `${configService.apiUrlP.substring(0, configService.apiUrlP.lastIndexOf(':'))}:6006`
+                let apiUrlImg = `${configService.apiUrlP}:6008`
                 uni.uploadFile({
                     url: `${apiUrlImg}/gasIdentify`,
                     filePath: that.imageSrc,
@@ -343,7 +372,9 @@ export default {
                         'user': that.username,
                         'order': that.classType,
                         'reportdate': that.searchTime,
-                        'checkorder': jcNum ? jcNum : Number(that.checkNum)
+                        'checkorder': jcNum ? jcNum : Number(that.checkNum),
+                        'checkpath': that.deviceName,
+                        'imgpath': that.imageSrc,
                     },
 
                     success: (res) => {
@@ -659,7 +690,7 @@ export default {
             let that = this
             that.loading = true
             let jcNum = that.deviceName.indexOf('第三次') != -1 ? 3 : null
-            let apiUrlImg = `${configService.apiUrlP.substring(0, configService.apiUrlP.lastIndexOf(':'))}:6006`
+            let apiUrlImg = `${configService.apiUrlP}:6008`
             uni.uploadFile({
                 url: `${apiUrlImg}/gasIdentify`,
                 filePath: that.saveImg,
@@ -668,7 +699,9 @@ export default {
                     'user': that.username,
                     'order': that.classType,
                     'reportdate': that.searchTime,
-                    'checkorder': jcNum ? jcNum : Number(that.checkNum)
+                    'checkorder': jcNum ? jcNum : Number(that.checkNum),
+                    'checkpath': that.deviceName,
+                    'imgpath': that.saveImg,
                 },
                 success: (res) => {
                     if (res) {
@@ -1683,6 +1716,7 @@ export default {
                             that.indexParam = {}
                             that.imageSrc = ''
                             that.clearData()
+                            uni.removeStorageSync(that.deviceID)
                             that.$emit('clearImg', true)
                             that.$emit('getBackAddress')
                         } else {
@@ -2187,7 +2221,6 @@ export default {
                 } else {
                     that.getEditSave()
                 }
-
             }
         },
 
@@ -2362,6 +2395,71 @@ export default {
 
             });
         },
+        //获取任务详情图片
+        getTaskImg() {
+            let that = this
+            let apiUrlImg = `${configService.apiUrlP}:6008`
+            // let formDataStr = {
+            //     reportdate: '2025-04-10',
+            //     checkpath: '22106工作面',
+            //     order: '中班',
+            //     checkorder: 1,
+            // }
+            let formDataStr = {
+                reportdate: that.searchTime,
+                checkpath: that.deviceName,
+                order: that.classType,
+                checkorder: Number(that.checkNum),
+            }
+            uni.request({
+                url: `${apiUrlImg}/gasServerImg`,
+                method: 'post',
+                responseType: 'arraybuffer', // 确保以二进制形式接收数据
+                data: formDataStr,
+                success: (res) => {
+                    if (res.data instanceof ArrayBuffer) {
+                        let arrayBufferView = new Uint8Array(res.data);
+                        // 你可以在这里对arrayBufferView进行操作
+                        console.log(arrayBufferView);
+                        const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(arrayBufferView)
+                        that.imageSrcView = base64 || '';
+                    }
+                },
+                fail: (err) => {
+                    console.error('请求失败:', err);
+                }
+            });
+        },
+        //更新图片
+        getUpdateImg() {
+            let that = this
+            let apiUrlImg = `${configService.apiUrlP}:6008`
+            uni.uploadFile({
+                url: `${apiUrlImg}/gasImgUpdate`,
+                filePath: that.imageSrcView,
+                name: 'img',
+                formData: {
+                    'order': that.classType,
+                    'checkorder': Number(that.checkNum),
+                    'reportdate': that.searchTime,
+                    'checkpath': that.deviceName,
+                },
+                success: (res) => {
+                    if (res.statusCode == 200) {
+                        uni.showToast({
+                            title: JSON.parse(res.data).res,
+                            icon: 'none' // 可选图标,'success', 'loading', 'none'
+                        });
+                    }
+                },
+                fail: (error) => {
+                    uni.showToast({
+                        title: '图片更新失败!',
+                        icon: 'none' // 可选图标,'success', 'loading', 'none'
+                    });
+                }
+            });
+        }
     },
 
 };
@@ -2463,6 +2561,7 @@ export default {
     }
 
     .top-gas-list {
+        position: fixed;
         display: flex;
         flex-direction: column;
         align-items: center;
@@ -2471,13 +2570,14 @@ export default {
         box-sizing: border-box;
         background-color: #FFF;
         margin-bottom: 2px;
+        z-index: 999;
     }
 
 
 
     .bot-gas-list {
         width: 100%;
-        height: calc(100% - 293px);
+        height: 100%;
         padding: 10px;
         box-sizing: border-box;
         background-color: #FFF;
@@ -2487,7 +2587,7 @@ export default {
     .bot-gas-list1 {
         width: 100%;
         height: 100%;
-        padding: 10px;
+        // padding: 10px;
         margin-bottom: 2px;
         box-sizing: border-box;
         background-color: #FFF;
@@ -2524,7 +2624,8 @@ export default {
         margin-bottom: 10px;
 
         .dialog-label {
-            width: 120px;
+            // width: 120px;
+            width: 84px;
             text-align: right;
         }
     }
@@ -2559,6 +2660,7 @@ export default {
     }
 
     .imgView {
+        width: 100%;
         overflow: hidden;
     }
 

+ 3 - 3
pages/gasreport/components/popupModal.vue

@@ -32,8 +32,8 @@ export default {
     data() {
         return {
             indexList: [
-                { id: 1, label: '瓦斯巡检记录卡管理', },
-                // { id: 1, label: '图片识别', },
+                // { id: 1, label: '瓦斯巡检记录卡管理', },
+                { id: 1, label: '图片识别', },
                 {
                     id: 2, label: '巡检任务面板', children: [
                         { label: '早班', },
@@ -41,7 +41,7 @@ export default {
                         { label: '夜班' },
                     ]
                 },
-                { id: 3, label: '瓦斯巡检填报' },
+                // { id: 3, label: '瓦斯巡检填报' },
             ],
         }
     },

+ 0 - 1
pages/gasreport/components/save-component.vue

@@ -25,7 +25,6 @@
 
 <script>
 import api from "@/api/api";
-
 import moment from 'moment'
 export default {
     name: 'save-component',

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

@@ -52,7 +52,7 @@ export default {
             searchTime: '',//检测时间
             showCalendar: false,//控制日期选型下拉开启
             // timeRan: Number(new Date()),
-            minDate: moment().subtract(60, 'days').format('YYYY-MM-DD'),
+            minDate: moment().subtract(90, 'days').format('YYYY-MM-DD'),
             isShow: true,
             loadComponent: '',
             taskId: '',

+ 26 - 14
pages/gasreport/components/taskBoardAddress.vue

@@ -14,7 +14,7 @@
                     <view slot="value" style="display: flex;align-items: center;">
                         <u-icon :name="item.checkState == '0' ? 'plus' : 'checkmark'" size="16"
                             @click="getBoradAddress(item, index)"></u-icon>
-                        <u-icon style="margin-left:10px" name="photo" size="16" @click="getView(item)"></u-icon>
+                        <u-icon v-if="item.zcShow" style="margin-left:10px" name="photo" size="16"></u-icon>
                     </view>
                 </u-cell>
             </u-list-item>
@@ -64,7 +64,8 @@ export default {
     computed: {
         searchTime: function () {
             return uni.getStorageSync('searchTime')
-        }
+        },
+
     },
     mounted() {
         this.taskDetailsLists()
@@ -75,19 +76,19 @@ export default {
             this.$emit('getBackBoard')
         },
         //暂存图片预览
-        getView(item) {
-            let imgList = []
-            imgList.push(uni.getStorageSync(item.deviceId))
-            // 预览图片
-            uni.previewImage({
-                urls: imgList,
-                current: 0
-            });
-        },
+        // getView(item) {
+        //     let imgList = []
+        //     imgList.push(uni.getStorageSync(item.deviceId))
+        //     // 预览图片
+        //     uni.previewImage({
+        //         urls: imgList,
+        //         current: 0
+        //     });
+        // },
         //清除暂存图片
-        clearImg(data){
-            if(data){
-                this.saveImg=''
+        clearImg(data) {
+            if (data) {
+                this.saveImg = ''
             }
         },
 
@@ -108,6 +109,7 @@ export default {
             } else {
                 that.isShow = false
                 that.checkState = item.checkState
+                that.deviceName = item.deviceName
                 that.checkNum = item.checkNum
                 that.deviceID = item.deviceId
                 that.classType = item.classType_dictText
@@ -132,6 +134,16 @@ export default {
                         if (response.data.code == 200) {
                             console.log(response, '地点列表---')
                             that.indexList = response.data.result.records || []
+                            if (that.indexList.length != 0) {
+                                that.indexList.forEach(el => {
+                                    if (uni.getStorageSync(el.deviceId)) {
+                                        el.zcShow = true
+                                    } else {
+                                        el.zcShow = false
+                                    }
+                                })
+                            }
+                            console.log(that.indexList, '999000=====')
                             // that.indexList = [
                             //     { deviceName: '测试地址1' },
                             //     { deviceName: '测试地址2' },

+ 2 - 2
pages/gasreport/gasreport.vue

@@ -37,9 +37,9 @@ export default {
             backPic: "url(../../static/topnavbar.png)",
             gasTitle: '瓦斯日报',//标题
             showModel: false,//是否打开弹出层
-            loadComponent: 'gasFill',//默认加载组件
+            // loadComponent: 'gasFill',//默认加载组件
             // loadComponent: 'gasImgIdentify',//默认加载组件
-            // loadComponent: 'taskBoard',//默认加载组件
+            loadComponent: 'taskBoard',//默认加载组件
             taskTj: {},
             firstAddress: '',//一次线路
             secondAddress: '',//二次线路

+ 1 - 1
pages/ipConfig/ipConfig.vue

@@ -33,7 +33,7 @@ export default {
       IPSet: "",
       IpConfig: [
         [
-          { label: "大海煤矿", value: "http://172.16.53.16: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" },

+ 3 - 3
pages/login/login.vue

@@ -3,8 +3,8 @@
       <u-icon name="setting-fill" color="#2979ff" size="28" @click="setIp" v-if="configService.apiUrl == ''"></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/dhz-logo.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' }]">
           <!-- <u-link  class="zai-title2 text-shadow " href="http://localhost:8080?ticket=234" >切换单点登录</u-link> -->
@@ -107,7 +107,7 @@ export default {
       IPSet: "",
       IpConfig: [
         [
-          { label: "大海煤矿", value: "http://172.16.53.16: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" },