Browse Source

瓦斯巡检-图片识别更新

lxh 4 days ago
parent
commit
1ea534adbc

+ 21 - 21
pages/gasreport/components/gasImgIdentify.vue

@@ -12,7 +12,7 @@
                     <image v-if="imageSrc" style="width:300px;" :src="imageSrc" mode="aspectFit" @click="getPreview">
                     </image>
                 </view>
-               
+
                 <view style="width:100%;display: flex;justify-content: space-between;margin: 2px 0px;">
                     <u-button icon="eye" type="primary" size="small" :loading="loading" loadingText="识别中"
                         style="width:49%;margin:0" @click="getGasIdentify">识别</u-button>
@@ -48,7 +48,7 @@
                 </view>
                 <view class="dialog-item" @click="getChangeTime">
                     <text class="dialog-label">检测时间:</text>
-                    <u--input v-model="formState.time" placeholder="请选择检测时间" inputAlign="center"
+                    <u--input readonly v-model="formState.time" placeholder="请选择检测时间" inputAlign="center"
                         :disabled="statusShow == 'edit'" suffixIcon="arrow-right"></u--input>
                     <u-datetime-picker :show="showCalendar" v-model="timeRan" mode="datetime" closeOnClickOverlay
                         @confirm="showCalendar = false" @cancel="showCalendar = false" @change="change"
@@ -56,7 +56,7 @@
                 </view>
                 <view class="dialog-item">
                     <text class="dialog-label">填报日期:</text>
-                    <u--input inputAlign="center" v-model="formState.tbrq" placeholder="请选择填报日期"
+                    <u--input inputAlign="center" readonly v-model="formState.tbrq" placeholder="请选择填报日期"
                         :disabled="statusShow == 'edit'"></u--input>
                 </view>
                 <view class="dialog-item">
@@ -101,8 +101,8 @@
                     <div class="dialog-title">三对照数据</div>
                     <view class="dialog-item">
                         <text class="dialog-label">甲烷传感器:</text>
-                        <u--input inputAlign="center" :disabled="formState.jw=='-'" v-model="formState.jw" placeholder="请输入" clearable
-                            @input="changeInput($event, 'ch4')"></u--input>
+                        <u--input inputAlign="center" :disabled="formState.jw == '-'" v-model="formState.jw"
+                            placeholder="请输入" clearable @input="changeInput($event, 'ch4')"></u--input>
                     </view>
                     <view class="dialog-item">
                         <text class="dialog-label">光瓦测量数据:</text>
