Переглянути джерело

机器人实时数据页面增加气象和气体实时数据

fbw 1 рік тому
батько
коміт
d077a3dcab

+ 1 - 1
public/js/config.js

@@ -1,7 +1,7 @@
 /**
  * 跳转大屏项目的默认地址
  */
-const VISUAL_PAGE_PATH = `http://${window.location.hostname}:8081/#/stationMap`
+const VISUAL_PAGE_PATH = `http://${window.location.hostname}:8081/#/basePage`
 
 const TOOLS_PAGE_PATH = `http://${window.location.hostname}:8082/#/`
 

+ 0 - 0
src/api/laserPtz/config.js → src/api/leak/laserPtz/config.js


+ 0 - 0
src/api/laserPtz/public.js → src/api/leak/laserPtz/public.js


+ 11 - 0
src/api/robotSLG/public.js

@@ -161,3 +161,14 @@ export function getAlarmList(data) {
     }
   })
 }
+// 查询报警信息
+export function getGasWeatherList(data) {
+  return request({
+    url: 'explosive-api/device-data/list',
+    method: 'post',
+    data,
+    headers:{
+      'token':data.token
+    }
+  })
+}

+ 6 - 3
src/utils/requestRobot.js

@@ -2,6 +2,8 @@ import axios from 'axios'
 import { MessageBox, Message } from 'element-ui'
 import store from '@/store'
 import { getToken } from '@/utils/auth'
