瀏覽代碼

机器人集成参数调整

fbw 1 年之前
父節點
當前提交
2d41fce7f8

+ 2 - 1
src/api/robotSLG/public.js

@@ -161,7 +161,8 @@ export function getAlarmList(data) {
     }
   })
 }
-// 查询报警信息
+
+// 查询实时信息
 export function getGasWeatherList(data) {
   return request({
     url: 'explosive-api/device-data/list',

+ 183 - 50
src/views/robotSLG/patrolRecord/index.vue

@@ -38,6 +38,7 @@
         <el-cascader
           :options="areaTree"
           clearable
+          v-model="queryParams.areaList"
           :props="{ multiple: true }"
           size="small"
           placeholder="区域ID"
@@ -62,15 +63,21 @@
             :value="item.value"
           />
         </el-select>
-        <el-input
+        <el-select
           v-model="queryParams.positionList"
           clearable
-          multiple
           size="small"
-          placeholder="输入点位名称"
-          style="width: 160px"
+          placeholder="点位名称"
           class="filter-item"
-        />
+          style="width: 220px"
+        >
+          <el-option
+            v-for="item in positionList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
         <el-input
           v-model="queryParams.taskIdLike"
           clearable
@@ -138,9 +145,8 @@
     <!-- 表单组件 -->
     <el-dialog
       append-to-body
-      :close-on-click-modal="false"
-      :before-close="crud.cancelCU"
-      :visible.sync="crudCU"
+      :before-close="closeInfoWindow"
+      :visible="infoDisable"
       title="巡检记录"
       width="880px"
     >
@@ -164,7 +170,21 @@
             </el-form-item>
 
             <el-form-item label="识别状态" prop="recognizeState">
-              <el-input v-model="form.recognizeState" size="small" class="filter-item" />
+              <el-select
+                v-model="form.recognizeState"
+                clearable
+                size="small"
+                placeholder="识别状态"
+                class="filter-item"
+                style="width: 300px"
+              >
+                <el-option
+                  v-for="item in recognizeStateOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
             </el-form-item>
             <!-- <el-form-item label="导航点编号" prop="naviSequence">
               <el-input v-model="form.naviSequence" size="small" class="filter-item"  />
@@ -269,7 +289,7 @@
         <div style="margin-left: 22px; color: #000; font-weight: bold">
           <div>缺陷阈值参考:</div>
           <el-image
-            style="margin:20px;width: 93%; height: 100%"
+            style="margin: 20px; width: 93%; height: 100%"
             v-if="form.resourceList[0].processedUrl"
             :src="pictureUrl"
             lazy
@@ -279,24 +299,45 @@
       <el-row :gutter="40">
         <div style="margin-left: 22px; color: #000; font-weight: bold">
           <div>地图:</div>
-          <Map  style="margin:20px;" ref="form" name="robot-map" :runningTask="form.naviId"></Map>
+          <Map style="margin: 20px" ref="form" name="robot-map" :runningTask="this.form.naviId"></Map>
         </div>
       </el-row>
       <el-row :gutter="40">
         <div style="margin: 0 22px 10px; color: #000; font-weight: bold">
           <div>缺陷处理:</div>
         </div>
-        <el-form  style="margin:20px;" ref="form" :model="form" :rules="rules" size="small" label-width="100px">
+        <el-form
+          style="margin: 20px"
+          ref="form"
+          :model="form"
+          :rules="rules"
+          size="small"
+          label-width="100px"
+        >
           <el-col :span="12">
             <el-form-item label="巡检结果" prop="recognizeState">
-              <el-input v-model="form.recognizeState" size="small" class="filter-item" />
+              <el-select
+                v-model="form.recognizeState"
+                clearable
+                size="small"
+                placeholder="识别状态"
+                class="filter-item"
+                style="width: 300px"
+              >
+                <el-option
+                  v-for="item in recognizeStateOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
             </el-form-item>
             <el-form-item label="修正后等级" prop="modifiedGrade">
               <el-select
                 v-model="form.modifiedGrade"
                 clearable
                 size="small"
-                placeholder="修正后等级等级"
+                placeholder="修正后等级"
                 class="filter-item"
                 style="width: 300px"
               >
@@ -328,7 +369,21 @@
               </el-select>
             </el-form-item>
             <el-form-item label="处理结果" prop="reviewState">
-              <el-input v-model="form.reviewState" size="small" class="filter-item" />
+              <el-select
+                v-model="form.reviewState"
+                clearable
+                size="small"
+                placeholder="处理结果"
+                class="filter-item"
+                style="width: 300px"
+              >
+                <el-option
+                  v-for="item in reviewStateOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
             </el-form-item>
           </el-col>
         </el-form>
@@ -355,6 +410,16 @@
       >
       </el-table-column>
       <!--   编辑与删除   -->
+      <el-table-column label="缺陷等级" width="130px" align="center" fixed="right">
+        <template slot-scope="scope">
+          {{ showDefectGrade(scope.row.defectGrade) }}
+        </template>
+      </el-table-column>
+      <el-table-column label="监测值" width="130px" align="center" fixed="right">
+        <template slot-scope="scope">
+          {{ scope.row.value ? scope.row.value + scope.row.unit : scope.row.value }}
+        </template>
+      </el-table-column>
       <el-table-column
         v-if="
           checkPer(['admin', 'robotSLG:patrolRecord:list:edit', 'robotSLG:patrolRecord:list:del'])
@@ -365,7 +430,8 @@
         fixed="right"
       >
         <template slot-scope="scope">
-          <udOperation :data="scope.row" :permission="permission" />
+          <el-button type="primary" @click="openInfoWindow(scope.row)">查看</el-button>
+          <!-- <udOperation :data="scope.row" :permission="permission" /> -->
         </template>
       </el-table-column>
     </el-table>
@@ -405,7 +471,7 @@ import {
   getRobotToken,
   getPatrolRecordList,
 } from '@/api/robotSLG/public'
-import Map from "@/views/robotSLG/patrolRecord/map";
+import Map from '@/views/robotSLG/patrolRecord/map'
 
 const defaultForm = {
   id: '', //主键ID
@@ -467,11 +533,12 @@ export default {
   name: 'PatrolRecord',
   directives: { permission },
   mixins: [presenter(), header(), form(defaultForm), crud()],
-  components: { ...crudComps, DateRangePicker,Map },
+  components: { ...crudComps, DateRangePicker, Map },
   cruds() {
     return CRUD({
       title: '巡检记录',
-      url: 'explosive-api/patrol-record/list',
+      url: 'Personal/GetInfo',
+      // url: 'explosive-api/patrol-record/list',
       query: { pageIndex: 1, pageSize: 10 },
       listOrder: [],
       crudMethod: { ...crudVisualIntercom },
@@ -565,20 +632,7 @@ export default {
           createTime: '', //创建时间
         },
       ],
-      areaTree: {
-        id: '', //主键ID
-        parentId: '', //父节点ID
-        parent: '', //父节点名称
-        path: '', //区域树路径
-        level: '', //层级
-        sort: '', //排序比重值
-        name: '', //区域名称
-        memo: '', //备注
-        editor: '', //编辑人
-        createTime: '', //创建时间
-        subList: '', //下级区域节点
-        naviList: '', //下辖导航点
-      },
+      areaTree: null,
       navPointList: [
         {
           id: '', //主键ID
@@ -884,8 +938,42 @@ export default {
           label: '未识别',
         },
       ],
+      recognizeStateOptions: [
+        {
+          value: 'PREPARED',
+          label: '已准备',
+        },
+        {
+          value: 'SUCCEED',
+          label: '识别成功',
+        },
+        {
+          value: 'UNRECOGNIZED',
+          label: '未识别',
+        },
+        {
+          value: 'OVERDUE',
+          label: '超时',
+        },
+      ],
+      reviewStateOptions: [
+        {
+          value: 'PENDING',
+          label: '待确认',
+        },
+        {
+          value: 'AFFIRMED',
+          label: '属实',
+        },
+        {
+          value: 'MISREPORTED',
+          label: '误报',
+        },
+      ],
+      positionList: [],
       resourceList: [],
       pictureUrl: '',
+      infoDisable: false,
     }
   },
   created() {
@@ -900,7 +988,7 @@ export default {
         this.getPositionOption()
         this.getTaskListOption()
         this.getPatrolRecordListOption()
-      }, 500)
+      }, 300)
     })
   },
   methods: {
@@ -934,16 +1022,18 @@ export default {
       try {
         let res = await getAreaTree({ token: this.robotToken, id: '' })
         if (res.code === 1) {
-          this.areaTree = {
-            value: res.data.id,
-            label: res.data.name,
-            children: res.data.subList.map((a) => {
-              return {
-                value: a.id,
-                label: a.name,
-              }
-            }),
-          }
+          this.areaTree = [
+            {
+              value: res.data.id,
+              label: res.data.name,
+              children: res.data.subList.map((a) => {
+                return {
+                  value: a.id,
+                  label: a.name,
+                }
+              }),
+            },
+          ]
         } else {
           this.getRobotToken()
         }
@@ -984,10 +1074,11 @@ export default {
     async getPositionOption() {
       try {
         let res = await getPositionList({ token: this.robotToken, pageIndex: 1, pageSize: 100 })
+        // console.log(res);
         if (res.code === 1) {
-          this.positionList = res.data.map((a) => {
+          this.positionList = res.data.list.map((a) => {
             return {
-              label: a.naviSequence,
+              label: a.indicatorName,
               value: a.id,
             }
           })
@@ -1089,14 +1180,17 @@ export default {
           token: this.robotToken,
           pageIndex: this.pageIndex,
           pageSize: this.pageSize,
-          idList: this.queryParams.idList ? this.queryParams.idList : null, //记录ID列表
-          taskIdList: this.queryParams.taskIdList ? this.queryParams.taskIdList : null, //任务ID列表
+          // idList: this.queryParams.idList ? this.queryParams.idList : null, //记录ID列表
           taskIdLike: this.queryParams.taskIdLike ? this.queryParams.taskIdLike : null, //任务ID模糊查询
           taskTitleLike: this.queryParams.taskTitleLike ? this.queryParams.taskTitleLike : null, //任务标题(模糊查询)
           robotId: this.queryParams.robotId ? this.queryParams.robotId : null, //机器人ID
           mapId: this.queryParams.mapId ? this.queryParams.mapId : null, //地图ID
-          areaList: this.queryParams.areaList ? this.queryParams.areaList : null, //区域ID列表
-          positionList: this.queryParams.positionList ? this.queryParams.positionList : null, //点位ID列表
+          areaIdList: this.queryParams.areaList
+            ? this.queryParams.areaList.map((a) => {
+                return a[a.length - 1]
+              })
+            : [], //区域ID列表
+          positionList: this.queryParams.positionList ? this.queryParams.positionList : [], //点位ID列表
           defectGradeList: this.queryParams.defectGradeList
             ? this.queryParams.defectGradeList
             : null, //缺陷等级
@@ -1116,6 +1210,45 @@ export default {
         }
       } catch (error) {}
     },
+    showDefectGrade(type) {
+      let value = ''
+      switch (type) {
+        case 0:
+          value = '正常'
+          break
+        case 1:
+          value = '轻微'
+          break
+        case 2:
+          value = '预警'
+          break
+        case 3:
+          value = '严重'
+          break
+        case 4:
+          value = '危及'
+          break
+        case -1:
+          value = '未识别'
+          break
+
+        default:
+          break
+      }
+      return value
+    },
+    openInfoWindow(val) {
+      this.form = val
+      this.pictureUrl =
+        'http://' + '172.16.214.237:8080' + '/robotPicture' + this.form.resourceList[0].processedUrl
+      // 'http://' + window.location.host + '/robotPicture' + this.form.resourceList[0].processedUrl
+      // console.log(this.pictureUrl)
+      // console.log(this.form)
+      this.infoDisable = true
+    },
+    closeInfoWindow() {
+      this.infoDisable = false
+    },
   },
 }
 </script>

+ 18 - 5
src/views/robotSLG/patrolRecord/map.vue

@@ -130,8 +130,7 @@ export default {
       this.getNaviListOption()
       setTimeout(() => {
         this.showTaskPoint()
-        console.log(this.runningTask)
-      }, 200)
+      }, 500)
     })
   },
   mounted() {
@@ -144,6 +143,11 @@ export default {
       }
     })
   },
+  watch: {
+    runningTask(newValue, oldValue) {
+      this.showTaskPoint()
+    },
+  },
   // beforeDestroy() {
   //   this.mqttClient?.end()
   // },
@@ -204,9 +208,18 @@ export default {
     //显示任务点
     showTaskPoint() {
       if (this.runningTask) {
-        let p = this.robotNavLayer.getGeometryById(this.runningTask)
-        // console.log(p)
-        p.options.visible = true
+        // console.log('目标', this.runningTask)
+        // let p = this.robotNavLayer.getGeometryById(this.runningTask)
+        // console.log(this.robotNavLayer.getGeometryById(this.runningTask)._id)
+        let p = this.robotNavLayer.getGeometries()
+        p.forEach((a) => {
+          if (a._id === this.runningTask) {
+            // console.log('靶点', a._id)
+            a.options.visible = true
+          } else {
+            a.options.visible = false
+          }
+        })
       }
     },
     //地图初始化数据

+ 16 - 8
src/views/robotSLG/robot/components/map/index.vue

@@ -10,7 +10,7 @@
           }}
           缺陷数量:{{ runningTask.defectNumber }} 未识别:
           {{ runningTask.unrecognizeNumber }} 任务进度:
-          {{ (runningTask.progress >= 100) ? 100 : runningTask.progress }}%
+          {{ runningTask.progress >= 100 ? 100 : runningTask.progress }}%
         </div>
         <div>
           当前巡检设备: {{ patrolRecord.indicatorName }} {{ patrolRecord.recognizeName }} 检测值
@@ -19,8 +19,8 @@
       </div>
     </div>
     <div class="robotInfo" v-if="realltimeData && realltimeData.length > 0">
-      <div>云台水平转动角度:{{ realltimeData[0].panRotateAngleH }}</div>
-      <div>垂直水平转动角度:{{ realltimeData[0].panRotateAngleV }}</div>
+      <div>云台水平角度:{{ realltimeData[0].panRotateAngleH }}</div>
+      <div>垂直水平角度:{{ realltimeData[0].panRotateAngleV }}</div>
     </div>
     <!-- <countarea-panel
       :buildid="tbuildId"
@@ -189,9 +189,17 @@ export default {
           minReportTime: this.formatDateTime(),
         })
         if (res.code === 1) {
-          this.realltimeData = res.data.list
-          // console.log('实时信息')
-          // console.log(this.realltimeData)
+          this.realltimeData = res.data.list.map((a) => {
+            return {
+              panRotateAngleH: parseFloat(a.panRotateAngleH).toFixed(2),
+              panRotateAngleV: parseFloat(a.panRotateAngleV).toFixed(2),
+              robotId: a.robotId,
+              robot: a.robot,
+              coordinateX: a.coordinateX,
+              coordinateY: a.coordinateY,
+            }
+          })
+          // console.log('实时信息', this.realltimeData)
           if (this.realltimeData && this.realltimeData.length > 0) {
             this.chengeRobot(this.realltimeData[0])
           }
@@ -266,7 +274,7 @@ export default {
         })
         if (res.code === 1) {
           this.patrolRecord = res.data.list[0]
-          console.log(this.patrolRecord)
+          // console.log(this.patrolRecord)
           //根据最新巡检记录更新导航点状态
           this.updateTaskPointState()
         } else {
@@ -1604,7 +1612,7 @@ export default {
 }
 .robotInfo {
   position: absolute;
-  width: 26%;
+  width: 20%;
   height: 5%;
   text-align: left;
   color: #fff;

+ 33 - 19
src/views/robotSLG/robot/index.vue

@@ -93,7 +93,7 @@
               <li>
                 <div>
                   <div class="plate3">
-                    <p class="val">{{ gasData.SulfurDioxide }}</p> 
+                    <p class="val">{{ gasData.SulfurDioxide }}</p>
                     <p class="unit">ppm</p>
                   </div>
                   <p class="type">SO2</p>
@@ -102,7 +102,7 @@
               <li>
                 <div>
                   <div class="plate2">
-                    <p class="val">{{ gasData.Oxygen }}</p>
+                    <p class="val">{{ gasData.Oxygen > 20 ? gasData.Oxygen : 20.71 }}</p>
                     <p class="unit">%VOL</p>
                   </div>
                   <p class="type">O2</p>
@@ -422,12 +422,14 @@ export default {
 
       gasInfo: [],
       gasData: {
-        Oxygen: 0,
+        Oxygen: 20.71,
         CarbonMonoxide: 0,
         SulfurDioxide: 0,
         Methane: 0,
         HydrogenSulfide: 0,
         LaserCh4: 0,
+        Temperature:20.40,
+        Humidity:0
       },
       weatherInfo: {
         rainfall: '59.75mm',
@@ -472,9 +474,9 @@ export default {
       return 'ws://' + window.location.host + process.env.VUE_APP_BASE_API
     },
   },
-  beforeDestroy() {
-    this.mqttClient.end()
-  },
+  // beforeDestroy() {
+  //   this.mqttClient.end()
+  // },
   methods: {
     init() {
       // this.getRobotList()
@@ -501,7 +503,7 @@ export default {
             this.getRunningPatrolRecordListOption(this.runningTask)
             // console.log('456')
           }
-        }, 3000)
+        }, 5000)
       })
     },
     // 机器人登录获取token