@@ -229,7 +229,7 @@ export default {
             showCalendar: false,//控制日期选型下拉开启
             timeRan: Number(new Date()),
             gasList: [],//瓦斯填报列表数据
-            tbTime: moment(new Date()).format('YYYY-MM-DD'),//查询条件-填报时间
+            // tbTime: moment(new Date()).format('YYYY-MM-DD'),//查询条件-填报时间
             // showCalendarTb: false,//控制填报时间组件弹出
             saveShowList: {},
             formState: {
@@ -278,11 +278,11 @@ export default {
             immediate: true,
         }
     },
-    mounted() {},
+    mounted() { },
     methods: {
         //打开选择器选择
         GalleryFile() {
-            let that=this
+            let that = this
             let parameter = {
                 MediaType: 1,//设置选择类型  0: ALL(全部) 1: IMAGE(图片) 2: VIDEO(视频) 3: AUDIO(音频) 不传默认为1图片
                 Single: 2,//设置单选或多选, 1为单选,2为多选,不传默认为多选
@@ -317,20 +317,20 @@ export default {
             }
             RHFselcet.getPicture(parameter, (data) => {
                 let arrData = data.mediaArray
-                let list=[]
+                let list = []
                 // let jsonData = JSON.stringify(arrData)
                 console.log(arrData)
-                that.imageSrc=arrData[0].Pathurl
+                that.imageSrc = arrData[0].Pathurl
                 that.imageSrcList = arrData[0].path
                 list.push(arrData[0].Pathurl)
-                that.tempFilePaths = list 
+                that.tempFilePaths = list
             });
         },
         // hasPermission(param) {
         //     let permission = uni.getStorageSync('btnPermission')
         //     return permission.filter(v => v.action == param).length != 0 ? true : false
         // },
-        
+
         //点击返回上一级
         handlerToggle() {
             this.$emit('getBackAddress')
@@ -348,7 +348,7 @@ export default {
             let that = this
             if (that.imageSrc) {
                 that.loading = true
-                let jcNum=that.deviceName.indexOf('第三次')!=-1 ? 3 : null
+                let jcNum = that.deviceName.indexOf('第三次') != -1 ? 3 : null
                 let apiUrlImg = `${configService.apiUrlP.substring(0, configService.apiUrlP.lastIndexOf(':'))}:6006`
                 uni.uploadFile({
                     url: `${apiUrlImg}/gasIdentify`,
@@ -666,7 +666,7 @@ export default {
         //         }
         //     });
         // },
-    
+
         //删除
         delSb() {
             this.isShowAdd = false
@@ -674,13 +674,13 @@ export default {
             this.indexParam = {}
             this.imageSrc = ''
         },
-      
-      
+
+
         //甲烷三对照选项切换
         changeJw(e) {
             this.formState.jw = e
         },
-     
+
         //检测时间下拉选项切换
         change(e) {
             let that = this
@@ -1307,7 +1307,7 @@ export default {
                 this.isRule14 = false
             }
         },
-     
+
         getAddSave() {
             let that = this
             console.log(that.paramData, 'paramData---------')
@@ -1853,13 +1853,13 @@ export default {
             let that = this
             new Promise((resolve, reject) => {
                 api
-                    .getGas({ reportTime: that.tbTime, deviceId: that.deviceID })
+                    .getGas({ reportTime: that.searchTime, deviceId: that.deviceID })
                     .then((response) => {
                         if (response.data.code == 200) {
                             that.gasList = response.data.result.records
                             if (that.gasList.length != 0) {
                                 that.editData = that.gasList.filter(v => v.deviceId == that.deviceID)[0]
-                               
+
                                 if (that.classType == '夜班' && that.checkNum == '1') {
                                     that.formState = {
                                         id: that.editData.id || '',
@@ -2224,7 +2224,7 @@ export default {
 }
 
 ::v-deep .u-modal__button-group__wrapper {
-    height: 36px;
+    height:36px;
 }
 
 ::v-deep .u-modal__content {

+ 17 - 18
pages/gasreport/components/taskBoard.vue

@@ -1,14 +1,14 @@
 <template>
     <view class="taskBoard">
-        <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true" leftIcon=""
-          > </u-navbar>
-        <u-list :height="708" v-if="isShow">
+        <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true" leftIcon="">
+        </u-navbar>
+        <u-list :height="666" v-if="isShow">
             <u-list-item v-for="(item, index) in indexList" :key="index">
                 <u-cell icon="share" @click="getBorad(item)">
                     <view slot="title" class="u-slot-title">
                         <text class="u-cell-text">
                             <text>{{ item.name }}</text>
-                            <text style="margin-left:10px">{{  item.checkPerson ? `(${item.checkPerson})` : '' }}</text>
+                            <text style="margin-left:10px">{{ item.checkPerson ? `(${item.checkPerson})` : '' }}</text>
                         </text>
                     </view>
                     <view slot="value" class="u-slot-title">
@@ -24,11 +24,10 @@
             :title="titleTime" @confirm="confirmTime" @cancel="cancelTime">
             <view class="dialog-item" @click="getChangeTime">
                 <text class="dialog-label">任务日期:</text>
-                <u--input v-model="searchTime" placeholder="请选择任务日期" inputAlign="center"
+                <u--input  readonly v-model="searchTime" placeholder="请选择任务日期" inputAlign="center"
                     suffixIcon="arrow-right"></u--input>
-                <u-calendar :show="showCalendar" :minDate="minDate" v-model="searchTime" mode="single" closeOnClickOverlay
-                    @confirm="changeTime" @close="closeTime"
-                   ></u-calendar>
+                <u-calendar :show="showCalendar" :minDate="minDate" v-model="searchTime" mode="single"
+                    closeOnClickOverlay @confirm="changeTime" @close="closeTime"></u-calendar>
             </view>
         </u-modal>
         <component v-else :is="loadComponent" :taskId="taskId" @getBackBoard="getBackBoard"></component>
@@ -53,7 +52,7 @@ export default {
             searchTime: '',//检测时间
             showCalendar: false,//控制日期选型下拉开启
             // timeRan: Number(new Date()),
-            minDate:moment().subtract(7, 'days').format('YYYY-MM-DD'),
+            minDate: moment().subtract(7, 'days').format('YYYY-MM-DD'),
             isShow: true,
             loadComponent: '',
             taskId: '',
@@ -78,13 +77,13 @@ export default {
         },
         changeTime(e) {
             let that = this
-            that.searchTime =e[0]
+            that.searchTime = e[0]
             uni.setStorageSync("searchTime", that.searchTime);
-            that.showCalendar=false
+            that.showCalendar = false
         },
-        closeTime(){
-            this.searchTime=''
-            this.showCalendar=false
+        closeTime() {
+            this.searchTime = ''
+            this.showCalendar = false
         },
         //点击返回上一级
         getBackBoard() {
@@ -103,22 +102,22 @@ export default {
             let that = this
             if (that.searchTime) {
                 that.isShow = false
-                that.showTime=false
+                that.showTime = false
                 that.loadComponent = 'taskBoardAddress'
             }
         },
         //选择检测时间-取消
         cancelTime() {
-            let that=this
+            let that = this
             that.isShow = true
-            that.showTime=false
+            that.showTime = false
         },
         //获取任务管理列表数据
         getTimeList() {
             let that = this
             new Promise((resolve, reject) => {
                 api
-                    .teamList({ pageNo: 1, pageSize: 100,teamCode:that.teamCode })
+                    .teamList({ pageNo: 1, pageSize: 100, teamCode: that.teamCode })
                     .then((response) => {
                         if (response.data.code == 200) {
                             that.indexList = response.data.result.records

+ 52 - 12
pages/gasreport/components/taskBoardAddress.vue

@@ -1,12 +1,14 @@
 <template>
     <view class="taskBoardAddress">
         <u-navbar :bgStatusImage="backPic0" :bgImage="backPic" :title="gasTitle" :safeAreaInsetTop="true"
-        leftIcon="arrow-left" @leftClick="handlerToggle"> </u-navbar>
-        <u-list :height="708" v-if="isShow">
+            leftIcon="arrow-left" @leftClick="handlerToggle"> </u-navbar>
+        <u-list :height="666" :scrollTop="topH" 
+            v-if="isShow">
             <u-list-item v-for="(item, index) in indexList" :key="index">
-                <u-cell icon="share" @click="getBoradAddress(item)">
+                <u-cell icon="share" @click="getBoradAddress(item, index)">
                     <view slot="title" class="u-slot-title">
-                        <text class="u-cell-text">{{`${ item.deviceName} (${item.checkNum=='1' ? '第一次' : item.checkNum=='2' ? '第二次' : ''})` }}</text>
+                        <text class="u-cell-text">{{ `${item.deviceName} (${item.checkNum == '1' ? '第一次' :
+                            item.checkNum == '2' ? '第二次' : ''})` }}</text>
                         <!-- <u-tag text="查看" plain size="mini" type="warning">
                         </u-tag> -->
                     </view>
@@ -17,7 +19,8 @@
             </u-list-item>
         </u-list>
         <component :is="toComponent" :Ids="Ids" :checkNum="checkNum" :classType="classType" :isSensor="isSensor"
-            :deviceID="deviceID" :deviceName="deviceName" :checkState="checkState" @getBackAddress="getBackAddress" ></component>
+            :deviceID="deviceID" :deviceName="deviceName" :checkState="checkState" @getBackAddress="getBackAddress">
+        </component>
     </view>
 </template>
 
@@ -37,13 +40,15 @@ export default {
 
     data() {
         return {
+            topH:0,
+            activeIndex:0,
             Ids: '',
             checkNum: '',//巡检次数
             classType: '',
             isSensor: '',
             deviceID: '',
             deviceName: '',
-            checkState:'',
+            checkState: '',
             isShow: true,
             toComponent: '',
             indexList: [],
@@ -62,24 +67,26 @@ export default {
     },
     methods: {
         //点击返回上一级
-        handlerToggle(){
+        handlerToggle() {
             this.$emit('getBackBoard')
         },
-        getBoradAddress(item) {
+      
+        getBoradAddress(item, index) {
             let that = this
+            that.activeIndex=index
             if (item.checkState == '0') {
                 that.isShow = false
                 that.Ids = item.id
                 that.checkNum = item.checkNum
                 that.classType = item.classType_dictText
-                that.checkState=item.checkState
+                that.checkState = item.checkState
                 that.isSensor = item.isSensor
                 that.deviceID = item.deviceId
                 that.deviceName = item.deviceName
                 that.toComponent = 'gasImgIdentify'
             } else {
                 that.isShow = false
-                that.checkState=item.checkState
+                that.checkState = item.checkState
                 that.checkNum = item.checkNum
                 that.deviceID = item.deviceId
                 that.classType = item.classType_dictText
@@ -90,18 +97,51 @@ export default {
         getBackAddress() {
             this.isShow = true
             this.toComponent = ''
+            this.topH = 39*this.activeIndex
             this.taskDetailsLists()
         },
-       
+
         taskDetailsLists() {
             let that = this
             new Promise((resolve, reject) => {
                 api
-                    .taskDetailsList({ pageNo: 1, pageSize: 100, taskId: that.taskId,taskTime:that.searchTime })
+                    .taskDetailsList({ pageNo: 1, pageSize: 100, taskId: that.taskId, taskTime: that.searchTime })
                     .then((response) => {
                         if (response.data.code == 200) {
                             console.log(response, '地点列表---')
                             that.indexList = response.data.result.records || []
+                            // that.indexList = [
+                            //     { deviceName: '测试地址1' },
+                            //     { deviceName: '测试地址2' },
+                            //     { deviceName: '测试地址3' },
+                            //     { deviceName: '测试地址4' },
+                            //     { deviceName: '测试地址5' },
+                            //     { deviceName: '测试地址6' },
+                            //     { deviceName: '测试地址7' },
+                            //     { deviceName: '测试地址8' },
+                            //     { deviceName: '测试地址9' },
+                            //     { deviceName: '测试地址10' },
+                            //     { deviceName: '测试地址11' },
+                            //     { deviceName: '测试地址12' },
+                            //     { deviceName: '测试地址13' },
+                            //     { deviceName: '测试地址14' },
+                            //     { deviceName: '测试地址15' },
+                            //     { deviceName: '测试地址16' },
+                            //     { deviceName: '测试地址17' },
+                            //     { deviceName: '测试地址18' },
+                            //     { deviceName: '测试地址19' },
+                            //     { deviceName: '测试地址20' },
+                            //     { deviceName: '测试地址21' },
+                            //     { deviceName: '测试地址22' },
+                            //     { deviceName: '测试地址23' },
+                            //     { deviceName: '测试地址24' },
+                            //     { deviceName: '测试地址25' },
+                            //     { deviceName: '测试地址26' },
+                            //     { deviceName: '测试地址27' },
+                            //     { deviceName: '测试地址28' },
+                            //     { deviceName: '测试地址29' },
+                            //     { deviceName: '测试地址30' },
+                            // ]
                         } else {
                             reject(response);
                         }

+ 1 - 1
pages/gasreport/gasreport.vue

@@ -133,7 +133,7 @@ export default {
     box-sizing: border-box;
 
     .gas-content {
-        height: 708px;
+        height: 666px;
         margin-top: 85px;
         overflow-y: auto;