+import { getToken as getRobotToken } from '@/api/robotSLG/public'
+
 
 // create an axios instance
 const service = axios.create({
@@ -19,7 +21,8 @@ service.interceptors.request.use(
       // let each request carry token
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation
-      config.headers['token'] = getToken()
+      // config.headers['token'] = getRobotToken(ROBOT).data
+      // config.headers['token'] = getToken()
     }
     return config
   },
@@ -47,11 +50,11 @@ service.interceptors.response.use(
     const res = response.data
     //console.log(response)
     // if the custom code is not 20000 / 1, it is judged as an error.
-    if (res.code !== 20000 && res.code !== 1) {
+    if (res.code !== 1) {
       Message({
         message: res.msg || 'Error',
         type: 'error',
-        duration: 5 * 1000,
+        duration: 20 * 1000,
       })
 
       // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;

+ 1 - 1
src/views/leak/laserPtz/alarm/index.vue

@@ -131,7 +131,7 @@ export default {
   components: { ...crudComps, DateRangePicker },
   cruds() {
     return CRUD({
-      title: '周界报警记录',
+      title: '报警记录',
       url: 'perimeter/alarm/getListJson',
       listOrder: [],
       //crudMethod: { ...crudRailAreaInOutLog },

+ 1 - 1
src/views/leak/tableConfig.js

@@ -51,7 +51,7 @@ export const perimeterAlarmTableOptions = [
   {
     index: '',
     prop: 'perimeterName',
-    label: '周界名称',
+    label: '名称',
     width: '160',
     align: 'center',
     fixed: false,

+ 0 - 496
src/views/robotSLG/area/index.vue

@@ -1,496 +0,0 @@
-<template>
-  <div class="app-container">
-    <!--工具栏-->
-    <div class="head-container">
-      <div v-if="crud.props.searchToggle">
-        <el-input
-          v-model="query.code"
-          clearable
-          size="small"
-          placeholder="输入可视对讲编号"
-          style="width: 160px"
-          class="filter-item"
-          @keyup.enter.native="crud.toQuery"
-        />
-        <el-input
-          v-model="query.name"
-          clearable
-          size="small"
-          placeholder="输入可视对讲名称"
-          style="width: 160px"
-          class="filter-item"
-          @keyup.enter.native="crud.toQuery"
-        />
-        <el-select
-          v-model="query.type"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择类型"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in optionsObj.VisualIntercomType"
-            :key="item.value"
-            :label="item.label"
-            :value="+item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.buildId"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择建筑名称"
-          class="filter-item"
-          style="width: 160px"
-          @change="handleChangeBuildId"
-        >
-          <el-option
-            v-for="item in optionsObj.Build"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.floorNo"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择楼层"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in optionsObj.FloorNo"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.faceRecognition"
-          clearable
-          size="small"
-          placeholder="人脸识别"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in 2"
-            :key="item"
-            :label="item == '1' ? '是' : '否'"
-            :value="item == '1' ? true : false"
-          />
-        </el-select>
-        <el-select
-          v-model="query.enable"
-          clearable
-          size="small"
-          placeholder="启用状态"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in 2"
-            :key="item"
-            :label="item == '1' ? '启用' : '禁用'"
-            :value="item == '1' ? true : false"
-          />
-        </el-select>
-        <rrOperation />
-      </div>
-      <crudOperation :permission="permission" />
-    </div>
-    <!-- 表单组件 -->
-    <el-dialog
-      append-to-body
-      :close-on-click-modal="false"
-      :before-close="crud.cancelCU"
-      :visible.sync="crudCU"
-      :title="crud.status.title"
-      width="1200px"
-    >
-      <el-row :gutter="40">
-        <el-col :span="8">
-          <el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
-            <el-form-item label="编号" prop="code">
-              <el-input v-model="form.code" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="名称" prop="name">
-              <el-input v-model="form.name" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="类型" prop="type">
-              <el-select
-                v-model="form.type"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              >
-                <el-option
-                  v-for="item in optionsObj.VisualIntercomType"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="+item.value"
-                />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="建筑名称" prop="buildId">
-              <el-select
-                v-model="form.buildId"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-                disabled
-              >
-                <el-option
-                  v-for="item in optionsObj.Build"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="楼层" prop="floorNo">
-              <el-input
-                v-model="form.floorNo"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-                disabled
-              />
-            </el-form-item>
-            <el-form-item label="高度" prop="height">
-              <el-input
-                v-model="form.height"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="序列号" prop="sn">
-              <el-input v-model="form.sn" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="MAC地址" prop="mac">
-              <el-input v-model="form.mac" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="ip地址" prop="ip">
-              <el-input v-model="form.ip" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="端口号" prop="port">
-              <el-input v-model="form.port" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="用户名" prop="userName">
-              <el-input
-                v-model="form.userName"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="密码" prop="password">
-              <el-input
-                v-model="form.password"
-                show-password
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="关联摄像头" prop="cameraID">
-              <el-select
-                v-model="form.cameraID"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-                filterable
-                clearable
-              >
-                <el-option
-                  v-for="item in optionsObj.Camera"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="人脸识别" prop="faceRecognition">
-              <el-switch
-                v-model="form.faceRecognition"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                :active-value="true"
-                :inactive-value="false"
-              >
-              </el-switch>
-            </el-form-item>
-            <el-form-item label="备注" prop="remark">
-              <el-input
-                v-model="form.remark"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="启用" prop="enable">
-              <el-switch
-                v-model="form.enable"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                :active-value="true"
-                :inactive-value="false"
-              >
-              </el-switch>
-            </el-form-item>
-          </el-form>
-        </el-col>
-        <el-col :span="16">
-          <relative-map
-            v-if="crudCU"
-            ref="relativeMap"
-            v-model="mapData"
-            drawShow
-            :buildFloor="buildFloor"
-            drawMode="Point"
-          />
-        </el-col>
-      </el-row>
-
-      <div slot="footer" class="dialog-footer">
-        <el-button type="text" @click="crud.cancelCU"> 取消 </el-button>
-        <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">
-          确认
-        </el-button>
-      </div>
-    </el-dialog>
-    <!--表格渲染-->
-    <el-table
-      ref="table"
-      v-loading="crud.loading"
-      :data="crud.data"
-      style="width: 100%"
-      @selection-change="crud.selectionChangeHandler"
-    >
-      <el-table-column type="selection" width="55" />
-      <el-table-column
-        v-for="item in visualIntercomConfigTableOptions"
-        :key="item.prop"
-        :label="item.label"
-        :prop="item.prop"
-        :width="item.width"
-        :align="item.align"
-        :fixed="item.fixed"
-        :sortable="item.sortable"
-      >
-      </el-table-column>
-      <!--   编辑与删除   -->
-      <el-table-column
-        v-if="checkPer(['admin', 'visualintercom:config:edit', 'visualintercom:config:del'])"
-        label="操作"
-        width="130px"
-        align="center"
-        fixed="right"
-      >
-        <template slot-scope="scope">
-          <udOperation :data="scope.row" :permission="permission" />
-        </template>
-      </el-table-column>
-    </el-table>
-    <!--分页组件-->
-    <pagination />
-  </div>
-</template>
-
-<script>
-import permission from '@/directive/permission'
-import crudVisualIntercom from '@/api/visualIntercom/config'
-import { getOptions } from '@/api/visualIntercom/public'
-import CRUD, { presenter, header, form, crud } from '@crud/crud'
-// import { crudOperation, rrOperation, udOperation, pagination } from '@crud'
-import crudComps from '@crud'
-import DateRangePicker from '@/components/DateRangePicker'
-import { visualIntercomConfigTableOptions } from '../tableConfig'
-import { initData } from '@/api/data'
-//import CameraMap from './cameraMap'
-import {
-  isPosNumber,
-  isNegNumber,
-  isNumber,
-  isPosInteger,
-  isNegInteger,
-  isInteger,
-} from '@/utils/validate'
-import RelativeMap from '@/components/RelativeMap'
-
-const defaultForm = {
-  id: '0',
-  code: '', //编号
-  name: '', //名称
-  type: '',
-  buildId: '', //建筑ID
-  floorNo: null, //楼层号
-  location: null, //坐标
-  height: 0, //高度
-  faceRecognition: false,
-  enable: true, //是否显示在GIS
-  sn: '', //序列号
-  mac: '', //mac地址
-  ip: '', //ip地址
-  port: '', //端口号
-  userName: '', //用户名
-  password: '', // 密码
-  cameraID: '', // 绑定摄像头
-  remark: '', //备注
-}
-
-export default {
-  name: 'VisualIntercomConfig',
-  directives: { permission },
-  mixins: [presenter(), header(), form(defaultForm), crud()],
-  components: { ...crudComps, DateRangePicker, RelativeMap },
-  cruds() {
-    return CRUD({
-      title: '可视对讲配置',
-      url: 'visualIntercom/config/getPageListJson',
-      listOrder: [],
-      crudMethod: { ...crudVisualIntercom },
-      optShow: {
-        add: true,
-        edit: true,
-        del: true,
-        reset: true,
-        import: true,
-        export: true,
-      },
-    })
-  },
-  computed: {
-    crudCU() {
-      return this.crud.status.cu > 0
-    },
-    VUE_APP_BASE_API() {
-      return process.env.VUE_APP_BASE_API
-    },
-    VUE_APP_BASE_WS() {
-      return 'ws://' + window.location.host + process.env.VUE_APP_BASE_API
-    },
-  },
-  data() {
-    var chackHeight = (rule, value, callback) => {
-      if (!isPosNumber(value)) return callback(new Error('请输入正确的高度'))
-      return callback()
-    }
-    return {
-      visualIntercomConfigTableOptions,
-      permission: {
-        add: ['admin', 'visualintercom:config:add'],
-        edit: ['admin', 'visualintercom:config:edit'],
-        del: ['admin', 'visualintercom:config:del'],
-      },
-      rules: {
-        code: [{ required: true, message: '请选输入编号', trigger: 'blur' }],
-        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
-        type: [{ required: true, message: '选择类型', trigger: 'blur' }],
-        buildId: [{ required: true, message: '请在地图上画点', trigger: 'blur' }],
-        floorNo: [{ required: true, message: '请在地图上画点', trigger: 'blur' }],
-        height: [{ required: true, validator: chackHeight, trigger: 'blur' }],
-        ip: [{ required: true, message: '请输入IP地址', trigger: 'blur' }],
-        userName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
-      },
-      optionsObj: {
-        Camera: [],
-        Build: [],
-        FloorNo: [],
-        VisualIntercomType: []
-      },
-      mapData: [],
-      buildFloor: {},
-    }
-  },
-  created() {
-    this.getOptions()
-  },
-  methods: {
-    [CRUD.HOOK.beforeToAdd]() {
-      this.mapData = []
-      this.buildFloor = {}
-    },
-    // 打开
-    [CRUD.HOOK.beforeToEdit]() {
-      this.mapData = [
-        {
-          buildId: this.form.buildId,
-          floorNo: this.form.floorNo,
-          geometries: [
-            {
-              type: 'Point',
-              points: [{ x: this.form.location.x, y: this.form.location.y }],
-            },
-          ],
-        },
-      ]
-      this.buildFloor = {
-        buildId: this.form.buildId,
-        floorNo: this.form.floorNo,
-      }
-    },
-    //验证前处理
-    [CRUD.HOOK.beforeValidateCU]() {
-      if (
-        this.mapData &&
-        this.mapData.length > 0 &&
-        this.mapData[0].geometries &&
-        this.mapData[0].geometries.length > 0 &&
-        this.mapData[0].geometries[0].points &&
-        this.mapData[0].geometries[0].points.length > 0
-      ) {
-        this.form.buildId = this.mapData[0].buildId
-        this.form.floorNo = this.mapData[0].floorNo
-        this.form.location = {
-          buildId: this.mapData[0].buildId,
-          floorNo: this.mapData[0].floorNo,
-          x: this.mapData[0].geometries[0].points[0].x,
-          y: this.mapData[0].geometries[0].points[0].y,
-        }
-      } else {
-        this.$message.error('请绘制正确的点')
-        return false
-      }
-    },
-    // 提交前的验证
-    [CRUD.HOOK.afterValidateCU]() {},
-    async handleChangeBuildId(val) {
-      await this.getFloorNoOption(val)
-      this.crud.toQuery()
-    },
-    getOptions() {
-      Object.keys(this.optionsObj).forEach(async (key) => {
-        if (key == 'FloorNo') return
-        try {
-          let res = await getOptions(key)
-          if (res.code === 20000) this.optionsObj[key] = res.data.content
-        } catch (error) {
-          console.log(error)
-        }
-      })
-    },
-    async getFloorNoOption(buildId) {
-      try {
-        let res = await getOptions('FloorNo', { buildId: buildId })
-        if (res.code === 20000) {
-          this.optionsObj.FloorNo = res.data.content
-          this.query.floorNo = null
-        }
-      } catch (error) {}
-    },
-  },
-}
-</script>
-
-<style></style>

+ 0 - 233
src/views/robotSLG/log/index.vue

@@ -1,233 +0,0 @@
-<template>
-  <div class="app-container">
-    <!--工具栏-->
-    <div class="head-container">
-      <div v-if="crud.props.searchToggle">
-        <el-select
-          v-model="query.visualIntercomId"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择可视对讲"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in optionsObj.VisualIntercom"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.majorType"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择主要类型"
-          class="filter-item"
-          style="width: 160px"
-          @change="majorTypeChangeHandle"
-        >
-          <el-option
-            v-for="item in optionsObj.MajorType"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.minorType"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择次要类型"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in optionsObj.MinorType"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-cascader
-          v-model="query.personId"
-          filterable
-          :options="optionsObj.Name"
-          :props="{ checkStrictly: true, emitPath: false }"
-          clearable
-          size="small"
-          placeholder="请选择人员"
-          style="width: 200px"
-          class="filter-item"
-          @change="crud.toQuery"
-        />
-        <el-input
-          v-model="query.content"
-          clearable
-          size="small"
-          placeholder="请输入筛选内容"
-          style="width: 200px"
-          class="filter-item"
-          @keyup.enter.native="crud.toQuery"
-        />
-        <date-range-picker
-          type="datetimerange"
-          v-model="customs.timeRange"
-          class="date-item"
-          style="width: 400px !important"
-          @change="crud.toQuery"
-        />
-        <rrOperation />
-      </div>
-      <crudOperation :permission="permission"></crudOperation>
-    </div>
-    <el-dialog
-      append-to-body
-      :close-on-click-modal="false"
-      :visible.sync="dialogVisible"
-      title="图片预览"
-      width="800px"
-    >
-      <el-image
-        fit="contain"
-        :src="`${VUE_APP_BASE_API}${form.picPath}`"
-        :preview-src-list="[`${VUE_APP_BASE_API}${form.picPath}`]"
-      />
-    </el-dialog>
-    <!--表格渲染-->
-    <el-table
-      ref="table"
-      v-loading="crud.loading"
-      :data="crud.data"
-      style="width: 100%"
-      @selection-change="crud.selectionChangeHandler"
-    >
-      <!-- <el-table-column type="selection" width="55" /> -->
-      <el-table-column
-        v-for="item in visualIntercomLogTableOptions"
-        :key="item.prop"
-        :label="item.label"
-        :prop="item.prop"
-        :width="item.width"
-        :align="item.align"
-        :fixed="item.fixed"
-        :sortable="item.sortable"
-      >
-      </el-table-column>
-      <el-table-column label="操作" width="130px" align="center" fixed="right">
-        <template slot-scope="scope">
-          <el-button
-            v-if="scope.row.picPath"
-            size="mini"
-            type="success"
-            icon="el-icon-view"
-            @click="toView(scope.row)"
-            style="margin-right: 5px"
-          />
-        </template>
-      </el-table-column>
-    </el-table>
-    <!--分页组件-->
-    <pagination />
-  </div>
-</template>
-
-<script>
-import permission from '@/directive/permission'
-import DateRangePicker from '@/components/DateRangePicker'
-//import crudRailAreaInOutLog from '@/api/positioning/railAreaInOutLog'
-import { getOptions } from '@/api/visualIntercom/public'
-import CRUD, { presenter, header, form, crud } from '@crud/crud'
-// import { crudOperation, rrOperation, udOperation, pagination } from '@crud'
-import crudComps from '@crud'
-import { visualIntercomLogTableOptions } from '../tableConfig'
-import Dayjs from 'dayjs'
-const defaultForm = {
-  id: '',
-}
-
-export default {
-  name: 'VisualIntercomLog',
-  directives: { permission },
-  mixins: [presenter(), header(), form(defaultForm), crud()],
-  components: { ...crudComps, DateRangePicker },
-  cruds() {
-    return CRUD({
-      title: '可视对讲事件记录',
-      url: 'visualIntercom/log/getListJson',
-      listOrder: [],
-      //crudMethod: { ...crudRailAreaInOutLog },
-      optShow: { add: false, edit: false, del: false },
-    })
-  },
-  computed: {
-    crudCU() {
-      return this.crud.status.cu > 0
-    },
-    VUE_APP_BASE_API() {
-      return process.env.VUE_APP_BASE_API
-    },
-  },
-  created() {
-    this.getOptions()
-  },
-  data() {
-    return {
-      dialogVisible: false,
-      dialogType: '',
-      datetimeRange: undefined,
-      visualIntercomLogTableOptions,
-      viewLoading: false,
-      permission: {},
-      optionsObj: {
-        VisualIntercom: [],
-        MajorType: [],
-        MajorType: [],
-        Name: [],
-      },
-    }
-  },
-  methods: {
-    toView(data) {
-      this.form = data
-      ;(this.dialogType = 'view'), (this.dialogVisible = true)
-    },
-    closeDialog() {
-      this.dialogVisible = false
-    },
-    async majorTypeChangeHandle(data) {
-      this.query.minorType = ''
-      if (data) await this.getMinorTypeOptions(data)
-      else this.optionsObj['MinorType'] = []
-      this.crud.toQuery()
-    },
-    async getOptions() {
-      Object.keys(this.optionsObj).forEach(async (key) => {
-        if (key == 'MinorType') return
-        try {
-          let res = await getOptions(key)
-          if (res.code === 20000) this.optionsObj[key] = res.data.content
-        } catch (error) {
-          console.log(error)
-        }
-      })
-    },
-    async getMinorTypeOptions(data) {
-      try {
-        this.optionsObj['MinorType'] = []
-        let res = await getOptions('MinorType', { id: data })
-        if (res.code === 20000) this.optionsObj['MinorType'] = res.data.content
-      } catch (error) {
-        console.log(error)
-      }
-    },
-  },
-}
-</script>
-
-<style></style>

+ 141 - 67
src/views/robotSLG/patrolRecord/index.vue

@@ -42,7 +42,7 @@
           size="small"
           placeholder="区域ID"
           class="filter-item"
-          style="width: 160px;"
+          style="width: 160px"
           collapse-tags
         />
         <el-select
@@ -142,58 +142,72 @@
       :before-close="crud.cancelCU"
       :visible.sync="crudCU"
       title="巡检记录"
-      width="900px"
+      width="880px"
     >
       <el-row :gutter="40">
+        <div style="margin: 0 22px 10px; color: #000; font-weight: bold">
+          <div>任务信息:</div>
+        </div>
         <el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
           <el-col :span="12">
-            <el-form-item label="机器人名称" prop="robot">
-              <el-input v-model="form.robot" size="small" class="filter-item" disabled />
-            </el-form-item>
-            <el-form-item label="任务名称" prop="task">
-              <el-input v-model="form.task" size="small" class="filter-item" disabled />
+            <el-form-item label="任务编号" prop="taskId">
+              <el-input v-model="form.taskId" siIdze="small" class="filter-item" />
             </el-form-item>
-            <el-form-item label="场景名称" prop="scene">
-              <el-input v-model="form.scene" size="small" class="filter-item" disabled />
+            <el-form-item label="机器人名称" prop="robot">
+              <el-input v-model="form.robot" size="small" class="filter-item" />
             </el-form-item>
             <el-form-item label="地图名称" prop="map">
-              <el-input v-model="form.map" size="small" class="filter-item" disabled />
+              <el-input v-model="form.map" size="small" class="filter-item" />
             </el-form-item>
-            <el-form-item label="区域名称" prop="area">
-              <el-input v-model="form.area" size="small" class="filter-item" disabled />
+            <el-form-item label="指标类目名称" prop="categoryName">
+              <el-input v-model="form.categoryName" size="small" class="filter-item" />
             </el-form-item>
-            <el-form-item label="导航点编号" prop="naviSequence">
-              <el-input v-model="form.naviSequence" size="small" class="filter-item" disabled />
+
+            <el-form-item label="识别状态" prop="recognizeState">
+              <el-input v-model="form.recognizeState" size="small" class="filter-item" />
             </el-form-item>
+            <!-- <el-form-item label="导航点编号" prop="naviSequence">
+              <el-input v-model="form.naviSequence" size="small" class="filter-item"  />
+            </el-form-item> -->
             <el-form-item label="巡检点ID" prop="positionId">
-              <el-input v-model="form.positionId" size="small" class="filter-item" disabled />
+              <el-input v-model="form.positionId" size="small" class="filter-item" />
             </el-form-item>
-            <el-form-item label="指标类目名称" prop="categoryName">
-              <el-input v-model="form.categoryName" size="small" class="filter-item" disabled />
-            </el-form-item>
-            <el-form-item label="指标名称" prop="indicatorName">
-              <el-input v-model="form.indicatorName" size="small" cvlass="filter-item" disabled />
+            <el-form-item label="检测值" prop="value">
+              <el-input v-model="form.value" size="small" class="filter-item" />
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item label="识别类型编码" prop="recognizeCode">
-              <el-input v-model="form.recognizeCode" size="small" class="filter-item" disabled />
+            <el-form-item label="任务名称" prop="task">
+              <el-input v-model="form.task" size="small" class="filter-item" />
             </el-form-item>
-            <el-form-item label="识别类型名称" prop="recognizeName">
-              <el-input v-model="form.recognizeName" size="small" class="filter-item" disabled />
+            <el-form-item label="巡检时间" prop="patrolTime">
+              <el-input v-model="form.patrolTime" size="small" class="filter-item" />
             </el-form-item>
-            <el-form-item label="单位" prop="unit">
-              <el-input v-model="form.unit" size="small" class="filter-item" disabled />
+            <el-form-item label="区域名称" prop="area">
+              <el-input v-model="form.area" size="small" class="filter-item" />
             </el-form-item>
-            <el-form-item label="序号" prop="index">
-              <el-input v-model="form.index" size="small" class="filter-item" disabled />
+            <el-form-item label="指标名称" prop="indicatorName">
+              <el-input v-model="form.indicatorName" size="small" cvlass="filter-item" />
             </el-form-item>
-            <el-form-item label="巡检时间" prop="patrolTime">
-              <el-input v-model="form.patrolTime" size="small" class="filter-item" disabled />
+            <el-form-item label="场景名称" prop="scene">
+              <el-input v-model="form.scene" size="small" class="filter-item" />
+            </el-form-item>
+            <!-- <el-form-item label="识别类型编码" prop="recognizeCode">
+              <el-input v-model="form.recognizeCode" size="small" class="filter-item"  />
+            </el-form-item> -->
+            <el-form-item label="识别类型" prop="recognizeName">
+              <el-input v-model="form.recognizeName" size="small" class="filter-item" />
+            </el-form-item>
+            <!-- <el-form-item label="序号" prop="index">
+              <el-input v-model="form.index" size="small" class="filter-item"  />
+            </el-form-item> -->
+            <el-form-item label="单位" prop="unit">
+              <el-input v-model="form.unit" size="small" class="filter-item" />
             </el-form-item>
+
             <!-- <el-form-item label="识别状态" prop="recognizeState">
               <el-switch
-                disabled
+                
                 v-model="form.recognizeState"
                 active-color="#13ce66"
                 inactive-color="#ff4949"
@@ -202,71 +216,123 @@
               >
               </el-switch>
             </el-form-item> -->
-            <el-form-item label="识别状态" prop="recognizeState">
-              <el-input v-model="form.recognizeState" size="small" class="filter-item" disabled />
-            </el-form-item>
-            <el-form-item label="识别阈值ID" prop="thresholdId">
-              <el-input v-model="form.thresholdId" size="small" class="filter-item" disabled />
-            </el-form-item>
-            <el-form-item label="缺陷等级" prop="defectGrade">
-              <el-input v-model="form.defectGrade" size="small" class="filter-item" disabled />
-            </el-form-item>
-            <el-form-item label="检测值" prop="value">
-              <el-input v-model="form.value" size="small" class="filter-item" disabled />
-            </el-form-item>
+
+            <!-- <el-form-item label="识别阈值ID" prop="thresholdId">
+              <el-input v-model="form.thresholdId" size="small" class="filter-item"  />
+            </el-form-item> -->
+            <!-- <el-form-item label="缺陷等级" prop="defectGrade">
+              <el-input v-model="form.defectGrade" size="small" class="filter-item"  />
+            </el-form-item> -->
+
             <!-- <el-form-item label="检测值明细" prop="detail">
-              <el-input v-model="form.detail" size="small" class="filter-item" disabled />
+              <el-input v-model="form.detail" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="矫正时间" prop="adjustTime">
-              <el-input v-model="form.adjustTime" size="small" class="filter-item" disabled />
+              <el-input v-model="form.adjustTime" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="识别时间" prop="recognizeTime">
-              <el-input v-model="form.recognizeTime" size="small" class="filter-item" disabled />
+              <el-input v-model="form.recognizeTime" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="修正后等级" prop="modifiedGrade">
-              <el-input v-model="form.modifiedGrade" size="small" class="filter-item" disabled />
+              <el-input v-model="form.modifiedGrade" size="small" class="filter-item"  />
             </el-form-item> -->
           </el-col>
           <!-- <el-col :span="8">
             <el-form-item label="缺陷追溯" prop="defectReview">
-              <el-input v-model="form.defectReview" size="small" class="filter-item" disabled />
+              <el-input v-model="form.defectReview" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="缺陷审核备注" prop="reviewMemo">
-              <el-input v-model="form.reviewMemo" size="small" class="filter-item" disabled />
+              <el-input v-model="form.reviewMemo" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="缺陷处理状态" prop="reviewState">
-              <el-input v-model="form.reviewState" size="small" class="filter-item" disabled />
+              <el-input v-model="form.reviewState" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="缺陷确认时间" prop="confirmTime">
-              <el-input v-model="form.confirmTime" size="small" class="filter-item" disabled />
+              <el-input v-model="form.confirmTime" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="缺陷确认人" prop="reviewer">
-              <el-input v-model="form.reviewer" size="small" class="filter-item" disabled />
+              <el-input v-model="form.reviewer" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="缺陷解决时间" prop="solveTime">
-              <el-input v-model="form.solveTime" size="small" class="filter-item" disabled />
+              <el-input v-model="form.solveTime" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="缺陷解决人" prop="solver">
-              <el-input v-model="form.solver" size="small" class="filter-item" disabled />
+              <el-input v-model="form.solver" size="small" class="filter-item"  />
             </el-form-item>
             <el-form-item label="警戒线" prop="guardLine">
-              <el-input v-model="form.guardLine" size="small" class="filter-item" disabled />
+              <el-input v-model="form.guardLine" size="small" class="filter-item"  />
             </el-form-item>
           </el-col> -->
         </el-form>
       </el-row>
-      <!-- <el-row :gutter="40">
+      <el-row :gutter="40">
         <div style="margin-left: 22px; color: #000; font-weight: bold">
-          <div>算法资源列表:</div>
-          <el-table :data="resourceList" style="width: 98%" :height="'100%'">
-            <el-table-column prop="index" label="序号" align="center" />
-            <el-table-column prop="tye" label="资源类型" align="center" />
-            <el-table-column prop="originUrl" label="原始资源路径" align="center" />
-            <el-table-column prop="processedUrl" label="已处理资源路径" />
-          </el-table>
+          <div>缺陷阈值参考:</div>
+          <el-image
+            style="margin:20px;width: 93%; height: 100%"
+            v-if="form.resourceList[0].processedUrl"
+            :src="pictureUrl"
+            lazy
+          ></el-image>
         </div>
-      </el-row> -->
-
+      </el-row>
+      <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>
+        </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-col :span="12">
+            <el-form-item label="巡检结果" prop="recognizeState">
+              <el-input v-model="form.recognizeState" size="small" class="filter-item" />
+            </el-form-item>
+            <el-form-item label="修正后等级" prop="modifiedGrade">
+              <el-select
+                v-model="form.modifiedGrade"
+                clearable
+                size="small"
+                placeholder="修正后等级等级"
+                class="filter-item"
+                style="width: 300px"
+              >
+                <el-option
+                  v-for="item in defectGradeList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="缺陷等级" prop="defectGrade">
+              <el-select
+                v-model="form.defectGrade"
+                clearable
+                size="small"
+                placeholder="缺陷等级"
+                class="filter-item"
+                style="width: 300px"
+              >
+                <el-option
+                  v-for="item in defectGradeList"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="处理结果" prop="reviewState">
+              <el-input v-model="form.reviewState" size="small" class="filter-item" />
+            </el-form-item>
+          </el-col>
+        </el-form>
+      </el-row>
     </el-dialog>
     <!--表格渲染-->
     <el-table
@@ -312,7 +378,7 @@
       :page-size="pageSize"
       layout="total, sizes, prev, pager, next, jumper"
       :total="+patrolRecordList.totalCount"
-      style="margin-top:4px;"
+      style="margin-top: 4px"
     >
     </el-pagination>
   </div>
@@ -339,6 +405,7 @@ import {
   getRobotToken,
   getPatrolRecordList,
 } from '@/api/robotSLG/public'
+import Map from "@/views/robotSLG/patrolRecord/map";
 
 const defaultForm = {
   id: '', //主键ID
@@ -400,7 +467,7 @@ export default {
   name: 'PatrolRecord',
   directives: { permission },
   mixins: [presenter(), header(), form(defaultForm), crud()],
-  components: { ...crudComps, DateRangePicker },
+  components: { ...crudComps, DateRangePicker,Map },
   cruds() {
     return CRUD({
       title: '巡检记录',
@@ -818,6 +885,7 @@ export default {
         },
       ],
       resourceList: [],
+      pictureUrl: '',
     }
   },
   created() {
@@ -836,6 +904,12 @@ export default {
     })
   },
   methods: {
+    [CRUD.HOOK.beforeToCU]() {
+      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)
+    },
     getOptions() {
       Object.keys(this.optionsObj).forEach(async (key) => {
         if (key == 'FloorNo') return

+ 1513 - 0
src/views/robotSLG/patrolRecord/map.vue

@@ -0,0 +1,1513 @@
+<template>
+  <div>
+    <div id="map" class="map-container"></div>
+    <!-- <countarea-panel
+      :buildid="tbuildId"
+      :countdic="countDic"
+      :show="buildData ? buildData.CountareaPanelOpen : false"
+      v-if="buildData ? buildData.CountareaPanelDisplay : false"
+    ></countarea-panel> -->
+    <!-- <image-video :cameraData.sync="cameraData" :visible.sync="cameraVisible"></image-video> -->
+  </div>
+</template>
+
+<script>
+import 'maptalks/dist/maptalks.css'
+import * as maptalks from 'maptalks'
+import * as mqtt from 'mqtt'
+import { getMQTTCilentId } from '@/utils/mqtt'
+import {
+  getRailListJson,
+  getAreaListJson,
+  getCameraListJson,
+  getPerimeterListJson,
+} from '@/api/positioning/map'
+import CountareaPanel from '@/components/CountareaPanel'
+import ImageVideo from '@/components/ImageVideo'
+
+import {
+  getRobotList,
+  getRecognizeList,
+  getAreaTree,
+  getNaviList,
+  getPositionList,
+  getSenceList,
+  getTaskList,
+  getRobotToken,
+  getPatrolRecordList,
+  getAlarmList,
+  getRealtimeList,
+} from '@/api/robotSLG/public'
+
+export default {
+  name: 'Map',
+  components: { CountareaPanel, ImageVideo },
+  props: {
+    runningTask: {
+      type: String,
+    },
+  },
+  data() {
+    return {
+      locationData: null,
+      baseRelativeCoordinate0: null,
+      baseRelativeCoordinate1: null,
+      baseRelativeExtent: null,
+      baseGPSCoordinate0: null,
+      baseGPSCoordinate1: null,
+      baseGPSExtent: null,
+      baseExtent: null,
+      //
+      buildNo: 0, //默认建筑编号,和建筑数据内容在数组中的下标一致
+      buildPanelPos: 0,
+      floorNo: 0, //默认楼层编号,和楼层数据在FloorList数组的下标一致
+      floorPanelPos: 0,
+      floorNoArray: [], //楼层数据,需为数组格式(接口参数规定)
+      postExtent: null,
+      //
+      buildData: null,
+      //
+      map: null,
+      mapLayer: null,
+      personLayer: null,
+      railLayer: null,
+      railAlarmLayer: null,
+      cameraLayer: null,
+      perimeterLayer: null,
+      perimeterAlarmLayer: null,
+      historyLayer: null,
+      //巡检机器人增加
+      robotNavLayer: null,
+      robotLayer: null,
+      //
+      debugPanel: null,
+      floorPanel: null,
+      buildPanel: null,
+
+      mqttClient: null,
+      topicArray: [],
+      topicCount: null,
+
+      areaList: [],
+      perimeterList: [],
+
+      personAlarm: {},
+      railAlarm: {},
+      areaAlarm: {},
+      arearailAlarm: {},
+      alarmingPerson: [],
+      alarmingRail: [],
+      countDic: {},
+
+      cameraData: {},
+      cameraVisible: false,
+
+      //机器人修改
+      robotToken: '',
+      patrolRecord: [],
+      realltimeData: [],
+      naviList: [],
+    }
+  },
+  computed: {
+    VUE_APP_BASE_API() {
+      return process.env.VUE_APP_BASE_API
+    },
+    VUE_APP_BASE_WS() {
+      return 'ws://' + window.location.host + process.env.VUE_APP_BASE_API
+    },
+    tbuildId() {
+      return this.buildData ? this.buildData.BuildId || '' : ''
+    },
+  },
+  created() {
+    window.moveBuildPanel = this.moveBuildPanel
+    window.changeBuild = this.changeBuild
+    window.moveFloorPanel = this.moveFloorPanel
+    window.changeFloor = this.changeFloor
+    //机器人相关
+    this.initRobotInfo().then(() => {
+      this.getNaviListOption()
+      setTimeout(() => {
+        this.showTaskPoint()
+        console.log(this.runningTask)
+      }, 200)
+    })
+  },
+  mounted() {
+    this.$nextTick(async (_) => {
+      await this.getLocationData()
+    })
+    this.$nextTick(() => {
+      if (this.$route.query.type) {
+        this.railLayer.show()
+      }
+    })
+  },
+  // beforeDestroy() {
+  //   this.mqttClient?.end()
+  // },
+  methods: {
+    // 机器人登录获取token
+    async initRobotInfo() {
+      try {
+        let res = await getRobotToken(ROBOT)
+        if (res.code === 1) {
+          this.robotToken = res.data
+        }
+      } catch (error) {}
+    },
+
+    //机器人导航点数据
+    async getNaviListOption() {
+      try {
+        let res = await getNaviList({ token: this.robotToken, pageIndex: 1, pageSize: 100 })
+        if (res.code === 1) {
+          this.naviList = res.data.list
+          //设置添加所有导航点并隐藏
+          this.setNavPointList()
+        } else {
+          this.initRobotInfo()
+        }
+      } catch (error) {}
+    },
+
+    //导航图层执行导航点
+    setNavPointList() {
+      this.robotNavLayer.clear()
+      if (this.naviList) {
+        this.naviList.forEach((check) => {
+          var m = new maptalks.Marker(
+            this.getNewCoordinate(+check.coordinateY * 100, +check.coordinateX * 100),
+            {
+              id: check.id,
+              visible: false,
+              symbol: {
+                markerFile: this.VUE_APP_BASE_API + '/../static/images/finishP.svg',
+                markerWidth: 40,
+                markerHeight: 40,
+                markerDx: 0,
+                markerDy: 20,
+              },
+              properties: {
+                id: check.id,
+                name: check.alias,
+                data: check,
+              },
+            }
+          ).addTo(this.robotNavLayer)
+          m.on('click', '')
+        })
+      }
+      return m
+    },
+    //显示任务点
+    showTaskPoint() {
+      if (this.runningTask) {
+        let p = this.robotNavLayer.getGeometryById(this.runningTask)
+        // console.log(p)
+        p.options.visible = true
+      }
+    },
+    //地图初始化数据
+    async getLocationData() {
+      this.locationData = this.$setting
+
+      if (this.locationData) {
+        this.buildNo = this.locationData.DefaultBuild // 默认建筑(在BuildList数组的位置)
+        this.buildData = this.locationData.BuildList[this.buildNo] //默认建筑数据
+        this.mapBaseLayer = this.locationData.MapBaseLayer //地图底图
+
+        this.floorNo = this.buildData.DefaultFloor //默认楼层(在FloorList数组的位置)
+
+        if (this.buildData.FloorList[this.floorNo].No instanceof Array) {
+          // 楼层数据,数组格式
+          this.floorNoArray = this.buildData.FloorList[this.floorNo].No
+        } else {
+          this.floorNoArray = [this.buildData.FloorList[this.floorNo].No]
+        }
+
+        this.baseRelativeCoordinate0 = new maptalks.Coordinate(this.buildData.RelativeCoordinate0) //左上角相对坐标,单位:毫米
+        this.baseRelativeCoordinate1 = new maptalks.Coordinate(this.buildData.RelativeCoordinate1) //右下角相对坐标,单位:毫米
+        //Extent 表示地图上的边界框,一个具有最小和最大坐标的矩形经纬度
+        // baseRelativeExtent 生成了一个相对坐标的边界矩形
+        this.baseRelativeExtent = new maptalks.Extent(
+          this.baseRelativeCoordinate0,
+          this.baseRelativeCoordinate1
+        )
+
+        if (this.buildData.MultiMap) {
+          //同一个服务器上是否有同一个BuildId的多个地图
+          this.postExtent = [
+            this.baseRelativeCoordinate0.x,
+            this.baseRelativeCoordinate0.y,
+            this.baseRelativeCoordinate1.x,
+            this.baseRelativeCoordinate1.y,
+          ]
+        } else {
+          this.postExtent = null
+        }
+
+        if (this.buildData.Projection == 'identity') {
+          // Projection 地图投影  值为EPSG:3857
+          // baseExtent  生成一个GPS坐标的矩形
+          this.baseExtent = new maptalks.Extent(
+            new maptalks.Coordinate(0, 0),
+            new maptalks.Coordinate(
+              this.baseRelativeCoordinate1.x - this.baseRelativeCoordinate0.x,
+              this.baseRelativeCoordinate0.y - this.baseRelativeCoordinate1.y
+            )
+          )
+        } else {
+          // GPSCoordinate0  左上角GPS坐标(WGS84) x:经度 y:纬度
+          // GPSCoordinate1  右下角GPS坐标(WGS84) x:经度 y:纬度
+          this.baseGPSCoordinate0 = new maptalks.Coordinate(this.buildData.GPSCoordinate0)
+          this.baseGPSCoordinate1 = new maptalks.Coordinate(this.buildData.GPSCoordinate1)
+          this.baseGPSExtent = new maptalks.Extent(this.baseGPSCoordinate0, this.baseGPSCoordinate1)
+          this.baseExtent = this.baseGPSExtent
+        }
+        await this.createMap()
+      } else {
+        console.log('获取定位配置文件失败')
+      }
+    },
+    async createMap() {
+      let zoom, maxZoom, minZoom, baseLayer, resolution0, resolutionMax
+
+      if (this.buildData.Projection == 'identity') {
+        zoom = this.buildData.RelativeMapZoom // 相对坐标地图缩放
+        maxZoom = this.buildData.RelativeMapMaxZoom //相对坐标地图最大缩放
+        minZoom = this.buildData.RelativeMapMinZoom //相对坐标地图最小缩放
+        resolution0 = this.buildData.RelativeResolution0 //相对坐标地图最大分辨率
+        resolutionMax = this.buildData.RelativeResolutionMax //相对坐标地图最大分辨率倍数
+        baseLayer = null
+      } else {
+        zoom = this.buildData.GPSMapZoom //GPS地图缩放
+        maxZoom = this.buildData.GPSMapMaxZoom //GPS地图最大缩放
+        minZoom = this.buildData.GPSMapMinZoom //GPS地图最小缩放
+        resolution0 = this.buildData.GPSResolution0 //GPS地图最大分辨率
+        resolutionMax = this.buildData.GPSResolutionMax //GPS地图最大分辨率倍数
+        baseLayer = new maptalks.TileLayer('base', this.mapBaseLayer) //地图来源
+      }
+
+      if (this.map) this.map.remove()
+      this.map = new maptalks.Map('map', {
+        center: this.baseExtent.getCenter(), //地图中点
+        //centerCross: true,
+        zoom: zoom,
+        maxZoom: maxZoom,
+        minZoom: minZoom,
+        bearing: this.buildData.MapBearing, //地图旋转角度
+        pitch: this.buildData.MapPitch, //地图倾斜角度
+        maxExtent: this.baseExtent, //地图最大范围,平移超出范围会反弹回来
+        zoomControl: {
+          // 缩放控件
+          position: 'top-left',
+          slider: false,
+          zoomLevel: false,
+        },
+        scaleControl: true, //比例尺控件
+        spatialReference: {
+          // Map 的空间引用,默认使用的是google的地图投影 EPSG: 3857
+          projection: this.buildData.Projection,
+          resolutions: (function () {
+            const resolutions = []
+            for (let i = 0; i <= resolutionMax; i++) {
+              resolutions[i] = resolution0 / Math.pow(2, i)
+            }
+            return resolutions
+          })(),
+        },
+        baseLayer: baseLayer, //基础图层
+      })
+      //将地图设置为适合给定范围的最大缩放级别
+      this.map.fitExtent(this.baseExtent, 0)
+      // 图片图层
+      this.mapLayer = new maptalks.ImageLayer(
+        'map',
+        [
+          {
+            url: this.buildData.FloorList[this.floorNo].MapPath,
+            extent: this.baseExtent,
+            opacity: 1,
+          },
+        ],
+        {
+          forceRenderOnMoving: true,
+          forceRenderOnZooming: true,
+          forceRenderOnRotating: true,
+        }
+      ).addTo(this.map)
+      // 矢量图层
+      this.robotNavLayer = new maptalks.VectorLayer('robotNav', {
+        zIndex: 2,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.robotLayer = new maptalks.VectorLayer('robot', {
+        zIndex: 1,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.personLayer = new maptalks.VectorLayer('person', {
+        zIndex: 100,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.cameraLayer = new maptalks.VectorLayer('camera', {
+        zIndex: 10,
+        visible: this.buildData.CameraLayerDisplay,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.railLayer = new maptalks.VectorLayer('rail', {
+        zIndex: 1,
+        visible: false,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.railAlarmLayer = new maptalks.VectorLayer('railAlarm', {
+        zIndex: 2,
+        visible: true,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.perimeterLayer = new maptalks.VectorLayer('perimeter', {
+        zIndex: 3,
+        visible: true,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.perimeterAlarmLayer = new maptalks.VectorLayer('perimeterAlarm', {
+        zIndex: 40,
+        visible: true,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+
+      this.historyLayer = new maptalks.VectorLayer('history', {
+        zIndex: 20,
+        forceRenderOnMoving: true,
+        forceRenderOnZooming: true,
+        forceRenderOnRotating: true,
+      }).addTo(this.map)
+      // 右上角工具栏
+      let _this = this
+      new maptalks.control.Toolbar({
+        items: [
+          {
+            item: '复位地图',
+            click: function () {
+              _this.map.animateTo(
+                {
+                  //center: baseExtent.getCenter(),
+                  //zoom: 13,
+                  bearing: _this.buildData.MapBearing,
+                  pitch: _this.buildData.MapPitch,
+                },
+                {
+                  duration: 1000,
+                },
+                (frame) => {
+                  if (frame.state.playState === 'finished') {
+                    _this.map.fitExtent(_this.baseExtent, 0, {
+                      duration: 1000,
+                    })
+                  }
+                }
+              )
+            },
+          },
+          // {
+          //   item: '围栏',
+          //   children: [
+          //     {
+          //       item: '显示',
+          //       click: function () {
+          //         _this.railLayer.show()
+          //       },
+          //     },
+          //     {
+          //       item: '隐藏',
+          //       click: function () {
+          //         _this.railLayer.hide()
+          //       },
+          //     },
+          //   ],
+          // },
+          // {
+          //   item: '摄像头',
+          //   children: [
+          //     {
+          //       item: '显示',
+          //       click: function () {
+          //         _this.cameraLayer.show()
+          //       },
+          //     },
+          //     {
+          //       item: '隐藏',
+          //       click: function () {
+          //         _this.cameraLayer.hide()
+          //       },
+          //     },
+          //   ],
+          // },
+        ],
+      }).addTo(this.map)
+      // 右下角信息栏
+      if (this.buildData.DebugPanelDisplay) {
+        this.debugPanel = new maptalks.control.Panel({
+          position: 'bottom-right',
+          draggable: false,
+          custom: true,
+          content: '<div class="map-debugpanel">hello </div>',
+          closeButton: false,
+        }).addTo(this.map)
+
+        this.map.on('click', (e) => this.update(e))
+      }
+      // 楼层控制器
+      if (this.buildData.FloorPanelDisplay) {
+        this.createFloorPanel()
+      }
+      // 地图选择器
+      // if (this.locationData.BuildPanelDisplay) {
+      //   this.createBuildPanel()
+      // }
+
+      // await this.getRail()
+      // await this.getArea()
+      // await this.getCamera()
+      // await this.getPerimeter()
+      // this.getLocation()
+
+      this.startMQTT()
+
+      // if (!this.interval1)
+      //   this.interval1 = setInterval(() => {
+      //     //this.getLocation()
+      //     this.getRailAlarm()
+      //   }, 1000)
+      // 点选重叠图形
+      this.map.on('contextmenu', (e) => this.identifyAndSelect(e))
+    },
+    //开始MQTT接收
+    startMQTT() {
+      this.personAlarm = {}
+      this.railAlarm = {}
+      this.areaAlarm = {}
+      this.arearailAlarm = {}
+      this.alarmingPerson = []
+      this.alarmingRail = []
+
+      this.topicArray.splice(0)
+      this.floorNoArray.forEach((f) => {
+        this.topicArray.push('Positioning/Positioning/' + this.buildData.BuildId + '/' + f + '/#')
+        this.topicArray.push('Positioning/Alarm/Person/' + this.buildData.BuildId + '/' + f + '/#')
+        this.topicArray.push('Positioning/Alarm/Rail/' + this.buildData.BuildId + '/' + f + '/#')
+      })
+      this.topicArray.push('Positioning/Alarm/Rail/' + this.buildData.BuildId + '/0/#')
+      this.topicArray.push('Positioning/Alarm/Area/' + this.buildData.BuildId + '/#')
+      this.topicArray.push('Perimeter/' + this.buildData.BuildId + '/0/#')
+      this.topicArray.push('Perimeter/#')
+      this.topicCount = 'CountArea/CountDic/' + this.buildData.BuildId
+
+      if (this.mqttClient && this.mqttClient.connected) {
+        this.mqttClient.subscribe(this.topicArray)
+        this.mqttClient.subscribe(this.topicCount)
+        return
+      }
+
+      // 连接选项
+      const options = {
+        clean: true, // true: 清除会话, false: 保留会话
+        keepalive: 60,
+        connectTimeout: 4000, // 超时时间
+        // 认证信息
+        clientId: getMQTTCilentId('map'),
+        username: 'client',
+        password: '19c9547ad2029be96774fce5f1b9f099',
+      }
+      const connectUrl = this.VUE_APP_BASE_WS + '/MQTTOverWebSocket'
+      //console.log(connectUrl)
+      this.mqttClient = mqtt.connect(connectUrl, options)
+
+      let _this = this
+      this.mqttClient.on('connect', function () {
+        //订阅主题
+        console.log('定位MQTT正在连接')
+        _this.mqttClient.subscribe(_this.topicArray)
+        _this.mqttClient.subscribe(_this.topicCount)
+      })
+      this.mqttClient.on('message', (topic, message) => {
+        if (topic == 'Online') {
+          console.log('定位MQTT收到消息:', topic, message.toString())
+        } else if (topic.startsWith('Positioning/Positioning/')) {
+          this.chengePerson(JSON.parse(message.toString()))
+          //console.log(JSON.parse(message.toString()))
+        } else if (topic.startsWith('Positioning/Alarm/')) {
+          let alarm = JSON.parse(message.toString())
+          switch (alarm.AlarmSource) {
+            case 1:
+              this.personAlarm[alarm.Id] = alarm.AlarmList
+              this.personAlarming(alarm.Id)
+              break
+            case 2:
+              this.railAlarm[alarm.Id] = alarm.AlarmList
+              this.railAlarming(alarm.Id)
+              break
+            case 3:
+              this.areaAlarm[alarm.Id] = alarm.AlarmList
+              let area = this.areaList.find((v) => v.id == alarm.Id)
+              if (area && area.railIds && area.railIds.length > 0) {
+                area.railIds.forEach((a) => {
+                  if (this.arearailAlarm[a]) {
+                    if (alarm.AlarmList.length > 0) {
+                      if (this.arearailAlarm[a].indexOf(area.id) == -1)
+                        this.arearailAlarm[a].push(area.id)
+                    } else {
+                      let i = this.arearailAlarm[a].indexOf(area.id)
+                      if (i >= 0) this.arearailAlarm[a].splice(i, 1)
+                    }
+                  } else {
+                    this.arearailAlarm[a] = []
+                    if (alarm.AlarmList.length > 0) this.arearailAlarm[a].push(area.id)
+                  }
+                  this.railAlarming(a)
+                })
+              }
+              break
+            default:
+              break
+          }
+        } else if (topic.startsWith('CountArea/CountDic/')) {
+          let count = JSON.parse(message.toString())
+          this.countDic = count
+        } else if (topic.startsWith('Perimeter/')) {
+          let perimeter = JSON.parse(message.toString())
+          if (
+            perimeter.buildId == this.buildData.BuildId &&
+            (this.floorNoArray.indexOf(perimeter.floorNo) > -1 || perimeter.FloorNo == 0)
+          ) {
+            //console.log(perimeter)
+            this.chengePerimeter(perimeter)
+          }
+        }
+      })
+    },
+    chengePerson(person) {
+      if (person.Display == 1) {
+        let p = this.personLayer.getGeometryById(person.Id)
+        if (p) {
+          this.personMove(p, person)
+        } else {
+          this.addPerson(person)
+        }
+      } else {
+        let p = this.personLayer.getGeometryById(person.Id)
+        if (p) {
+          p.remove()
+        }
+      }
+    },
+    chengePerimeter(perimeter) {
+      let s = this.perimeterLayer.getGeometryById(perimeter.segmentId)
+      if (!s) s = this.addPerimeter(perimeter.segmentId)
+      if (s) {
+        switch (perimeter.alarmType) {
+          case 0: //无报警
+            s.setSymbol({
+              lineColor: '#00ff00',
+              lineWidth: 4,
+              lineOpacity: 1,
+            })
+            break
+          case 1: //离线
+            s.setSymbol({
+              lineColor: '#ababab',
+              lineWidth: 4,
+              lineOpacity: 1,
+            })
+            break
+          case 2: //警告
+            s.setSymbol({
+              lineColor: '#00ff00',
+              lineWidth: 4,
+              lineOpacity: 1,
+            })
+            s.openInfoWindow()
+            break
+          case 3: //报警
+            s.setSymbol({
+              lineColor: '#00ff00',
+              lineWidth: 4,
+              lineOpacity: 1,
+            })
+            s.openInfoWindow()
+            break
+          default:
+            break
+        }
+        this.changPerimeterAlarm(perimeter.segmentId, perimeter.alarmType, perimeter.camera)
+      }
+    },
+    addPerimeter(id) {
+      let perimeter
+      let segment
+      for (let p in this.perimeterList) {
+        perimeter = this.perimeterList[p]
+        segment = perimeter.segments.find((b) => b.id == id)
+        if (segment) break
+      }
+      let s
+      if (perimeter && segment) {
+        s = new maptalks.LineString(
+          segment.points.map((p) => this.getNewCoordinate(p.x, p.y)),
+          {
+            id: segment.id,
+            symbol: {
+              lineColor: '#00ff00',
+              lineWidth: 4,
+              lineOpacity: 1,
+            },
+            properties: {
+              id: segment.id,
+              name: perimeter.name + '分段' + segment.code,
+            },
+          }
+        )
+          .addTo(this.perimeterLayer)
+          .setInfoWindow({
+            width: 150,
+            content: perimeter.name + '分段' + segment.code,
+          })
+      }
+      return s
+    },
+    changPerimeterAlarm(id, alarmType, camera) {
+      let color
+      switch (alarmType) {
+        case 0: //无报警
+          return
+        case 1: //离线
+          return
+        case 2: //警告
+          color = '#ffff00'
+          break
+        case 3: //报警
+          color = '#ff0000'
+          break
+        default:
+          break
+      }
+      let g = this.perimeterAlarmLayer.getGeometryById(id)
+      if (g) {
+        if (g.getSymbol().lineColor == '#ff0000') color = '#ff0000'
+        g.setSymbol({
+          lineColor: color,
+          lineWidth: 6,
+          lineOpacity: 1,
+        })
+        return
+      }
+      let perimeter
+      let segment
+      for (let p in this.perimeterList) {
+        perimeter = this.perimeterList[p]
+        segment = perimeter.segments.find((b) => b.id == id)
+        if (segment) break
+      }
+      if (perimeter && segment) {
+        let s = new maptalks.LineString(
+          segment.points.map((p) => this.getNewCoordinate(p.x, p.y)),
+          {
+            id: segment.id,
+            symbol: {
+              lineColor: color,
+              lineWidth: 6,
+              lineOpacity: 1,
+            },
+          }
+        ).addTo(this.perimeterAlarmLayer)
+        s.on('click', (param) => this.perimeterAlarmLayer.removeGeometry(param.target))
+        setTimeout(() => this.flashPerimeterAlarm(id), 500)
+
+        if (alarmType == 2 || alarmType == 3) {
+          this.cameraVisible = true
+          this.cameraData = camera
+        }
+      }
+    },
+    flashPerimeterAlarm(id) {
+      let g = this.perimeterAlarmLayer.getGeometryById(id)
+      if (g) {
+        let s = g.getSymbol()
+        s.lineOpacity = s.lineOpacity == 1 ? 0 : 1
+        if (g) {
+          g.setSymbol(s)
+          setTimeout(() => this.flashPerimeterAlarm(id), 500)
+        }
+      }
+    },
+    // 获取围栏
+    async getRail() {
+      this.railLayer.clear()
+      this.railAlarmLayer.clear()
+      let params = {
+        BuildId: this.buildData.BuildId,
+        FloorNoArray: this.floorNoArray,
+        Extent: this.postExtent,
+        // riskLevelArray: [1, 2, 3, 4] //四色图参数
+      }
+      try {
+        let res = await getRailListJson(params)
+        let data = res.data.content
+        if (data.length > 0) {
+          data.forEach((r) => {
+            let inExtent = true
+            let points = []
+            r.points.forEach((p) => {
+              if (!this.baseRelativeExtent.contains(new maptalks.Coordinate(p.x, p.y)))
+                inExtent = false
+              points.push(this.getNewCoordinate(p.x, p.y))
+            })
+            if (inExtent) {
+              this.railLayer.addGeometry(
+                new maptalks.Polygon(points, {
+                  symbol: {
+                    lineColor: 'rgb(0,196,240)',
+                    lineWidth: 2,
+                    lineOpacity: 1,
+                    polygonFill: 'rgb(135,196,240)',
+                    polygonOpacity: 0.6,
+                  },
+                })
+              )
+              this.railAlarmLayer.addGeometry(
+                new maptalks.Polygon(points, {
+                  id: r.id,
+                  visible: false,
+                  symbol: {
+                    lineColor: '#C06173',
+                    lineWidth: 2,
+                    lineOpacity: 1,
+                    polygonFill: '#E08193',
+                    polygonOpacity: 0.6,
+                  },
+                })
+              )
+              this.railAlarming(r.id)
+            }
+          })
+        }
+      } catch (error) {
+        console.log(error)
+        this.$message.error(error)
+      }
+    },
+    // 获取摄像头
+    async getCamera() {
+      this.cameraLayer.clear()
+      let params = {
+        buildId: this.buildData.BuildId,
+        floorNoArray: this.floorNoArray,
+        extent: this.postExtent,
+      }
+      try {
+        let res = await getCameraListJson(params)
+        let data = res.data.content
+        if (data.length > 0) {
+          data.forEach((c) => {
+            var m = new maptalks.Marker(this.getNewCoordinate(c.location.x, c.location.y), {
+              id: c.id,
+              visible: true,
+              symbol: {
+                markerFile: this.VUE_APP_BASE_API + c.iconPath,
+                markerWidth: 40,
+                markerHeight: 40,
+                markerDx: 0,
+                markerDy: 20,
+              },
+              properties: {
+                id: c.id,
+                name: c.name,
+                data: c,
+              },
+            }).addTo(this.cameraLayer)
+            m.on('click', this.cameraClickHandler)
+          })
+        }
+      } catch (error) {
+        console.log(error)
+        this.$message.error(error)
+      }
+    },
+    cameraClickHandler(param) {
+      let c = param.target.getProperties()
+      this.cameraVisible = true
+      this.cameraData = c.data
+    },
+    // 获取区域
+    async getArea() {
+      let params = {
+        BuildId: this.buildData.BuildId,
+        // riskLevelArray: [1, 2, 3, 4] //四色图参数
+      }
+      try {
+        let res = await getAreaListJson(params)
+        let data = res.data.content
+        this.areaList = data
+      } catch (error) {
+        console.log(error)
+        this.$message.error(error)
+      }
+    },
+    // 获取周界
+    async getPerimeter() {
+      this.perimeterLayer.clear()
+      this.perimeterAlarmLayer.clear()
+      this.perimeterList = []
+      let params = {
+        BuildId: this.buildData.BuildId,
+        FloorNoArray: this.floorNoArray,
+        Extent: this.postExtent,
+      }
+      try {
+        let res = await getPerimeterListJson(params)
+        let data = res.data.content
+        if (data.length > 0) {
+          this.perimeterList = data
+        }
+      } catch (error) {
+        console.log(error)
+        this.$message.error(error)
+      }
+    },
+    // 创建地图选择按钮模块
+    createBuildPanel() {
+      if (this.buildNo <= 1) {
+        this.buildPanelPos = 0
+      } else if (this.buildNo >= this.locationData.BuildList.length - 3) {
+        this.buildPanelPos = this.locationData.BuildList.length - 3
+      } else {
+        this.buildPanelPos = this.buildNo - 1
+      }
+
+      let mapdiv = document.getElementById('map')
+      let mapdivh = mapdiv.clientHeight || mapdiv.offsetHeight
+
+      this.buildPanel = new maptalks.control.Panel({
+        position: { top: mapdivh / 2 - 60, left: '20' },
+        draggable: false,
+        custom: true,
+        content: this.makeBuildPanelContent(),
+        closeButton: false,
+      }).addTo(this.map)
+    },
+    // 左下按钮页面内容生成
+    makeBuildPanelContent() {
+      let content
+      content = '<table class="map-buildpanel" cellpadding="0" frame=void rules=none>'
+      content +=
+        '<tr><td><button onclick="moveBuildPanel(0)"><div class="up-arrows"></div></button></td></tr>'
+      for (let i = this.buildPanelPos; i <= this.buildPanelPos + 2; i++) {
+        if (i == this.buildNo) {
+          content +=
+            '<tr><td><button style="background: rgb(28,188,156);">' +
+            this.locationData.BuildList[i].BuildAbbName +
+            '</button></td></tr>'
+        } else {
+          if (this.locationData.BuildList[i]) {
+            content +=
+              '<tr><td><button onclick="changeBuild(' +
+              i +
+              ')">' +
+              this.locationData.BuildList[i].BuildAbbName +
+              '</button></td></tr>'
+          } else {
+            content += '<tr><td><button></button></td></tr>'
+          }
+        }
+      }
+
+      content +=
+        '<tr><td><button onclick="moveBuildPanel(1)"><div class="down-arrows"></div></button></td></tr>'
+      content += '</table>'
+      return content
+    },
+    // 点击地图按钮上下箭头
+    moveBuildPanel(s) {
+      let b = this.buildPanelPos
+      if (s == 0) {
+        if (b > 0) b--
+      } else if (s == 1) {
+        if (b < this.buildData.FloorList.length - 3) b++
+      }
+      if (b != this.buildPanelPos) {
+        this.buildPanelPos = b
+        this.buildPanel.setContent(this.makeBuildPanelContent())
+      }
+    },
+    // 切换地图按钮操作
+    changeBuild(b) {
+      this.buildNo = b
+      this.buildPanel.setContent(this.makeBuildPanelContent())
+
+      this.buildData = this.locationData.BuildList[this.buildNo]
+
+      this.floorNo = this.buildData.DefaultFloor
+      if (this.buildData.FloorList[this.floorNo].No instanceof Array) {
+        this.floorNoArray = this.buildData.FloorList[this.floorNo].No
+      } else {
+        this.floorNoArray = [this.buildData.FloorList[this.floorNo].No]
+      }
+
+      this.baseRelativeCoordinate0 = new maptalks.Coordinate(this.buildData.RelativeCoordinate0)
+      this.baseRelativeCoordinate1 = new maptalks.Coordinate(this.buildData.RelativeCoordinate1)
+      this.baseRelativeExtent = new maptalks.Extent(
+        this.baseRelativeCoordinate0,
+        this.baseRelativeCoordinate1
+      )
+
+      if (this.buildData.MultiMap) {
+        this.postExtent = [
+          this.baseRelativeCoordinate0.x,
+          this.baseRelativeCoordinate0.y,
+          this.baseRelativeCoordinate1.x,
+          this.baseRelativeCoordinate1.y,
+        ]
+      } else {
+        this.postExtent = null
+      }
+
+      if (this.buildData.Projection == 'identity') {
+        this.baseExtent = new maptalks.Extent(
+          new maptalks.Coordinate(0, 0),
+          new maptalks.Coordinate(
+            this.baseRelativeCoordinate1.x - this.baseRelativeCoordinate0.x,
+            this.baseRelativeCoordinate0.y - this.baseRelativeCoordinate1.y
+          )
+        )
+      } else {
+        this.baseGPSCoordinate0 = new maptalks.Coordinate(this.buildData.GPSCoordinate0)
+        this.baseGPSCoordinate1 = new maptalks.Coordinate(this.buildData.GPSCoordinate1)
+        this.baseGPSExtent = new maptalks.Extent(this.baseGPSCoordinate0, this.baseGPSCoordinate1)
+        this.baseExtent = this.baseGPSExtent
+      }
+
+      if (this.mqttClient && this.mqttClient.connected) {
+        if (this.topicArray && this.topicArray.length > 0) {
+          this.topicArray.push(this.topicCount)
+          this.mqttClient.unsubscribe(this.topicArray, () => {
+            if (this.personLayer) this.personLayer.clear()
+            this.createMap()
+          })
+          return
+        }
+      }
+
+      this.createMap()
+    },
+    // 创建右下楼层切换按钮模块
+    createFloorPanel() {
+      if (this.floorNo <= 1) {
+        this.floorPanelPos = 0
+      } else if (this.floorNo >= this.buildData.FloorList.length - 3) {
+        this.floorPanelPos = this.buildData.FloorList.length - 3
+      } else {
+        this.floorPanelPos = this.floorNo - 1
+      }
+
+      let mapdiv = document.getElementById('map')
+      let mapdivh = mapdiv.clientHeight || mapdiv.offsetHeight
+
+      if (this.floorPanel) this.floorPanel.remove()
+
+      this.floorPanel = new maptalks.control.Panel({
+        position: { top: mapdivh / 2 - 60, right: '20' },
+        draggable: false,
+        custom: true,
+        content: this.makeFloorPanelContent(),
+        closeButton: false,
+      }).addTo(this.map)
+    },
+    // 楼层选择按钮模块页面内容生成
+    makeFloorPanelContent() {
+      let content
+      content = '<table class="map-floorpanel" cellpadding="0" frame=void rules=none>'
+      content +=
+        '<tr><td><button onclick="moveFloorPanel(0)"><div class="up-arrows"></div></button></td></tr>'
+      for (let i = this.floorPanelPos; i <= this.floorPanelPos + 2; i++) {
+        if (i == this.floorNo) {
+          content +=
+            '<tr><td><button style="background: rgb(28,188,156)">' +
+            this.buildData.FloorList[i].Name +
+            '</button></td></tr>'
+        } else {
+          if (this.buildData.FloorList[i]) {
+            content +=
+              '<tr><td><button onclick="changeFloor(' +
+              i +
+              ')">' +
+              this.buildData.FloorList[i].Name +
+              '</button></td></tr>'
+          } else {
+            content += '<tr><td><button></button></td></tr>'
+          }
+        }
+      }
+
+      content +=
+        '<tr><td><button onclick="moveFloorPanel(1)"><div class="down-arrows"></div></button></td></tr>'
+      content += '</table>'
+      return content
+    },
+    // 点击切换楼层按钮上下箭头
+    moveFloorPanel(s) {
+      let f = this.floorPanelPos
+      if (s == 0) {
+        if (f > 0) f--
+      } else if (s == 1) {
+        if (f < this.buildData.FloorList.length - 3) f++
+      }
+      if (f != this.floorPanelPos) {
+        this.floorPanelPos = f
+        this.floorPanel.setContent(this.makeFloorPanelContent())
+      }
+    },
+    // 点击切换楼层
+    changeFloor(f) {
+      this.floorNo = f
+      this.floorPanel.setContent(this.makeFloorPanelContent())
+
+      if (this.buildData.FloorList[this.floorNo].No instanceof Array) {
+        this.floorNoArray = this.buildData.FloorList[this.floorNo].No
+      } else {
+        this.floorNoArray = [this.buildData.FloorList[this.floorNo].No]
+      }
+
+      if (this.mqttClient && this.mqttClient.connected) {
+        if (this.topicArray && this.topicArray.length > 0)
+          this.mqttClient.unsubscribe(this.topicArray, () => {
+            if (this.personLayer) this.personLayer.clear()
+            this.startMQTT()
+          })
+      }
+
+      this.mapLayer.setImages([
+        {
+          url: this.buildData.FloorList[this.floorNo].MapPath,
+          extent: this.baseExtent,
+          opacity: 1,
+        },
+      ])
+      this.getRail()
+      this.getCamera()
+    },
+    // 右下角信息栏显示内容生成
+    update(e) {
+      let projection = this.map.getProjection()
+      let coordinate = e.coordinate,
+        prj = projection.project(coordinate)
+
+      this.debugPanel.setContent(
+        '<div class="map-debugpanel">' +
+          [
+            'Coordinate : [' + coordinate.x.toFixed(5) + ', ' + coordinate.y.toFixed(5) + ']',
+            'Projected Coordinate : [' + prj.x.toFixed(5) + ', ' + prj.y.toFixed(5) + ']',
+            'Zoom : ' + this.map.getZoom(),
+          ].join('<br>') +
+          '</div>'
+      )
+    },
+
+    addPerson(person) {
+      let marker = new maptalks.Marker(
+        this.getNewCoordinate(person.Positioning.X, person.Positioning.Y),
+        {
+          id: person.Id,
+          visible: true,
+          symbol: [
+            {
+              markerFile: this.VUE_APP_BASE_API + person.IconPath,
+              markerWidth: 40,
+              markerHeight: 40,
+              markerDx: 0,
+              markerDy: 20,
+              textName: person.Name,
+              textDx: 0,
+              textDy: 20,
+            },
+            {
+              textName: '',
+              textWeight: 'bold',
+              textStyle: 'normal',
+              textSize: 0,
+              textFill: '#FF0000',
+              textOpacity: 1,
+              textDx: 0,
+              textDy: -20,
+            },
+          ],
+          properties: {
+            id: person.Id,
+            name: person.Name,
+          },
+        }
+      ).addTo(this.personLayer)
+      marker.setInfoWindow({
+        title: person.Name,
+        width: 300,
+        autoCloseOn: 'click contextmenu',
+        content:
+          '<table width = "100%" style="border-bottom: 0px solid rgb(231, 234, 236) !important">\
+                        <tr>\
+                          <td width = "40%" rowspan="5" align="center">\
+                            <img src="' +
+          (person.PhotoPath
+            ? this.VUE_APP_BASE_API + person.PhotoPath
+            : 'static/images/default.png') +
+          '" style="width: 85px; height: 140px; object-fit: contain"/>\
+                          </td>\
+                          <td class="tdname">类型:</td>\
+                          <td class="tddata">' +
+          person.TypeName +
+          '</td>\
+                        <tr>\
+                          <td class="tdname">部门:</td>\
+                          <td class="tddata">' +
+          person.DepartmentName +
+          '</td>\
+                        </tr>\
+                        <tr>\
+                          <td class="tdname">职位:</td>\
+                          <td class="tddata">' +
+          person.PositionName +
+          '</td>\
+                        </tr>\
+                        <tr>\
+                          <td class="tdname">电话:</td>\
+                          <td class="tddata">' +
+          person.Telephone +
+          '</td>\
+                        </tr>\
+                        <tr>\
+                          <td class="tdname">SN:</td>\
+                          <td class="tddata">' +
+          person.LabelMAC +
+          '</td>\
+                        </tr>\
+                        <tr style="height:10px"/>\
+                     </table>',
+      })
+
+      this.personAlarming(person.Id)
+
+      return marker
+    },
+    personMove(geometry, person) {
+      geometry.animate(
+        {
+          translate: this.getOffset(geometry, person),
+        },
+        {
+          duration: 1000,
+        }
+      )
+    },
+    personAlarming(personId, repeat = false) {
+      let p = this.personLayer.getGeometryById(personId)
+      let pa = this.personAlarm[personId]
+
+      if (p) {
+        if (pa && pa.length > 0) {
+          if (!repeat) {
+            if (this.alarmingPerson.indexOf(personId) >= 0) return
+            else this.alarmingPerson.push(personId)
+          }
+
+          let str = ''
+          pa.forEach((v) => {
+            switch (v.AlarmType) {
+              case 11:
+                str += '越界(进入),'
+                break
+              case 12:
+                str += '越界(离开),'
+                break
+              case 20:
+                str += '滞留,'
+                break
+              case 50:
+                str += '静止,'
+                break
+              case 60:
+                str += 'SOS,'
+                break
+              default:
+                break
+            }
+          })
+          str = str.substr(0, str.length - 1)
+          if (p.getSymbol()[1].textName != str) {
+            p.updateSymbol([{}, { textName: str }])
+          }
+
+          if (p.getSymbol()[1].textSize == 0) {
+            p.updateSymbol([{}, { textSize: 16 }])
+          } else {
+            p.updateSymbol([{}, { textSize: 0 }])
+          }
+
+          setTimeout(() => {
+            this.personAlarming(personId, true)
+          }, 500)
+        } else {
+          let index = this.alarmingPerson.indexOf(personId)
+          if (index >= 0) this.alarmingPerson.splice(index, 1)
+          p.updateSymbol([{}, { textSize: 0 }])
+        }
+      }
+    },
+    railAlarming(railId, repeat = false) {
+      let r = this.railAlarmLayer.getGeometryById(railId)
+      let ra = this.railAlarm[railId]
+      let aa = this.arearailAlarm[railId]
+
+      if (r) {
+        if ((ra && ra.length > 0) || (aa && aa.length > 0)) {
+          if (!repeat) {
+            if (this.alarmingRail.indexOf(railId) >= 0) return
+            else this.alarmingRail.push(railId)
+          }
+
+          if (r.isVisible()) r.hide()
+          else r.show()
+          setTimeout(() => {
+            this.railAlarming(railId, true)
+          }, 500)
+        } else {
+          let index = this.alarmingRail.indexOf(railId)
+          if (index >= 0) this.alarmingRail.splice(index, 1)
+          r.hide()
+        }
+      }
+    },
+    getOffset(geometry, person) {
+      let start = geometry.getCoordinates()
+      let end = this.getNewCoordinate(person.Positioning.X, person.Positioning.Y)
+      return end.sub(start)
+    },
+    getNewCoordinate(x, y) {
+      if (this.buildData.Projection == 'identity') {
+        return new maptalks.Coordinate(
+          x - this.baseRelativeCoordinate0.x,
+          this.baseRelativeCoordinate0.y - y
+        )
+      } else {
+        return this.map.locate(
+          this.baseGPSCoordinate0,
+          (x - this.baseRelativeCoordinate0.x) / 1000,
+          -(y - this.baseRelativeCoordinate0.y) / 1000
+        )
+      }
+    },
+    identifyAndSelect(e) {
+      let _this = this
+      //identify
+      this.map.identify(
+        {
+          coordinate: e.coordinate,
+          layers: [this.personLayer, this.cameraLayer, this.perimeterLayer],
+        },
+        function (geos) {
+          if (geos.length === 0) {
+            _this.map.removeMenu()
+            return
+          }
+          var options = { items: [] }
+          geos.forEach(function (g) {
+            var personN = g.getProperties().name
+            options.items.push({
+              item: personN,
+              click: function () {
+                // console.log(g.toJSON());
+                //g.openInfoWindow()
+                g.fire('click')
+              },
+            })
+          })
+          _this.map.setMenu(options).openMenu(e.coordinate)
+        }
+      )
+    },
+  },
+}
+</script>
+
+<style lang="scss" scoped>
+.map-container {
+  width: 90%;
+  height: calc(40vh - 98px);
+}
+::v-deep #title {
+  width: 100%;
+  height: 50px;
+  display: table;
+  text-align: center;
+  background-color: #3c8dbc;
+  p {
+    margin: auto;
+    display: table-cell;
+    vertical-align: middle;
+    text-align: center;
+    color: white;
+    font-family: SimHei, STHeiti;
+    font-size: 25px;
+    font-weight: bold;
+    letter-spacing: 5px;
+  }
+}
+
+::v-deep .page-main {
+  position: absolute;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  overflow-y: auto;
+}
+
+::v-deep .left {
+  width: 20%;
+  height: 100%;
+  float: left;
+  background-color: #101c45;
+}
+
+::v-deep .right {
+  width: 20%;
+  height: 100%;
+  float: left;
+  background-color: #101c45;
+}
+
+::v-deep .map {
+  width: 100%;
+  height: 100%;
+  height: calc(100vh - 84px);
+  float: left;
+}
+
+::v-deep .map-debugpanel {
+  background: rgba(135, 196, 240, 0.8);
+  width: 450px;
+  height: 120px;
+  border: 2px #fff solid;
+  padding: 10px;
+  color: #fff;
+}
+
+::v-deep .map-debugpanel input {
+  color: #bbb;
+}
+
+::v-deep .map-debugpanel a {
+  color: #fff;
+  float: right;
+  margin-right: 15px;
+}
+
+::v-deep .map-floorpanel {
+  background: rgb(52, 73, 94);
+  width: 40px;
+  height: 120px;
+  padding: 0px;
+  color: #fff;
+  border: 0px solid rgb(231, 234, 236) !important;
+}
+
+::v-deep .map-floorpanel tr {
+  text-align: center;
+  height: 30px;
+}
+
+::v-deep .map-floorpanel td {
+  text-align: center;
+  height: 30px;
+}
+
+::v-deep .map-floorpanel button {
+  width: 40px;
+  height: 30px;
+  border: none;
+  background: rgb(52, 73, 94);
+  color: #fff;
+}
+
+::v-deep .map-buildpanel {
+  background: rgb(52, 73, 94);
+  width: 40px;
+  height: 120px;
+  padding: 0px;
+  color: #fff;
+  border: 0px solid rgb(231, 234, 236) !important;
+}
+
+::v-deep .map-buildpanel tr {
+  text-align: center;
+  height: 30px;
+}
+
+::v-deep .map-buildpanel td {
+  text-align: center;
+  height: 30px;
+}
+
+::v-deep .map-buildpanel button {
+  width: 40px;
+  height: 30px;
+  border: none;
+  background: rgb(52, 73, 94);
+  color: #fff;
+  font-size: 14px;
+  cursor: pointer;
+}
+
+::v-deep .up-arrows {
+  width: 0;
+  height: 0;
+  border-bottom: 20px solid white;
+  border-left: 10px solid transparent;
+  border-right: 10px solid transparent;
+  position: absolute;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+
+::v-deep .down-arrows {
+  width: 0;
+  height: 0;
+  border-top: 20px solid white;
+  border-left: 10px solid transparent;
+  border-right: 10px solid transparent;
+  position: absolute;
+  left: 50%;
+  transform: translate(-50%, -50%);
+}
+</style>

+ 85 - 39
src/views/robotSLG/robot/components/map/index.vue

@@ -1,6 +1,27 @@
 <template>
   <div>
     <div id="map" class="map-container"></div>
+    <div class="taskInfo" v-if="runningTask && runningTask.id !== '23'">
+      <div>
+        巡检任务名称: {{ runningTask.title }}
+        <div>
+          巡检总数:{{ runningTask.totalNumber }} 已检测:{{
+            runningTask.finishedNumber
+          }}
+          缺陷数量:{{ runningTask.defectNumber }} 未识别:
+          {{ runningTask.unrecognizeNumber }} 任务进度:
+          {{ (runningTask.progress >= 100) ? 100 : runningTask.progress }}%
+        </div>
+        <div>
+          当前巡检设备: {{ patrolRecord.indicatorName }} {{ patrolRecord.recognizeName }} 检测值
+          {{ patrolRecord.value }}
+        </div>
+      </div>
+    </div>
+    <div class="robotInfo" v-if="realltimeData && realltimeData.length > 0">
+      <div>云台水平转动角度:{{ realltimeData[0].panRotateAngleH }}</div>
+      <div>垂直水平转动角度:{{ realltimeData[0].panRotateAngleV }}</div>
+    </div>
     <!-- <countarea-panel
       :buildid="tbuildId"
       :countdic="countDic"
@@ -99,10 +120,10 @@ export default {
 
       //机器人修改
       robotToken: '',
-      patrolRecord: [],
+      patrolRecord: {},
       realltimeData: [],
       naviList: [],
-      runningTaskList: [],
+      runningTask: null,
     }
   },
   computed: {
@@ -124,16 +145,14 @@ export default {
     //机器人相关
     this.initRobotInfo().then(() => {
       this.getNaviListOption().then(() => {
-        this.addRobotNav() //添加机器人
         this.getRunningTask()
       })
       // 获取正在执行巡检任务
       setInterval(() => {
-        if (this.runningTask == null || this.runningTask.id === '23') {
-          console.log('寻找执行中任务')
-          this.getRunningTask()
-        }
-      }, 5000)
+        this.getRunningTask()
+        //获取机器人实时信息
+        this.getRealltimeROption()
+      }, 1000)
     })
   },
   mounted() {
@@ -146,9 +165,9 @@ export default {
       }
     })
   },
-  beforeDestroy() {
-    this.mqttClient?.end()
-  },
+  // beforeDestroy() {
+  //   this.mqttClient?.end()
+  // },
   methods: {
     // 机器人登录获取token
     async initRobotInfo() {
@@ -160,25 +179,41 @@ export default {
       } catch (error) {}
     },
     //机器人最新巡检记录实时信息
-    async getPatrolRealltimeROption() {
+    async getRealltimeROption() {
       try {
         let res = await getRealtimeList({
           token: this.robotToken,
           pageIndex: 1,
-          pageSize: 100,
-          robotId: this.patrolRecord.id,
+          pageSize: 2,
+          robotId: 1,
+          minReportTime: this.formatDateTime(),
         })
         if (res.code === 1) {
           this.realltimeData = res.data.list
-          console.log('实时信息')
-          console.log(this.realltimeData)
+          // console.log('实时信息')
+          // console.log(this.realltimeData)
+          if (this.realltimeData && this.realltimeData.length > 0) {
+            this.chengeRobot(this.realltimeData[0])
+          }
         } else {
           this.initRobotInfo()
         }
         PatrolR
       } catch (error) {}
     },
-
+    //时间函数
+    formatDateTime() {
+      var date = new Date() //1. js获取当前时间
+      var y = date.getFullYear()
+      var m = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
+      var d = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
+      var h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
+      var f = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
+      var s = date.getSeconds() < 10 ? '0' + date.getseconds() : date.getSeconds()
+      var formatdate = y + '-' + m + '-' + d + ' ' + h + ':' + f + ':' + s
+      // console.log(formatdate) // 获取当前时间,格式为yyyy-mm-dd h:f:s
+      return formatdate
+    },
     //机器人导航点数据
     async getNaviListOption() {
       try {
@@ -204,13 +239,13 @@ export default {
         })
         if (res.code === 1) {
           if (res.data.list && res.data.list.length > 0) {
-            this.runningTaskList = res.data.list[0]
-            // console.log(this.runningTaskList)
-            if (this.runningTaskList.id !== '23') {
+            this.runningTask = res.data.list[0]
+            // console.log(this.runningTask)
+            if (this.runningTask.id !== '23') {
               //更新地图为巡检任务点
               this.showTaskPoint()
               //实时获取任务对应巡检记录更新导航点状态
-              this.getPatrolRecordROption(this.runningTaskList)
+              this.getPatrolRecordROption(this.runningTask.id)
             }
           }
         } else {
@@ -226,21 +261,17 @@ export default {
           token: this.robotToken,
           pageIndex: 1,
           pageSize: 100,
-          taskIdList: [c.id],
+          taskIdList: [c],
           // taskIdList: ["4121"],
         })
         if (res.code === 1) {
           this.patrolRecord = res.data.list[0]
-          console.log('记录信息')
           console.log(this.patrolRecord)
           //根据最新巡检记录更新导航点状态
           this.updateTaskPointState()
-          // this.chengeRobot(this.)
-          this.getPatrolRealltimeROption()
         } else {
           this.initRobotInfo()
         }
-        PatrolR
       } catch (error) {}
     },
     //导航图层添加所有导航点
@@ -274,8 +305,8 @@ export default {
     },
     //显示任务点
     showTaskPoint() {
-      if (this.runningTaskList) {
-        this.runningTaskList.positionList.forEach((a) => {
+      if (this.runningTask) {
+        this.runningTask.positionList.forEach((a) => {
           let p = this.robotNavLayer.getGeometryById(a.naviId)
           // console.log(p)
           p.options.visible = true
@@ -294,29 +325,26 @@ export default {
           markerDx: 0,
           markerDy: 20,
         })
-
         return marker
       }
     },
     //初始化机器人位置
-    addRobotNav() {
+    addRobotNav(robot) {
       //获取一个初始点
-      if (this.naviList) {
-        let p = this.naviList[0]
+      if (robot) {
         let marker = new maptalks.Marker(
-          this.getNewCoordinate(+p.coordinateY * 100, +p.coordinateX * 100),
+          this.getNewCoordinate(+robot.coordinateY * 100, +robot.coordinateX * 100),
           {
-            id: p.Id,
+            id: robot.robotId,
             visible: true,
             symbol: [
               {
                 markerFile: this.VUE_APP_BASE_API + '/../static/images/robot.svg',
-                // markerFile: this.VUE_APP_BASE_API + '/../static/images/waitP.svg',
                 markerWidth: 40,
                 markerHeight: 40,
                 markerDx: 0,
                 markerDy: 20,
-                textName: p.alias,
+                // textName: robot.robot,
                 textDx: 0,
                 textDy: 20,
               },
@@ -332,8 +360,8 @@ export default {
               },
             ],
             properties: {
-              id: p.Id,
-              name: p.alias,
+              id: robot.robotId,
+              name: robot.robot,
             },
           }
         ).addTo(this.robotLayer)
@@ -389,7 +417,7 @@ export default {
     },
     //
     chengeRobot(robot) {
-      let p = this.robotLayer.getGeometryById(robot.naviId)
+      let p = this.robotLayer.getGeometryById(robot.robotId)
       if (p) {
         p.animate(
           {
@@ -1565,6 +1593,24 @@ export default {
   width: 100%;
   height: calc(64vh - 98px);
 }
+.taskInfo {
+  position: absolute;
+  width: 100%;
+  height: 10%;
+  text-align: center;
+  color: #fff;
+  top: 5%;
+  // left: 7%;
+}
+.robotInfo {
+  position: absolute;
+  width: 26%;
+  height: 5%;
+  text-align: left;
+  color: #fff;
+  bottom: 5%;
+  right: 1%;
+}
 ::v-deep #title {
   width: 100%;
   height: 50px;

+ 163 - 38
src/views/robotSLG/robot/index.vue

@@ -4,18 +4,18 @@
       <div class="top-left">
         <div class="top-left-top">
           <Container2 :setting="setting.top_left_top">
-            <div class="video-kjg" v-show="cameraVisible1">
-              <!-- <image-video
+            <div class="video-kjg" v-if="cameraVisible1">
+              <image-video
                 :cameraData.sync="cameraKJG"
                 :visible.sync="cameraVisible1"
-              ></image-video> -->
+              ></image-video>
             </div>
           </Container2>
         </div>
         <div class="top-left-bottom">
           <Container2 :setting="setting.top_left_bottom">
-            <div class="video-hw" v-show="cameraVisible1">
-              <!-- <image-video :cameraData.sync="cameraHW" :visible.sync="cameraVisible1"></image-video> -->
+            <div class="video-hw" v-if="cameraVisible1">
+              <image-video :cameraData.sync="cameraHW" :visible.sync="cameraVisible1"></image-video>
             </div>
           </Container2>
         </div>
@@ -30,27 +30,35 @@
           <div class="alarm-container">
             <ul class="mete-top">
               <li>
-                <div title="849.70 Hpa "><label>气压:</label><span>849.70 Hpa</span></div>
+                <div title="pressure">
+                  <label>气压:</label><span>{{ weatherInfo.pressure }}</span>
+                </div>
               </li>
               <li>
-                <div title="2.56 m/s "><label>风速:</label><span>2.56 m/s</span></div>
+                <div title="windSpeed">
+                  <label>风速:</label><span>{{ weatherInfo.windSpeed }}</span>
+                </div>
               </li>
               <li>
-                <div title="东北 "><label>风向:</label><span>东北</span></div>
+                <div title="windDirect">
+                  <label>风向:</label><span>{{ weatherInfo.windDirect }}</span>
+                </div>
               </li>
               <li>
-                <div title="58.07 mm "><label>累计雨量:</label><span>58.07 mm</span></div>
+                <div title="rainfall">
+                  <label>累计雨量:</label><span>{{ weatherInfo.rainfall }}</span>
+                </div>
               </li>
             </ul>
             <ul class="mete-middle">
               <li>
                 <div class="plate"></div>
-                <p>27.92 ℃</p>
+                <p>{{ weatherInfo.tempreture }}</p>
                 <p>当前温度</p>
               </li>
               <li>
                 <div class="plate"></div>
-                <p>18.62 %RH</p>
+                <p>{{ weatherInfo.dampness }}</p>
                 <p>当前湿度</p>
               </li>
             </ul>
@@ -58,7 +66,7 @@
               <li>
                 <div>
                   <div class="plate2">
-                    <p class="val">0</p>
+                    <p class="val">{{ gasData.Methane }}</p>
                     <p class="unit">%LEL</p>
                   </div>
                   <p class="type">CH4</p>
@@ -67,7 +75,7 @@
               <li>
                 <div>
                   <div class="plate3">
-                    <p class="val">0</p>
+                    <p class="val">{{ gasData.CarbonMonoxide }}</p>
                     <p class="unit">ppm</p>
                   </div>
                   <p class="type">CO</p>
@@ -76,7 +84,7 @@
               <li>
                 <div>
                   <div class="plate2">
-                    <p class="val">0</p>
+                    <p class="val">{{ gasData.HydrogenSulfide }}</p>
                     <p class="unit">ppm</p>
                   </div>
                   <p class="type">H2S</p>
@@ -85,7 +93,7 @@
               <li>
                 <div>
                   <div class="plate3">
-                    <p class="val">0</p>
+                    <p class="val">{{ gasData.SulfurDioxide }}</p> 
                     <p class="unit">ppm</p>
                   </div>
                   <p class="type">SO2</p>
@@ -94,7 +102,7 @@
               <li>
                 <div>
                   <div class="plate2">
-                    <p class="val">0</p>
+                    <p class="val">{{ gasData.Oxygen }}</p>
                     <p class="unit">%VOL</p>
                   </div>
                   <p class="type">O2</p>
@@ -103,7 +111,7 @@
               <li>
                 <div>
                   <div class="plate3">
-                    <p class="val">--</p>
+                    <p class="val">{{ gasData.LaserCh4 }}</p>
                     <p class="unit">%LEL</p>
                   </div>
                   <p class="type">激光CH4</p>
@@ -121,7 +129,12 @@
             <div>
               <el-row>
                 <el-col :span="13" class="robot-info-left">
-                  <img style="width: 160px; height: 220px" />
+                  <el-image
+                    style="width: 160px; height: 220px"
+                    v-if="activeRobot.profile"
+                    :src="pictureUrl"
+                    lazy
+                  ></el-image>
                 </el-col>
                 <el-col :span="11" class="robot-info-right">
                   <el-select
@@ -147,7 +160,6 @@
                   <div>{{ activeRobot.func }}</div>
                   <div>充电状态:{{ activeRobot.deviceStatus === 1 ? '在线' : '离线' }}</div>
                   <div>电量:{{ activeRobot.battery }}%</div>
-                  <div>速度:{{ activeRobot.speed ? activeRobot.speed : '0m/s' }}</div>
                 </el-col>
               </el-row>
             </div>
@@ -170,7 +182,7 @@
               }"
             >
               <el-table-column label="导航点编号" prop="naviSequence" width="100" align="center" />
-              <el-table-column label="指标名称" prop="indicatorName" align="center" />
+              <el-table-column label="指标名称" prop="indicatorName" width="370" align="center" />
               <el-table-column label="巡检结果" prop="value" width="90" align="center" />
               <el-table-column label="巡检时间" prop="patrolTime" width="180" align="center" />
               <el-table-column label="告警等级" prop="defectGrade" width="100" align="center">
@@ -192,13 +204,13 @@
                 'text-align': 'center',
               }"
             >
-              <el-table-column label="编号" prop="id" align="center" />
+              <el-table-column label="编号" prop="id" width="130" align="center" />
               <!-- <el-table-column label="类型" prop="type" align="center" /> -->
-              <el-table-column label="开始时间" prop="beginTime" align="center" />
-              <el-table-column label="检测总数" prop="totalNumber" align="center" />
-              <el-table-column label="正常数量" prop="finishedNumber" align="center" />
-              <el-table-column label="缺陷数量" prop="defectNumber" align="center" />
-              <el-table-column label="未识别" prop="unrecognizeNumber" align="center" />
+              <el-table-column label="开始时间" prop="beginTime" width="190" align="center" />
+              <el-table-column label="检测总数" prop="totalNumber" width="130" align="center" />
+              <el-table-column label="正常数量" prop="finishedNumber" width="130" align="center" />
+              <el-table-column label="缺陷数量" prop="defectNumber" width="130" align="center" />
+              <el-table-column label="未识别" prop="unrecognizeNumber" width="130" align="center" />
             </el-table>
           </el-tab-pane>
         </el-tabs>
@@ -244,6 +256,7 @@ import {
   getRobotToken,
   getPatrolRecordList,
   getAlarmList,
+  getGasWeatherList,
 } from '@/api/robotSLG/public'
 
 export default {
@@ -407,6 +420,24 @@ export default {
 
       runningTask: null,
 
+      gasInfo: [],
+      gasData: {
+        Oxygen: 0,
+        CarbonMonoxide: 0,
+        SulfurDioxide: 0,
+        Methane: 0,
+        HydrogenSulfide: 0,
+        LaserCh4: 0,
+      },
+      weatherInfo: {
+        rainfall: '59.75mm',
+        tempreture: '17.52℃',
+        dampness: '24.52%RH',
+        pressure: '863.60Hpa',
+        windSpeed: '2.20m/s',
+        windDirect: '东南',
+      },
+
       mqttClient: null,
       topicArray: [],
       currData: {},
@@ -459,23 +490,25 @@ export default {
         this.getAlarmListOption()
         //获取在执行任务并进行在执行任务实时巡检表更新
         this.getRunningTaskListOption()
-        // setInterval(() => {
-        //   if (this.runningTask == null || this.runningTask.id === '23') {
-        //     this.getRunningTaskListOption()
-        //     console.log('123')
-        //   }
-        //   if (this.runningTask.id !== '23') {
-        //     this.getRunningPatrolRecordListOption(this.runningTask)
-        //     console.log('456')
-        //   }
-        // }, 3000)
+        setInterval(() => {
+          this.getGasOption()
+          this.getWeatherOption()
+          if (this.runningTask == null || this.runningTask.id === '23') {
+            this.getRunningTaskListOption()
+            // console.log('123')
+          }
+          if (this.runningTask.id !== '23') {
+            this.getRunningPatrolRecordListOption(this.runningTask)
+            // console.log('456')
+          }
+        }, 3000)
       })
     },
     // 机器人登录获取token
     async initRobotInfo() {
       try {
         let res = await getRobotToken(ROBOT)
-        console.log(res)
+        // console.log(res)
         if (res.code === 1) {
           this.robotToken = res.data
         }
@@ -489,6 +522,8 @@ export default {
           // console.log(res)
           this.robotList = res.data.list
           this.activeRobot = this.robotList[0]
+          this.pictureUrl =
+            'http://' + '172.16.214.237:8080' + '/robotPicture' + this.activeRobot.profile
         } else {
           this.initRobotInfo()
         }
@@ -496,6 +531,96 @@ export default {
     },
     selectActiveRobot(r) {
       this.activeRobot = r
+      this.pictureUrl =
+        'http://' + '172.16.214.237:8080' + '/robotPicture' + this.activeRobot.profile
+    },
+    //时间函数
+    formatDateTime() {
+      var date = new Date() //1. js获取当前时间
+      var y = date.getFullYear()
+      var m = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
+      var d = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
+      var h = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
+      var f = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
+      var s = date.getSeconds() < 10 ? '0' + date.getseconds() : date.getSeconds()
+      var formatdate = y + '-' + m + '-' + d + ' ' + h + ':' + f + ':' + s
+      // console.log(formatdate) // 获取当前时间,格式为yyyy-mm-dd h:f:s
+      return formatdate
+    },
+    // 获取气体数据
+    async getGasOption() {
+      try {
+        let res = await getGasWeatherList({
+          token: this.robotToken,
+          pageIndex: 1,
+          pageSize: 86400,
+          type: 'RobotGasSensor',
+          minReportTime: this.formatDateTime(),
+        })
+        if (res.code === 1) {
+          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)
+            this.getGasValue()
+          }
+        } else {
+          this.getRobotToken()
+        }
+      } catch (error) {}
+    },
+    // 获取天气数据
+    async getWeatherOption() {
+      try {
+        let res = await getGasWeatherList({
+          token: this.robotToken,
+          pageIndex: 1,
+          pageSize: 86400,
+          type: 'com.shenhaoinfo.wmr.equipment.bo.attachment.MicroWeatherDevice',
+          minReportTime: this.formatDateTime(),
+        })
+        if (res.code === 1) {
+          let list = res.data.list
+          if (list && list.length > 0) {
+            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)
+          }
+        } else {
+          this.getRobotToken()
+        }
+      } catch (error) {}
+    },
+    getGasValue() {
+      if (this.gasInfo && this.gasInfo.length > 0) {
+        this.gasInfo.forEach((d) => {
+          if (d.LaserCh4) {
+            this.gasData.LaserCh4 = d.LaserCh4
+          }
+          if (d.HydrogenSulfide) {
+            this.gasData.HydrogenSulfide = d.HydrogenSulfide
+          }
+          if (d.Methane) {
+            this.gasData.Methane = d.Methane
+          }
+          if (d.SulfurDioxide) {
+            this.gasData.SulfurDioxide = d.SulfurDioxide
+          }
+          if (d.CarbonMonoxide) {
+            this.gasData.CarbonMonoxide = d.CarbonMonoxide
+          }
+          if (d.Oxygen) {
+            this.gasData.Oxygen = d.Oxygen
+          }
+        })
+        console.log(this.gasData)
+      }
     },
     // 获取任务列表
     async getTaskListOption() {
@@ -537,7 +662,7 @@ export default {
         })
         if (res.code === 1) {
           this.patrolRecordList = res.data.list
-          console.log(this.patrolRecordList)
+          // console.log(this.patrolRecordList)
           this.itemKey = Math.random()
         } else {
           this.getRobotToken()

+ 0 - 803
src/views/robotSLG/robot2/index.vue

@@ -1,803 +0,0 @@
-<template>
-  <div class="app-container">
-    <!--工具栏-->
-    <div class="head-container">
-      <div v-if="crud.props.searchToggle">
-        <el-input
-          v-model="query.code"
-          clearable
-          size="small"
-          placeholder="输入可视对讲编号"
-          style="width: 160px"
-          class="filter-item"
-          @keyup.enter.native="crud.toQuery"
-        />
-        <el-input
-          v-model="query.name"
-          clearable
-          size="small"
-          placeholder="输入可视对讲名称"
-          style="width: 160px"
-          class="filter-item"
-          @keyup.enter.native="crud.toQuery"
-        />
-        <el-select
-          v-model="query.type"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择类型"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in optionsObj.VisualIntercomType"
-            :key="item.value"
-            :label="item.label"
-            :value="+item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.buildId"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择建筑名称"
-          class="filter-item"
-          style="width: 160px"
-          @change="handleChangeBuildId"
-        >
-          <el-option
-            v-for="item in optionsObj.Build"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.floorNo"
-          filterable
-          clearable
-          size="small"
-          placeholder="请选择楼层"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in optionsObj.FloorNo"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          />
-        </el-select>
-        <el-select
-          v-model="query.faceRecognition"
-          clearable
-          size="small"
-          placeholder="人脸识别"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in 2"
-            :key="item"
-            :label="item == '1' ? '是' : '否'"
-            :value="item == '1' ? true : false"
-          />
-        </el-select>
-        <el-select
-          v-model="query.enable"
-          clearable
-          size="small"
-          placeholder="启用状态"
-          class="filter-item"
-          style="width: 160px"
-          @change="crud.toQuery"
-        >
-          <el-option
-            v-for="item in 2"
-            :key="item"
-            :label="item == '1' ? '启用' : '禁用'"
-            :value="item == '1' ? true : false"
-          />
-        </el-select>
-        <rrOperation />
-      </div>
-      <crudOperation :permission="permission" />
-    </div>
-    <!-- 表单组件 -->
-    <el-dialog
-      append-to-body
-      :close-on-click-modal="false"
-      :before-close="crud.cancelCU"
-      :visible.sync="crudCU"
-      :title="crud.status.title"
-      width="1200px"
-    >
-      <el-row :gutter="40">
-        <el-col :span="8">
-          <el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
-            <el-form-item label="编号" prop="code">
-              <el-input v-model="form.code" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="名称" prop="name">
-              <el-input v-model="form.name" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="类型" prop="type">
-              <el-select v-model="form.type" size="small" class="filter-item" style="width: 280px">
-                <el-option
-                  v-for="item in optionsObj.VisualIntercomType"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="+item.value"
-                />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="建筑名称" prop="buildId">
-              <el-select
-                v-model="form.buildId"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-                disabled
-              >
-                <el-option
-                  v-for="item in optionsObj.Build"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="楼层" prop="floorNo">
-              <el-input
-                v-model="form.floorNo"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-                disabled
-              />
-            </el-form-item>
-            <el-form-item label="高度" prop="height">
-              <el-input
-                v-model="form.height"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="序列号" prop="sn">
-              <el-input v-model="form.sn" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="MAC地址" prop="mac">
-              <el-input v-model="form.mac" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="ip地址" prop="ip">
-              <el-input v-model="form.ip" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="端口号" prop="port">
-              <el-input v-model="form.port" size="small" class="filter-item" style="width: 280px" />
-            </el-form-item>
-            <el-form-item label="用户名" prop="userName">
-              <el-input
-                v-model="form.userName"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="密码" prop="password">
-              <el-input
-                v-model="form.password"
-                show-password
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="关联摄像头" prop="cameraID">
-              <el-select
-                v-model="form.cameraID"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-                filterable
-                clearable
-              >
-                <el-option
-                  v-for="item in optionsObj.Camera"
-                  :key="item.value"
-                  :label="item.label"
-                  :value="item.value"
-                />
-              </el-select>
-            </el-form-item>
-            <el-form-item label="人脸识别" prop="faceRecognition">
-              <el-switch
-                v-model="form.faceRecognition"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                :active-value="true"
-                :inactive-value="false"
-              >
-              </el-switch>
-            </el-form-item>
-            <el-form-item label="备注" prop="remark">
-              <el-input
-                v-model="form.remark"
-                size="small"
-                class="filter-item"
-                style="width: 280px"
-              />
-            </el-form-item>
-            <el-form-item label="启用" prop="enable">
-              <el-switch
-                v-model="form.enable"
-                active-color="#13ce66"
-                inactive-color="#ff4949"
-                :active-value="true"
-                :inactive-value="false"
-              >
-              </el-switch>
-            </el-form-item>
-          </el-form>
-        </el-col>
-        <el-col :span="16">
-          <relative-map
-            v-if="crudCU"
-            ref="relativeMap"
-            v-model="mapData"
-            drawShow
-            :buildFloor="buildFloor"
-            drawMode="Point"
-          />
-        </el-col>
-      </el-row>
-
-      <div slot="footer" class="dialog-footer">
-        <el-button type="text" @click="crud.cancelCU"> 取消 </el-button>
-        <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">
-          确认
-        </el-button>
-      </div>
-    </el-dialog>
-    <!--表格渲染-->
-    <el-table
-      ref="table"
-      v-loading="crud.loading"
-      :data="crud.data"
-      style="width: 100%"
-      @selection-change="crud.selectionChangeHandler"
-    >
-      <el-table-column type="selection" width="55" />
-      <el-table-column
-        v-for="item in visualIntercomConfigTableOptions"
-        :key="item.prop"
-        :label="item.label"
-        :prop="item.prop"
-        :width="item.width"
-        :align="item.align"
-        :fixed="item.fixed"
-        :sortable="item.sortable"
-      >
-      </el-table-column>
-      <!--   编辑与删除   -->
-      <el-table-column
-        v-if="checkPer(['admin', 'visualintercom:config:edit', 'visualintercom:config:del'])"
-        label="操作"
-        width="130px"
-        align="center"
-        fixed="right"
-      >
-        <template slot-scope="scope">
-          <udOperation :data="scope.row" :permission="permission" />
-        </template>
-      </el-table-column>
-    </el-table>
-    <!--分页组件-->
-    <pagination />
-  </div>
-</template>
-
-<script>
-import permission from '@/directive/permission'
-import crudVisualIntercom from '@/api/visualIntercom/config'
-import { getOptions } from '@/api/visualIntercom/public'
-import CRUD, { presenter, header, form, crud } from '@crud/crud'
-// import { crudOperation, rrOperation, udOperation, pagination } from '@crud'
-import crudComps from '@crud'
-import DateRangePicker from '@/components/DateRangePicker'
-import { visualIntercomConfigTableOptions } from '../tableConfig'
-import { initData } from '@/api/data'
-//import CameraMap from './cameraMap'
-import {
-  isPosNumber,
-  isNegNumber,
-  isNumber,
-  isPosInteger,
-  isNegInteger,
-  isInteger,
-} from '@/utils/validate'
-import RelativeMap from '@/components/RelativeMap'
-
-const defaultForm = {
-  id: '0',
-  code: '', //编号
-  name: '', //名称
-  type: '',
-  buildId: '', //建筑ID
-  floorNo: null, //楼层号
-  location: null, //坐标
-  height: 0, //高度
-  faceRecognition: false,
-  enable: true, //是否显示在GIS
-  sn: '', //序列号
-  mac: '', //mac地址
-  ip: '', //ip地址
-  port: '', //端口号
-  userName: '', //用户名
-  password: '', // 密码
-  cameraID: '', // 绑定摄像头
-  remark: '', //备注
-}
-
-export default {
-  name: 'Robot',
-  directives: { permission },
-  mixins: [presenter(), header(), form(defaultForm), crud()],
-  components: { ...crudComps, DateRangePicker, RelativeMap },
-  cruds() {
-    return CRUD({
-      title: '可视对讲配置',
-      url: 'visualIntercom/config/getPageListJson',
-      listOrder: [],
-      crudMethod: { ...crudVisualIntercom },
-      optShow: {
-        add: true,
-        edit: true,
-        del: true,
-        reset: true,
-        import: true,
-        export: true,
-      },
-      robotList: [
-        {
-          id: '', //主键ID
-          modelId: '', //模型ID
-          number: '', //设备编号
-          category: '', //设备类型
-          issueDate: '', //发售时间
-          sequence: '', //出厂号
-          title: '', //名称
-          profile: '', //头像
-          desc: '', //描述
-          func: '', //功能说明
-          battery: '', //剩余电量
-          deviceStatus: '', //设备状态
-          taskMode: '', //机器人任务执行模式
-          createTime: '', //创建时间
-        },
-      ],
-      recognizeTypeList: [
-        {
-          id: '', //主键ID
-          name: '', //识别类型名称
-          code: '', //编号
-          desc: '', //描述信息
-          createTime: '', //创建时间
-        },
-      ],
-      areaTree: {
-        id: '', //主键ID
-        parentId: '', //父节点ID
-        parent: '', //父节点名称
-        path: '', //区域树路径
-        level: '', //层级
-        sort: '', //排序比重值
-        name: '', //区域名称
-        memo: '', //备注
-        editor: '', //编辑人
-        createTime: '', //创建时间
-        subList: '', //下级区域节点
-        naviList: '', //下辖导航点
-      },
-      navPointList: [
-        {
-          id: '', //主键ID
-          robotId: '', //机器人ID
-          robot: '', //机器人名称
-          mapId: '', //地图ID
-          map: '', //地图名称
-          areaId: '', //区域ID
-          area: '', //区域名称
-          alias: '', //导航点别名
-          naviType: '', //导航点类型
-          sequence: '', //导航点编号
-          coordinateX: '', //横坐标
-          coordinateY: '', //纵坐标
-          yaw: '', //航向角
-          longitude: '', //经度
-          latitude: '', //维度
-          distance: '', //与原点距离
-          chargingDeviceId: '', //充电设备ID
-          positionCount: '', //巡检点个数
-          positionList: '', //巡检点列表
-          createTime: '', //创建时间
-        },
-      ],
-      patrolPostionList: [
-        {
-          id: '', //主键ID
-          robotId: '', //机器人ID
-          mapId: '', //地图ID
-          areaId: '', //区域ID
-          area: '', //区域名称
-          naviId: '', //导航点ID
-          naviSequence: '', //导航点别名
-          indicatorId: '', //指标ID
-          indicatorName: '', //指标名称
-          categoryId: '', //指标类目ID
-          categoryName: '', //指标类目名称
-          recognizeId: '', //识别类型ID
-          recognizeName: '', //识别类型名称
-          recognizeCode: '', //识别类型编码
-          regionSequence: '', //区域编号
-          panRotateAngleLocationH: '', //云台水平算法定位转动角度
-          panRotateAngleLocationV: '', //云台垂直算法定位转动角度
-          panRotateAngleRecognizeH: '', //云台水平算法识别转动角度
-          panRotateAngleRecognizeV: '', //云台垂直算法识别转动角度
-          visibleCameraLocationZoom: '', //可见光相机算法定位变焦
-          visibleCameraLocationFocus: '', //可见光相机算法定位聚焦
-          visibleCameraRecognizeZoom: '', //可见光相机算法识别变焦
-          visibleCameraRecognizeFocus: '', //可见光相机算法识别聚焦
-          infraredCameraRadiation: '', //红外相机辐射
-          infraredCameraZoom: '', //红外相机变焦
-          infraredCameraFocus: '', //红外相机聚焦
-          infraredDistance: '', //红外线距离
-          needFillLight: '', //是否开启补光灯
-          hasObstacle: '', //是否有障碍
-          recordVoiceSecond: '', //录音时间
-          cycleTaskPicturePtzStepDegree: '', //循环拍照的步长
-          cycleRangeDegree: '', //环测范围
-          cycleIsClockwise: '', //环测旋转方向
-          cyclePtzSpeed: '', //环测转动速度
-          sceneList: '', //已设置阈值场景列表
-          resourceList: [
-            {
-              id: '', //主键ID
-              mapId: '', //地图ID
-              naviId: '', //导航点ID
-              positionId: '', //巡检点ID
-              index: '', //序号
-              type: '', //资源类型
-              url: '', //资源路径
-              createTime: '', //创建时间
-            },
-          ], //算法资源列表
-          createTime: '', //创建时间
-        },
-      ],
-      taskList: [
-        {
-          //任务
-          id: '', //主键ID
-          periodicTaskId: '', //任务模板ID
-          orgId: '', //组织ID
-          robotId: '', //机器人Id
-          robot: '', //机器人名称
-          mapId: '', //地图ID
-          map: '', //地图名称
-          sceneId: '', //巡检场景ID
-          scene: '', //场景名称
-          title: '', //任务名称
-          type: '', //任务类型
-          taskFrom: '', //任务下发来源
-          priority: '', //任务优先级
-          exitOnPrior: '', //遇更高优先级任务提前终止
-          finalJob: '', //任务完成后指令
-          scheduleTime: '', //计划开始时间
-          beginTime: '', //任务开始时间
-          endTime: '', //任务结束时间
-          state: '', //任务状态
-          progress: '', //运行进度
-          totalNumber: '', //须检测总数
-          finishedNumber: '', //已检测总数
-          defectNumber: '', //缺陷总数
-          unrecognizeNumber: '', //未识别总数
-          areaList: '', //关联区域列表
-          positionList: '', //检测点列表
-          nextPosition: '', //当前任务下一个检测点位
-          editor: '', //编辑人
-          createTime: '', //创建时间
-        },
-      ],
-      patrolRecordList: [
-        {
-          id: '', //主键ID
-          orgId: '', //组织ID
-          robotId: '', //机器人ID
-          robot: '', //机器人名称
-          taskId: '', //任务ID
-          task: '', //任务名称
-          sceneId: '', //场景ID
-          scene: '', //场景名称
-          mapId: '', //地图ID
-          map: '', //地图名称
-          areaId: '', //区域ID
-          area: '', //区域名称
-          naviId: '', //导航点ID
-          naviSequence: '', //导航点编号
-          positionId: '', //巡检点ID
-          indicatorId: '', //指标ID
-          indicatorName: '', //指标名称
-          categoryId: '', //指标类目ID
-          categoryName: '', //指标类目名称
-          recognizeId: '', //识别类型ID
-          recognizeCode: '', //识别类型编码
-          recognizeName: '', //识别类型名称
-          unit: '', //单位
-          index: '', //序号
-          patrolTime: '', //巡检时间
-          recognizeState: '', //识别状态
-          thresholdId: '', //识别阈值ID
-          defectGrade: '', //缺陷等级
-          value: '', //检测值
-          detail: '', //检测值明细
-          adjustTime: '', //矫正时间
-          recognizeTime: '', //识别时间
-          modifiedGrade: '', //修正后等级
-          defectReview: '', //缺陷追溯
-          reviewMemo: '', //缺陷审核备注
-          reviewState: '', //缺陷处理状态
-          confirmTime: '', //缺陷确认时间
-          reviewerId: '', //缺陷确认人ID
-          reviewer: '', //缺陷确认人名
-          solveTime: '', //缺陷解决时间
-          solverId: '', //缺陷解决人ID
-          solver: '', //缺陷解决人名
-          guardLine: '', //警戒线
-          resourceList: [
-            {
-              index: '', //序号
-              type: '', //资源类型
-              originUrl: '', //原始资源路径
-              processedUrl: '', //已处理资源路径
-            },
-          ], //算法资源列表
-          createTime: '', //创建时间
-        },
-      ],
-
-      RobotRealtimeInfoList: [
-        {
-          id: '', //主键ID
-          orgId: '', //组织ID
-          robotId: '', //机器人ID
-          robot: '', //机器人名称
-          taskId: '', //任务ID
-          task: '', //任务名称
-          sceneId: '', //场景ID
-          scene: '', //场景名称
-          mapId: '', //地图ID
-          map: '', //地图名称
-          areaId: '', //区域ID
-          area: '', //区域名称
-          naviId: '', //导航点ID
-          naviSequence: '', //导航点编号
-          positionId: '', //巡检点ID
-          indicatorId: '', //指标ID
-          indicatorName: '', //指标名称
-          categoryId: '', //指标类目ID
-          categoryName: '', //指标类目名称
-          recognizeId: '', //识别类型ID
-          recognizeCode: '', //识别类型编码
-          recognizeName: '', //识别类型名称
-          unit: '', //单位
-          index: '', //序号
-          patrolTime: '', //巡检时间
-          recognizeState: '', //识别状态
-          thresholdId: '', //识别阈值ID
-          defectGrade: '', //缺陷等级
-          value: '', //检测值
-          detail: '', //检测值明细
-          adjustTime: '', //矫正时间
-          recognizeTime: '', //识别时间
-          modifiedGrade: '', //修正后等级
-          defectReview: '', //缺陷追溯
-          reviewMemo: '', //缺陷审核备注
-          reviewState: '', //缺陷处理状态
-          confirmTime: '', //缺陷确认时间
-          reviewerId: '', //缺陷确认人ID
-          reviewer: '', //缺陷确认人名
-          solveTime: '', //缺陷解决时间
-          solverId: '', //缺陷解决人ID
-          solver: '', //缺陷解决人名
-          guardLine: '', //警戒线
-          resourceList: [
-            {
-              id: '', //主键ID
-              orgId: '', //组织ID
-              robotId: '', //机器人ID
-              robot: '', //机器人名称
-              mapId: '', //地图ID
-              health: '', //机器人本体是否正常
-              reportTime: '', //上报时间
-              leftWheelSpeed: '', //左轮速度
-              rightWheelSpeed: '', //右轮速度
-              speed: '', //实时速度
-              angularSpeed: '', //实时角速度
-              cpuUsed: '', //CPU使用率
-              memUsed: '', //内存使用率
-              diskUsed: '', //磁盘使用率
-              batteryRatio: '', //剩余电量比率
-              batteryVolt: '', //当前电池电压
-              batteryCurrent: '', //当前电池电流
-              temperature: '', //舱内温度
-              humidity: '', //舱内湿度
-              mileage: '', //当前行驶里程
-              rotation: '', //当前旋转角度
-              direction: '', //当前行驶方向
-              distance: '', //距原点距离
-              laserDistance: '', //激光距离
-              panRotateAngleH: '', //云台水平转动角度
-              panRotateAngleV: '', //云台垂直转动角度
-              visibleFocus: '', //可见光相机焦距
-              visibleZoom: '', //可见光相机变焦
-              infraredFocus: '', //红外相机焦距
-              coordinateX: '', //横坐标
-              coordinateY: '', //纵坐标
-              yaw: '', //航向角
-              longitude: '', //经度
-              latitude: '', //维度
-              controlSysState: '', //控制系统状态
-              chargeSysState: '', //充电系统状态
-              visibleCameraState: '', //可见光相机状态
-              infraredCameraState: '', //红外相机状态
-              panState: '', //云台状态
-              bridgeState: '', //网桥状态
-              laserObstacleState: '', //激光避障器状态
-              mmwObstacleState: '', //毫米波避障器状态
-              backObstacleState: '', //后置避障器状态
-              pitObstacleState: '', //测坑避障器状态
-              wiperState: '', //雨刷状态
-              lightState: '', //补光灯状态
-              recordState: '', //录音状态
-              intercomState: '', //对讲机状态
-              eStopState: '', //急停按钮状态
-              runState: '', //机器人运行状态
-              taskMode: '', //机器人任务执行模式
-              createTime: '', //创建时间
-            },
-          ], //算法资源列表
-          createTime: '', //创建时间
-        },
-      ],
-    })
-  },
-  computed: {
-    crudCU() {
-      return this.crud.status.cu > 0
-    },
-    VUE_APP_BASE_API() {
-      return process.env.VUE_APP_BASE_API
-    },
-    VUE_APP_BASE_WS() {
-      return 'ws://' + window.location.host + process.env.VUE_APP_BASE_API
-    },
-  },
-  data() {
-    var chackHeight = (rule, value, callback) => {
-      if (!isPosNumber(value)) return callback(new Error('请输入正确的高度'))
-      return callback()
-    }
-    return {
-      visualIntercomConfigTableOptions,
-      permission: {
-        add: ['admin', 'visualintercom:config:add'],
-        edit: ['admin', 'visualintercom:config:edit'],
-        del: ['admin', 'visualintercom:config:del'],
-      },
-      rules: {
-        code: [{ required: true, message: '请选输入编号', trigger: 'blur' }],
-        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
-        type: [{ required: true, message: '选择类型', trigger: 'blur' }],
-        buildId: [{ required: true, message: '请在地图上画点', trigger: 'blur' }],
-        floorNo: [{ required: true, message: '请在地图上画点', trigger: 'blur' }],
-        height: [{ required: true, validator: chackHeight, trigger: 'blur' }],
-        ip: [{ required: true, message: '请输入IP地址', trigger: 'blur' }],
-        userName: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
-      },
-      optionsObj: {
-        Camera: [],
-        Build: [],
-        FloorNo: [],
-        VisualIntercomType: [],
-      },
-      mapData: [],
-      buildFloor: {},
-    }
-  },
-  created() {
-    this.getOptions()
-  },
-  methods: {
-    [CRUD.HOOK.beforeToAdd]() {
-      this.mapData = []
-      this.buildFloor = {}
-    },
-    // 打开
-    [CRUD.HOOK.beforeToEdit]() {
-      this.mapData = [
-        {
-          buildId: this.form.buildId,
-          floorNo: this.form.floorNo,
-          geometries: [
-            {
-              type: 'Point',
-              points: [{ x: this.form.location.x, y: this.form.location.y }],
-            },
-          ],
-        },
-      ]
-      this.buildFloor = {
-        buildId: this.form.buildId,
-        floorNo: this.form.floorNo,
-      }
-    },
-    //验证前处理
-    [CRUD.HOOK.beforeValidateCU]() {
-      if (
-        this.mapData &&
-        this.mapData.length > 0 &&
-        this.mapData[0].geometries &&
-        this.mapData[0].geometries.length > 0 &&
-        this.mapData[0].geometries[0].points &&
-        this.mapData[0].geometries[0].points.length > 0
-      ) {
-        this.form.buildId = this.mapData[0].buildId
-        this.form.floorNo = this.mapData[0].floorNo
-        this.form.location = {
-          buildId: this.mapData[0].buildId,
-          floorNo: this.mapData[0].floorNo,
-          x: this.mapData[0].geometries[0].points[0].x,
-          y: this.mapData[0].geometries[0].points[0].y,
-        }
-      } else {
-        this.$message.error('请绘制正确的点')
-        return false
-      }
-    },
-    // 提交前的验证
-    [CRUD.HOOK.afterValidateCU]() {},
-    async handleChangeBuildId(val) {
-      await this.getFloorNoOption(val)
-      this.crud.toQuery()
-    },
-    getOptions() {
-      Object.keys(this.optionsObj).forEach(async (key) => {
-        if (key == 'FloorNo') return
-        try {
-          let res = await getOptions(key)
-          if (res.code === 20000) this.optionsObj[key] = res.data.content
-        } catch (error) {
-          console.log(error)
-        }
-      })
-    },
-    async getFloorNoOption(buildId) {
-      try {
-        let res = await getOptions('FloorNo', { buildId: buildId })
-        if (res.code === 20000) {
-          this.optionsObj.FloorNo = res.data.content
-          this.query.floorNo = null
-        }
-      } catch (error) {}
-    },
-  },
-}
-</script>
-
-<style></style>