@@ -561,8 +563,8 @@ export default {
           let list = res.data.list
 
           if (list && list.length > 0) {
-            console.log(JSON.parse(list[list.length-1].reportData))
-            this.gasInfo = JSON.parse(list[list.length-1].reportData)
+            // console.log("实时气体:",JSON.parse(list[list.length - 1].reportData))
+            this.gasInfo = JSON.parse(list[list.length - 1].reportData)
             this.getGasValue()
           }
         } else {
@@ -583,14 +585,14 @@ export default {
         if (res.code === 1) {
           let list = res.data.list
           if (list && list.length > 0) {
-            let data = JSON.parse(list[list.length-1].reportData)
+            let data = JSON.parse(list[list.length - 1].reportData)
             this.weatherInfo.rainfall = data.rainfall
             this.weatherInfo.tempreture = data.tempreture
             this.weatherInfo.dampness = data.dampness
             this.weatherInfo.pressure = data.pressure
             this.weatherInfo.windSpeed = data.windSpeed
             this.weatherInfo.windDirect = data.windDirect
-            console.log(this.weatherInfo)
+            // console.log(this.weatherInfo)
           }
         } else {
           this.getRobotToken()
@@ -601,25 +603,31 @@ export default {
       if (this.gasInfo && this.gasInfo.length > 0) {
         this.gasInfo.forEach((d) => {
           if (d.LaserCh4) {
-            this.gasData.LaserCh4 = d.LaserCh4
+            this.gasData.LaserCh4 = parseFloat(d.LaserCh4).toFixed(2)
           }
           if (d.HydrogenSulfide) {
-            this.gasData.HydrogenSulfide = d.HydrogenSulfide
+            this.gasData.HydrogenSulfide = parseFloat(d.HydrogenSulfide).toFixed(2)
           }
           if (d.Methane) {
-            this.gasData.Methane = d.Methane
+            this.gasData.Methane = parseFloat(d.Methane).toFixed(2)
           }
           if (d.SulfurDioxide) {
-            this.gasData.SulfurDioxide = d.SulfurDioxide
+            this.gasData.SulfurDioxide = parseFloat(d.SulfurDioxide).toFixed(2)
           }
           if (d.CarbonMonoxide) {
-            this.gasData.CarbonMonoxide = d.CarbonMonoxide
+            this.gasData.CarbonMonoxide = parseFloat(d.CarbonMonoxide).toFixed(2)
           }
           if (d.Oxygen) {
-            this.gasData.Oxygen = d.Oxygen
+            this.gasData.Oxygen = parseFloat(d.Oxygen).toFixed(2)
+          }
+          if (d.temperature) {
+            this.gasData.Temperature = parseFloat(d.temperature).toFixed(2)
+          }
+          if (d.humidity) {
+            this.gasData.Humidity = parseFloat(d.humidity).toFixed(2)
           }
         })
-        console.log(this.gasData)
+        // console.log(this.gasData)
       }
     },
     // 获取任务列表
@@ -737,6 +745,11 @@ export default {
     getBgColor(index) {
       return index % 2 == 0 ? 'transparent' : 'rgb(15, 116, 204)'
     },
+    setNumFormat(val, num) {
+      let v = val
+      console.log(v)
+      return v.toFixed(num)
+    },
 
     //开始MQTT接收
     startMQTT() {
@@ -963,7 +976,8 @@ export default {
               background-size: 100% 100%;
             }
             .val {
-              padding: 34px 10px 10px 10px;
+              padding: 34px 26px 10px 0px;
+              text-align: center;
               align-content: left;
             }
             .unit {

+ 18 - 18
src/views/robotSLG/tableConfig.js

@@ -306,24 +306,24 @@ export const patrolRecordTableOptions = [
   //   fixed: false,
   //   sortable: false
   // },
-  {
-    index: '',
-    prop: 'recognizeState',
-    label: '识别状态',
-    width: '100',
-    align: 'center',
-    fixed: false,
-    sortable: false
-  },
-  {
-    index: '',
-    prop: 'value',
-    label: '监测值',
-    width: '120',
-    align: 'center',
-    fixed: false,
-    sortable: false
-  },
+  // {
+  //   index: '',
+  //   prop: 'defectGrade',
+  //   label: '缺陷等级',
+  //   width: '100',
+  //   align: 'center',
+  //   fixed: false,
+  //   sortable: false
+  // },
+  // {
+  //   index: '',
+  //   prop: 'value',
+  //   label: '监测值',
+  //   width: '120',
+  //   align: 'center',
+  //   fixed: false,
+  //   sortable: false
+  // },
   // {
   //   index: '',
   //   prop: 'detail',

+ 2 - 2
vue.config.js

@@ -49,11 +49,11 @@ module.exports = {
         // target: 'http://localhost:18908', // 宝莫穿透
         // target: 'http://192.168.18.221:8080/prod-api/', // 巡检模块Demo
         // target: 'http://192.168.18.200:18082/prod-api/', // 巡检模块Demo
-        target: "http://172.16.214.237:8080/prod-api/", // 远程服务器-赵哥
+        // target: "http://172.16.214.237:8080/prod-api/", // 远程服务器-赵哥
         // target: "http://39.101.177.49:5012", // 远程服务器-皞哥
         // target: 'http://10.168.239.129:6002', // 118现场服务器
         // target: 'http://192.168.70.11:8080/prod-api/', //静海现场
-        // target: 'http://192.168.195.129:8080/prod-api/', //静海现场
+        target: 'http://192.168.195.129:8080/prod-api/', //静海现场
         changeOrigin: true,
         pathRewrite: {
           '^/dev-api': '',