1
0

5 کامیت‌ها d077a3dcab ... 2dcbdc08b9

نویسنده SHA1 پیام تاریخ
  fbw 2dcbdc08b9 机器人巡检页面表格样式调整 1 سال پیش
  fbw 126da0d49e 机器人监视页面样式微调 1 سال پیش
  fbw 3e7a205ed6 配置查询;报警等级配置 1 سال پیش
  fbw f383990db7 高后果区配置页面 1 سال پیش
  fbw 2d41fce7f8 机器人集成参数调整 1 سال پیش

+ 2 - 26
src/api/dataQuery/config.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 export function getColumnsAndFilters(data) {
   return request({
-    url: 'DataQueryManage/DataQuery/GetColumnsAndFilters',
+    url: 'DataQuery/DataQuery/GetColumnsAndFilters',
     method: 'post',
     data,
   })
@@ -10,7 +10,7 @@ export function getColumnsAndFilters(data) {
 
 export function setConfig(data) {
   return request({
-    url: 'DataQueryManage/DataQuery/SetConfig',
+    url: 'DataQuery/DataQuery/SetConfig',
     method: 'post',
     data: data,
   })
@@ -24,27 +24,3 @@ export function getDepartmentList(data) {
   })
 }
 
-export function add(data) {
-  return request({
-    url: 'risk/type/insert',
-    method: 'post',
-    data,
-  })
-}
-
-export function del(ids) {
-  return request({
-    url: 'risk/type/delete',
-    method: 'post',
-    data: ids,
-  })
-}
-export function edit(data) {
-  return request({
-    url: 'risk/type/update',
-    method: 'post',
-    data,
-  })
-}
-
-export default { add, edit, del }

+ 4 - 28
src/api/dataQuery/query.js

@@ -2,7 +2,7 @@ import request from '@/utils/request'
 
 export function getConfig(data) {
   return request({
-    url: 'DataQueryManage/DataQuery/GetConfig',
+    url: 'DataQuery/DataQuery/GetConfig',
     method: 'post',
     data,
   })
@@ -18,7 +18,7 @@ export function getDataValue(data) {
 
 export function getSelectOptions(data) {
   return request({
-    url: 'DataQueryManage/DataQuery/GetSelectOptions',
+    url: 'DataQuery/DataQuery/GetSelectOptions',
     method: 'post',
     data: data,
   })
@@ -26,7 +26,7 @@ export function getSelectOptions(data) {
 
 export function getData(data) {
   return request({
-    url: 'DataQueryManage/DataQuery/GetData',
+    url: 'DataQuery/DataQuery/GetData',
     method: 'post',
     data,
   })
@@ -34,33 +34,9 @@ export function getData(data) {
 
 export function exportData(data) {
   return request({
-    url: 'DataQueryManage/DataQuery/ExportData',
+    url: 'DataQuery/DataQuery/ExportData',
     method: 'post',
     data,
   })
 }
 
-export function add(data) {
-  return request({
-    url: 'risk/type/insert',
-    method: 'post',
-    data,
-  })
-}
-
-export function del(ids) {
-  return request({
-    url: 'risk/type/delete',
-    method: 'post',
-    data: ids,
-  })
-}
-export function edit(data) {
-  return request({
-    url: 'risk/type/update',
-    method: 'post',
-    data,
-  })
-}
-
-export default { add, edit, del }

+ 35 - 0
src/api/pipe/hca.js

@@ -0,0 +1,35 @@
+import request from '@/utils/request'
+
+export function getEntityFromCache(id) {
+  return request({
+      url: 'pipe/hca/getEntityFromCache',
+      method: 'post',
+      data: id
+  })
+}
+
+export function add(data) {
+  return request({
+    url: 'pipe/hca/insert',
+    method: 'post',
+    data
+  })
+}
+
+export function edit(data) {
+    return request({
+      url: 'pipe/hca/update',
+      method: 'post',
+      data
+    })
+  }
+
+export function del(ids) {
+  return request({
+    url: 'pipe/hca/delete',
+    method: 'post',
+    data: ids
+  })
+}
+
+export default { add, edit, del, getEntityFromCache }

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

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

+ 34 - 0
src/api/system/alarmLevelConfig.js

@@ -0,0 +1,34 @@
+import request from '@/utils/request'
+
+export function getJobList() {
+    return request({
+        url: 'system/alarmLevelConfig/getPageListJson',
+        method: 'post'
+    })
+}
+
+export function add(data) {
+    return request({
+        url: 'system/alarmLevelConfig/saveFormJson',
+        method: 'post',
+        data
+    })
+}
+
+export function del(ids) {
+    return request({
+        url: 'system/alarmLevelConfig/deleteFormJson',
+        method: 'post',
+        data: ids
+    })
+}
+
+export function edit(data) {
+    return request({
+        url: 'system/alarmLevelConfig/saveFormJson',
+        method: 'post',
+        data
+    })
+}
+
+export default { add, edit, del }

+ 9 - 2
src/layout/index.vue

@@ -38,7 +38,9 @@ export default {
   },
   mixins: [ResizeMixin],
   data() {
-    return {}
+    return {
+      path:'',
+    }
   },
   computed: {
     ...mapState({
@@ -62,8 +64,13 @@ export default {
       }
     },
   },
+  created() {
+    this.path = this.$route.path
+    // this.refreshCheckPath(this.path)
+    console.log("路由地址",this.$route)
+  },
   mounted() {
-    //console.log(this.$route)
+    console.log("路由地址",this.$route)
   },
   methods: {
     handleClickOutside() {

+ 212 - 28
src/views/dataComm/modbus/tag/index.vue

@@ -54,6 +54,22 @@
             :value="item.value"
           />
         </el-select>
+        <el-select
+          v-model="query.orginalDataType"
+          clearable
+          size="small"
+          placeholder="原始数据类型"
+          class="filter-item"
+          style="width: 120px"
+          @change="crud.toQuery"
+        >
+          <el-option
+            v-for="item in optionsObj.ModbusDataType"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          />
+        </el-select>
         <el-select
           v-model="query.dataType"
           clearable
@@ -133,7 +149,12 @@
             <el-input v-model="form.description" style="width: 400px" />
           </el-form-item>
           <el-form-item label="所属连接" prop="connId">
-            <el-select v-model="form.connId" style="width: 150px" placeholder="请选择" @change="handleConnIdChenge2">
+            <el-select
+              v-model="form.connId"
+              style="width: 150px"
+              placeholder="请选择"
+              @change="handleConnIdChenge2"
+            >
               <el-option
                 v-for="item in optionsObj.NetConn"
                 :key="item.value"
@@ -154,6 +175,21 @@
           </el-form-item>
         </el-row>
         <el-row>
+          <el-form-item label="原始数据类型" prop="orginalDataType">
+            <el-select
+              v-model="form.orginalDataType"
+              style="width: 150px"
+              placeholder="请选择"
+              @change="changeOrginalDataTypeHandle"
+            >
+              <el-option
+                v-for="item in optionsObj.ModbusDataType"
+                :key="item.value"
+                :label="item.label"
+                :value="+item.value"
+              />
+            </el-select>
+          </el-form-item>
           <el-form-item label="数据类型" prop="dataType">
             <el-select v-model="form.dataType" style="width: 150px" placeholder="请选择">
               <el-option
@@ -216,10 +252,35 @@
             <el-input v-model="form.unit" style="width: 150px" />
           </el-form-item>
           <el-form-item label="小数位数" prop="decimals">
-            <el-input-number v-model="form.decimals" controls-position="right" :min="1" :max="16" style="width: 150px" />
+            <el-input-number
+              v-model="form.decimals"
+              controls-position="right"
+              :min="1"
+              :max="16"
+              style="width: 150px"
+            />
+          </el-form-item>
+          <el-form-item label="数据转换" prop="dataConvertType">
+            <el-select v-model="form.dataConvertType" style="width: 150px" placeholder="请选择">
+              <el-option
+                v-for="item in optionsObj.dataConvertType"
+                :key="item.value"
+                :label="item.label"
+                :value="+item.value"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="转换系数" prop="dataConvertCoefficient">
+            <el-input v-model="form.dataConvertCoefficient" style="width: 150px" />
           </el-form-item>
           <el-form-item label="数据处理脚本" prop="valueScript">
-            <el-input v-model="form.valueScript" type="textarea" autosize clearable style="width: 400px" />
+            <el-input
+              v-model="form.valueScript"
+              type="textarea"
+              autosize
+              clearable
+              style="width: 400px"
+            />
           </el-form-item>
           <el-form-item label="数据启用" prop="enable">
             <el-switch
@@ -263,17 +324,108 @@
             </el-form-item>
           </template>
           <template v-if="!(form.dataType === 1 || form.dataType === 10)">
-            <el-form-item label="高报" prop="hAlarm">
-              <el-input v-model="form.hAlarm" style="width: 150px" />
+            <el-form-item label="高报启用" prop="hAlarmEnable">
+              <el-switch
+                v-model="form.hAlarmEnable"
+                active-color="#409EFF"
+                inactive-color="#E8E8E8"
+                :active-value="true"
+                :inactive-value="false"
+                style="width: 50px"
+              />
+            </el-form-item>
+            <el-form-item label="限值" prop="hAlarm" label-width="50px">
+              <el-input v-model="form.hAlarm" style="width: 80px" />
             </el-form-item>
-            <el-form-item label="高高报" prop="hhAlarm">
-              <el-input v-model="form.hhAlarm" style="width: 150px" />
+            <el-form-item label="报警等级" prop="hAlarmLevel" label-width="80px">
+              <el-select v-model="form.hAlarmLevel" style="width: 120px" placeholder="请选择">
+                <el-option
+                  v-for="item in optionsObj.alarmLevel"
+                  :key="item.id"
+                  :label="item.alarmLevelStr"
+                  :value="item.id"
+                >
+                  <span>
+                    <span>{{ item.alarmLevelStr }}</span>
+                    <span>
+                      {{
+                        !!item.alarmType
+                          ? `(${item.alarmCategoryStr}/${item.alarmTypeStr})`
+                          : `(${item.alarmCategoryStr})`
+                      }}
+                    </span>
+                  </span>
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="高高报启用" prop="hAlarmEnable">
+              <el-switch
+                v-model="form.hhAlarmEnable"
+                active-color="#409EFF"
+                inactive-color="#E8E8E8"
+                :active-value="true"
+                :inactive-value="false"
+                style="width: 50px"
+              />
+            </el-form-item>
+            <el-form-item label="限值" prop="hhAlarm" label-width="50px">
+              <el-input v-model="form.hhAlarm" style="width: 80px" />
+            </el-form-item>
+            <el-form-item label="报警等级" prop="hhAlarmLevel" label-width="80px">
+              <el-select v-model="form.hhAlarmLevel" style="width: 120px" placeholder="请选择">
+                <el-option
+                  v-for="item in optionsObj.alarmLevel"
+                  :key="item.id"
+                  :label="item.alarmLevelStr"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="低报启用" prop="hAlarmEnable">
+              <el-switch
+                v-model="form.lAlarmEnable"
+                active-color="#409EFF"
+                inactive-color="#E8E8E8"
+                :active-value="true"
+                :inactive-value="false"
+                style="width: 50px"
+              />
             </el-form-item>
-            <el-form-item label="低报" prop="lAlarm">
-              <el-input v-model="form.lAlarm" style="width: 150px" />
+            <el-form-item label="限值" prop="lAlarm" label-width="50px">
+              <el-input v-model="form.lAlarm" style="width: 80px" />
             </el-form-item>
-            <el-form-item label="低低报" prop="llAlarm">
-              <el-input v-model="form.llAlarm" style="width: 150px" />
+            <el-form-item label="报警等级" prop="lAlarmLevel" label-width="80px">
+              <el-select v-model="form.lAlarmLevel" style="width: 120px" placeholder="请选择">
+                <el-option
+                  v-for="item in optionsObj.alarmLevel"
+                  :key="item.id"
+                  :label="item.alarmLevelStr"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="低低报启用" prop="hAlarmEnable">
+              <el-switch
+                v-model="form.llAlarmEnable"
+                active-color="#409EFF"
+                inactive-color="#E8E8E8"
+                :active-value="true"
+                :inactive-value="false"
+                style="width: 50px"
+              />
+            </el-form-item>
+            <el-form-item label="限值" prop="llAlarm" label-width="50px">
+              <el-input v-model="form.llAlarm" style="width: 80px" />
+            </el-form-item>
+            <el-form-item label="报警等级" prop="llAlarmLevel" label-width="80px">
+              <el-select v-model="form.llAlarmLevel" style="width: 120px" placeholder="请选择">
+                <el-option
+                  v-for="item in optionsObj.alarmLevel"
+                  :key="item.id"
+                  :label="item.alarmLevelStr"
+                  :value="item.id"
+                />
+              </el-select>
             </el-form-item>
             <el-form-item label="报警死区" prop="alarmDeadBand">
               <el-input v-model="form.alarmDeadBand" style="width: 150px" />
@@ -292,7 +444,13 @@
             />
           </el-form-item>
           <el-form-item label="模拟值" prop="simulationValue">
-            <el-input v-model="form.simulationValue" type="textarea" autosize clearable style="width: 400px" />
+            <el-input
+              v-model="form.simulationValue"
+              type="textarea"
+              autosize
+              clearable
+              style="width: 400px"
+            />
           </el-form-item>
         </el-row>
       </el-form>
@@ -324,7 +482,13 @@
       >
       </el-table-column>
       <el-table-column
-        v-if="checkPer(['admin', 'datacommunicationmanage:modbustag:edit', 'datacommunicationmanage:modbustag:del'])"
+        v-if="
+          checkPer([
+            'admin',
+            'datacommunicationmanage:modbustag:edit',
+            'datacommunicationmanage:modbustag:del',
+          ])
+        "
         label="操作"
         width="130px"
         align="center"
@@ -361,10 +525,13 @@ const defaultForm = {
   length: 1,
   tag: '',
   token: null,
+  orginalDataType: 8,
   dataType: 8,
   typeStr: '',
   unit: null,
   decimals: 3,
+  dataConvertType: "",
+  dataConvertCoefficient: 0,
   valueScript: '',
   alarmEnable: false,
   hhAlarm: 0,
@@ -377,6 +544,16 @@ const defaultForm = {
   isSimulation: false,
   simulationValue: '',
   enable: true,
+  hhAlarmEnable: false,
+  hAlarmEnable: false,
+  lAlarmEnable: false,
+  llAlarmEnable: false,
+  hhAlarmLevel: '',
+  hAlarmLevel: '',
+  lAlarmLevel: '',
+  llAlarmLevel: '',
+  openAlarmLevel: '',
+  closeAlarmLevel: '',
 }
 
 export default {
@@ -395,7 +572,7 @@ export default {
         edit: true,
         del: true,
         import: true,
-        export: true
+        export: true,
       },
     })
   },
@@ -407,6 +584,7 @@ export default {
         tag: [{ required: true, message: '请输入变量名', trigger: 'blur' }],
         deviceId: [{ required: true, message: '请选择所属设备', trigger: 'blur' }],
         dataType: [{ required: true, message: '请选择数据类型', trigger: 'blur' }],
+        orginalDataType: [{ required: true, message: '请选择原始数据类型', trigger: 'blur' }],
         function: [{ required: true, message: '请选择功能码', trigger: 'blur' }],
         address: [{ required: true, message: '请输入数据地址', trigger: 'blur' }],
         bitIndex: [{ required: true, message: '请输入位索引', trigger: 'blur' }],
@@ -422,10 +600,13 @@ export default {
         ModbusFunction: [],
         NetConn: [],
         BoolAlarmType: [],
+        ModbusDataType: [],
+        alarmLevel: [],
+        dataConvertType:[]
       },
       statusOpt: [
-          { label: '启用', value: true },
-          { label: '禁用', value: false }
+        { label: '启用', value: true },
+        { label: '禁用', value: false },
       ],
       deviceOpt1: [],
       deviceOpt2: [],
@@ -441,9 +622,12 @@ export default {
     this.getDeviceOptions1()
   },
   methods: {
-    [CRUD.HOOK.beforeToCU](){
+    [CRUD.HOOK.beforeToCU]() {
       this.getDeviceOptions2()
     },
+    changeOrginalDataTypeHandle() {
+      this.form.dataType = this.form.orginalDataType
+    },
     getOptions() {
       Object.keys(this.optionsObj).forEach(async (key) => {
         try {
@@ -465,20 +649,20 @@ export default {
     },
     async getDeviceOptions1() {
       try {
-          let res = await getOptions('device', { id: this.query.connId })
-          if (res.code === 20000) this.deviceOpt1 = res.data.content
-        } catch (error) {
-          console.log(error)
-        }
+        let res = await getOptions('device', { id: this.query.connId })
+        if (res.code === 20000) this.deviceOpt1 = res.data.content
+      } catch (error) {
+        console.log(error)
+      }
     },
     async getDeviceOptions2() {
       try {
-          let res = await getOptions('device', { id: this.form.connId })
-          if (res.code === 20000) this.deviceOpt2 = res.data.content
-        } catch (error) {
-          console.log(error)
-        }
-    }
+        let res = await getOptions('device', { id: this.form.connId })
+        if (res.code === 20000) this.deviceOpt2 = res.data.content
+      } catch (error) {
+        console.log(error)
+      }
+    },
   },
 }
 </script>

+ 57 - 54
src/views/dataQuery/query/config.vue

@@ -3,20 +3,20 @@
     <el-row>
       <el-col :span="12">
         <el-form-item label="数据库类型">
-          <el-select v-model="form.DBType">
+          <el-select v-model="form.dbType">
             <el-option label="MySql" value="MySql"> </el-option>
           </el-select>
         </el-form-item>
       </el-col>
       <el-col :span="12">
         <el-form-item label="页面标题">
-          <el-input v-model="form.Title"> </el-input>
+          <el-input v-model="form.title"> </el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-form-item label="SQL">
       <el-input
-        v-model="form.SqlString"
+        v-model="form.sqlString"
         type="textarea"
         :rows="5"
         v-on:change="sqlChange"
@@ -31,13 +31,13 @@
             content="直接写入sql的order by子句"
             placement="bottom-start"
           >
-            <el-input v-model="form.OrderBy"></el-input>
+            <el-input v-model="form.orderBy"></el-input>
           </el-tooltip>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="限制条数">
-          <el-input-number v-model="form.Limit" :min="1" :max="1000"></el-input-number>
+          <el-input-number v-model="form.limit" :min="1" :max="1000"></el-input-number>
         </el-form-item>
       </el-col>
     </el-row>
@@ -50,30 +50,30 @@
             content="开启分页后,限制条数设置无效"
             placement="bottom-start"
           >
-            <el-checkbox v-model="form.Pagination" size="mini"></el-checkbox>
+            <el-checkbox v-model="form.pagination" size="mini"></el-checkbox>
           </el-tooltip>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="每页条数">
-          <el-input-number v-model="form.PageSize" :min="1" :max="1000"></el-input-number>
+          <el-input-number v-model="form.pageSize" :min="1" :max="1000"></el-input-number>
         </el-form-item>
       </el-col>
       <el-col :span="9">
         <el-form-item label="条数选择">
-          <el-input v-model="form.PageSizeList"></el-input>
+          <el-input v-model="form.pageSizeList"></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="6">
         <el-form-item label="自动刷新变量">
-          <el-input v-model="form.RefreshKey"></el-input>
+          <el-input v-model="form.refreshKey"></el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-row>
       <el-col :span="3">
         <el-form-item label="数据导出">
-          <el-checkbox v-model="form.Export" size="mini"></el-checkbox>
+          <el-checkbox v-model="form.export" size="mini"></el-checkbox>
         </el-form-item>
       </el-col>
     </el-row>
@@ -81,24 +81,24 @@
       <el-col>
         <el-tabs v-model="tabName" type="card">
           <el-tab-pane label="列设置" name="columns">
-            <el-table border :data="form.Columns" :cell-style="{ padding: '1px' }">
+            <el-table border :data="form.columns" :cell-style="{ padding: '1px' }">
               <el-table-column label="显示" width="50" align="center">
                 <template slot-scope="scope">
-                  <el-checkbox v-model="scope.row.Show" size="mini"></el-checkbox>
+                  <el-checkbox v-model="scope.row.show" size="mini"></el-checkbox>
                 </template>
               </el-table-column>
               <el-table-column label="固定" width="50" align="center">
                 <template slot-scope="scope">
-                  <el-checkbox v-model="scope.row.Fixed" size="mini"></el-checkbox>
+                  <el-checkbox v-model="scope.row.fixed" size="mini"></el-checkbox>
                 </template>
               </el-table-column>
               <el-table-column label="导出" width="50" align="center">
                 <template slot-scope="scope">
-                  <el-checkbox v-model="scope.row.Export" size="mini"></el-checkbox>
+                  <el-checkbox v-model="scope.row.export" size="mini"></el-checkbox>
                 </template>
               </el-table-column>
               <el-table-column
-                prop="Prop"
+                prop="prop"
                 :show-overflow-tooltip="true"
                 label="字段名"
                 width="130"
@@ -107,17 +107,17 @@
               </el-table-column>
               <el-table-column label="标题" width="130" align="center">
                 <template slot-scope="scope">
-                  <el-input v-model="scope.row.Label" size="mini"></el-input>
+                  <el-input v-model="scope.row.label" size="mini"></el-input>
                 </template>
               </el-table-column>
               <el-table-column label="宽度" width="70" align="center">
                 <template slot-scope="scope">
-                  <el-input v-model="scope.row.Width" size="mini"></el-input>
+                  <el-input v-model="scope.row.width" size="mini"></el-input>
                 </template>
               </el-table-column>
               <el-table-column label="对齐" width="70" align="center">
                 <template slot-scope="scope">
-                  <el-select v-model="scope.row.Align" size="mini" placeholder="">
+                  <el-select v-model="scope.row.align" size="mini" placeholder="">
                     <el-option label="左" value="left"> </el-option>
                     <el-option label="中" value="center"> </el-option>
                     <el-option label="右" value="right"> </el-option>
@@ -127,7 +127,7 @@
             </el-table>
           </el-tab-pane>
           <el-tab-pane label="查询设置" name="filters">
-            <el-table border :data="form.Filters" :cell-style="{ padding: '1px' }">
+            <el-table border :data="form.filters" :cell-style="{ padding: '1px' }">
               <el-table-column
                 prop="Name"
                 :show-overflow-tooltip="true"
@@ -138,12 +138,12 @@
               </el-table-column>
               <el-table-column label="标签" width="110" align="center">
                 <template slot-scope="scope">
-                  <el-input v-model="scope.row.DisplayName" size="mini"></el-input>
+                  <el-input v-model="scope.row.displayName" size="mini"></el-input>
                 </template>
               </el-table-column>
               <el-table-column label="类型" width="100" align="center">
                 <template slot-scope="scope">
-                  <el-select v-model="scope.row.Type" size="mini" placeholder="">
+                  <el-select v-model="scope.row.type" size="mini" placeholder="">
                     <el-option label="输入框" value="input"> </el-option>
                     <el-option label="下拉框(单)" value="select"> </el-option>
                     <el-option label="下拉框(多)" value="select-multi"> </el-option>
@@ -154,16 +154,16 @@
               </el-table-column>
               <el-table-column label="默认值" width="100" align="center">
                 <template slot-scope="scope">
-                  <el-input v-model="scope.row.DefaultValue" size="mini"></el-input>
+                  <el-input v-model="scope.row.defaultValue" size="mini"></el-input>
                 </template>
               </el-table-column>
               <el-table-column label="数据源" width="80" align="center">
                 <template slot-scope="scope">
                   <el-select
-                    v-model="scope.row.DataSource"
+                    v-model="scope.row.dataSource"
                     size="mini"
                     placeholder=""
-                    :disabled="!scope.row.Type.startsWith('select')"
+                    :disabled="!scope.row.type.startsWith('select')"
                   >
                     <el-option label="固定值" value="string"> </el-option>
                     <el-option label="字典" value="dict"> </el-option>
@@ -177,14 +177,14 @@
                   <el-tooltip
                     class="item"
                     effect="dark"
-                    :disabled="scope.row.DataSource ? false : true"
-                    :content="tooltip.datasource[scope.row.DataSource]"
+                    :disabled="scope.row.dataSource ? false : true"
+                    :content="tooltip.datasource[scope.row.dataSource]"
                     placement="top"
                   >
                     <el-input
-                      v-model="scope.row.DataSourceExpression"
+                      v-model="scope.row.dataSourceExpression"
                       size="mini"
-                      :disabled="!scope.row.Type.startsWith('select')"
+                      :disabled="!scope.row.type.startsWith('select')"
                     ></el-input>
                   </el-tooltip>
                 </template>
@@ -198,11 +198,11 @@
                     placement="top"
                   >
                     <el-input
-                      v-model="scope.row.Dependency"
+                      v-model="scope.row.dependency"
                       size="mini"
                       :disabled="
-                        !scope.row.Type.startsWith('select') ||
-                        ['sql', 'dp'].indexOf(scope.row.DataSource) < 0
+                        !scope.row.type.startsWith('select') ||
+                        ['sql', 'dp'].indexOf(scope.row.dataSource) < 0
                       "
                     ></el-input>
                   </el-tooltip>
@@ -215,27 +215,27 @@
     </el-row>
     <el-form-item> </el-form-item>
     <el-form-item label="数据闪烁功能">
-      <el-checkbox v-model="form.Flash" size="mini"></el-checkbox>
+      <el-checkbox v-model="form.flash" size="mini"></el-checkbox>
     </el-form-item>
     <el-row>
       <el-col :span="7">
         <el-form-item label="闪烁列">
-          <el-input v-model="form.FlashColumn"></el-input>
+          <el-input v-model="form.flashColumn"></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="7">
         <el-form-item label="闪烁频率(ms)" label-width="130px">
-          <el-input v-model="form.FlashInterval"></el-input>
+          <el-input v-model="form.flashInterval"></el-input>
         </el-form-item>
       </el-col>
       <el-col :span="10">
         <el-form-item label="闪烁条件">
-          <el-input v-model="form.FlashFilter"></el-input>
+          <el-input v-model="form.flashFilter"></el-input>
         </el-form-item>
       </el-col>
     </el-row>
     <el-form-item label="闪烁颜色">
-      <el-input v-model="form.FlashColorFilter"></el-input>
+      <el-input v-model="form.flashColorFilter"></el-input>
     </el-form-item>
     <el-row>
       <el-col> </el-col>
@@ -254,12 +254,12 @@ export default {
     return {
       tabName: 'columns',
       form: {
-        ConfigName: 'alarmreal',
-        DBType: 'MySql',
-        SqlString: '',
-        ConnectionString: '',
-        Columns: [],
-        Filters: [],
+        configName: 'alarmreal',
+        dbType: 'MySql',
+        sqlString: '',
+        connectionString: '',
+        columns: [],
+        filters: [],
       },
       tooltip: {
         datasource: {
@@ -275,17 +275,17 @@ export default {
     //sql变化后获取新的列
     sqlChange() {
       let p = {
-        configname: ys.request('configname'),
-        sql: this.form.SqlString,
-        connection: this.form.ConnectionString,
+        configname: this.form.configName,
+        sql: this.form.sqlString,
+        connection: this.form.connectionString,
       }
       let _this = this
       getColumnsAndFilters(p)
         .then(function (response) {
           let data = response.data
           console.log(data)
-          _this.form.Columns = data.columns
-          _this.form.Filters = data.filters
+          _this.form.columns = data.columns
+          _this.form.filters = data.filters
         })
         .catch(function (error) {
           console.log(error)
@@ -294,11 +294,11 @@ export default {
     saveForm(index) {
       console.log(this)
       let _this = this
-      if (this.form.PageSizeList) {
-        if (this.form.PageSizeList instanceof Array) {
-          this.form.PageSizeList = this.form.PageSizeList.join(',')
+      if (this.form.pageSizeList) {
+        if (this.form.pageSizeList instanceof Array) {
+          this.form.pageSizeList = this.form.pageSizeList.join(',')
         }
-        this.form.PageSizeList = this.form.PageSizeList.split(',')
+        this.form.pageSizeList = this.form.pageSizeList.split(',')
       }
       setConfig(this.form)
         .then(function (response) {
@@ -318,7 +318,7 @@ export default {
     },
     loadConfig() {
       let _this = this
-      getConfig({ configname: ys.request('configname') })
+      getConfig({ configname: this.form.ConfigName })
         .then(function (response) {
           let data = response.data
           _this.form = data
@@ -337,10 +337,13 @@ export default {
           console.log(error)
         })
     },
+    getConfigName() {
+      return this.$parent.$parent.resolveConfigName()
+    },
   },
   mounted() {
-    // console.log(ys.request('configname'))
-    // this.loadConfig()
+    this.form.ConfigName = this.getConfigName()
+    this.loadConfig()
   },
 }
 </script>

+ 95 - 88
src/views/dataQuery/query/index.vue

@@ -3,29 +3,23 @@
     <el-container>
       <el-header>
         <el-card>
-          <el-form
-            :inline="true"
-            ref="searchform"
-            :model="config.filters"
-            label-width="100px"
-            size="mini"
-          >
+          <el-form :inline="true" ref="searchform" label-width="auto" size="mini">
             <el-form-item
-              v-for="(item, index) in config.Filters"
+              v-for="(item, index) in config.filters"
               :key="index"
-              :label="item.DisplayName"
+              :label="item.displayName"
             >
-              <el-input v-if="item.Type == 'input'" v-model="item.Value"></el-input>
+              <el-input v-if="item.type == 'input'" v-model="item.value"></el-input>
               <el-select
-                v-if="item.Type == 'select'"
-                v-model="item.Value"
+                v-if="item.type == 'select'"
+                v-model="item.value"
                 size="mini"
                 placeholder=""
                 clearable
                 v-on:change="loadData"
               >
                 <el-option
-                  v-for="item in item.Options"
+                  v-for="item in item.options"
                   :key="item.value"
                   :label="item.label"
                   :value="item.value"
@@ -33,16 +27,16 @@
                 </el-option>
               </el-select>
               <el-select
-                v-if="item.Type == 'select-multi'"
+                v-if="item.type == 'select-multi'"
                 multiple
-                v-model="item.Value"
+                v-model="item.value"
                 size="mini"
                 placeholder=""
                 clearable
                 v-on:change="loadData"
               >
                 <el-option
-                  v-for="item in item.Options"
+                  v-for="item in item.options"
                   :key="item.value"
                   :label="item.label"
                   :value="item.value"
@@ -50,8 +44,8 @@
                 </el-option>
               </el-select>
               <el-date-picker
-                v-if="item.Type == 'date'"
-                v-model="item.Value"
+                v-if="item.type == 'date'"
+                v-model="item.value"
                 format="yyyy-MM-dd"
                 value-format="yyyy-MM-dd"
                 type="date"
@@ -59,8 +53,8 @@
               >
               </el-date-picker>
               <el-date-picker
-                v-if="item.Type == 'datetime'"
-                v-model="item.Value"
+                v-if="item.type == 'datetime'"
+                v-model="item.value"
                 format="yyyy-MM-dd HH:mm:ss"
                 value-format="yyyy-MM-dd HH:mm:ss"
                 type="datetime"
@@ -69,7 +63,13 @@
               </el-date-picker>
             </el-form-item>
             <el-form-item>
-              <el-button type="primary" size="small" v-on:click="query">查询</el-button>
+              <el-button type="primary" size="mini" v-on:click="query">查询</el-button>
+              <el-button type="success" size="mini" v-on:click="openConfig" v-if="showConfig"
+                >配置</el-button
+              >
+              <el-button type="info" size="mini" v-on:click="exportExcel" v-show="config.export"
+                >导出</el-button
+              >
             </el-form-item>
             <el-form-item>
               <el-checkbox v-model="autoRefresh" size="mini">自动刷新</el-checkbox>
@@ -79,12 +79,7 @@
       </el-header>
       <el-main>
         <el-card>
-          <div style="padding-bottom: 5px">
-            <el-button type="success" size="mini" v-on:click="openConfig">配置</el-button>
-            <el-button type="info" size="mini" v-on:click="exportExcel" v-show="config.Export"
-              >导出</el-button
-            >
-          </div>
+          <div style="padding-bottom: 5px"></div>
           <el-table
             :data="tableData"
             border
@@ -99,21 +94,21 @@
             highlight-current-row
             v-on:current-change="handleCurrentChange"
           >
-            <template v-for="(item, index) in config.Columns">
+            <template v-for="(item, index) in config.columns">
               <el-table-column
-                v-if="item.Show"
+                v-if="item.show"
                 :key="index"
-                :prop="item.Prop"
-                :label="item.Label"
-                :align="item.Align"
-                :width="item.Width"
-                :fixed="item.Fixed"
+                :prop="item.prop"
+                :label="item.label"
+                :align="item.align"
+                :width="item.width"
+                :fixed="item.fixed"
                 :show-overflow-tooltip="true"
               >
               </el-table-column>
             </template>
           </el-table>
-          <div style="text-align: right; padding-top: 3px" v-if="config.Pagination">
+          <div style="text-align: right; padding-top: 3px" v-if="config.pagination">
             <el-pagination
               background
               v-on:current-change="handlePageChanged"
@@ -131,12 +126,12 @@
     <el-dialog
       append-to-body
       :close-on-click-modal="false"
-      :visible.sync="dialogVisible"
+      :visible="dialogVisible"
       title="配置"
       width="1000px"
       destroy-on-close
     >
-      <data-config ref="dataConfig" />
+      <data-config ref="dataConfig" :configName="configName" v-if="dialogVisible" />
       <div slot="footer" class="dialog-footer">
         <el-button type="text" @click="dialogVisible = false">取消</el-button>
         <el-button type="primary" @click="handleSave">确认</el-button>
@@ -159,6 +154,7 @@ export default {
   components: { DataConfig },
   data() {
     return {
+      configName: '', //查询配置名
       loading: false,
       autoRefresh: false,
       autoRefreshValue: '', //自动刷新的值
@@ -188,12 +184,13 @@ export default {
       timerID: null,
       dateConst: ['now', 'today', 'yestoday', 'yestoday-now'],
       dialogVisible: false,
+      showConfig: false,
     }
   },
   methods: {
     loadConfig() {
       let _this = this
-      getConfig({ configname: ys.request('configname') })
+      getConfig({ configname: _this.configName })
         .then(function (response) {
           console.log(response.data)
           let data = response.data
@@ -202,11 +199,11 @@ export default {
           _this.loadData()
           _this.parsingFlashFilter()
           _this.parsingFlashColor()
-          if (_this.config.Pagination) {
-            _this.pagination.pagesizes = _this.config.PageSizeList
-            _this.parameter.pageSize = _this.config.PageSize
+          if (_this.config.pagination) {
+            _this.pagination.pagesizes = _this.config.pageSizeList
+            _this.parameter.pageSize = _this.config.pageSize
           }
-          if (_this.config.Flash) {
+          if (_this.config.flash) {
             clearTimeout(_this.timerID)
             _this.doFlash()
             //_this.$nextTick().then(() => {
@@ -221,44 +218,44 @@ export default {
     },
     //初始化变量,主要针对日期关键字的解析
     initDefaultValue() {
-      let l = this.config.Filters.length
+      let l = this.config.filters.length
       for (let i = 0; i < l; i++) {
-        if (this.config.Filters[i].Type == 'date') {
+        if (this.config.filters[i].type == 'date') {
           if (
-            this.config.Filters[i].DefaultValue == 'now' ||
-            this.config.Filters[i].DefaultValue == 'today'
+            this.config.filters[i].defaultValue == 'now' ||
+            this.config.filters[i].defaultValue == 'today'
           ) {
-            this.config.Filters[i].Value = moment().format('YYYY-MM-DD')
+            this.config.filters[i].value = moment().format('YYYY-MM-DD')
           } else if (
-            this.config.Filters[i].DefaultValue == 'yestoday' ||
-            this.config.Filters[i].DefaultValue == 'yestoday-now'
+            this.config.filters[i].defaultValue == 'yestoday' ||
+            this.config.filters[i].defaultValue == 'yestoday-now'
           ) {
-            this.config.Filters[i].Value = moment().subtract(1, 'days').format('YYYY-MM-DD')
+            this.config.filters[i].value = moment().subtract(1, 'days').format('YYYY-MM-DD')
           }
-        } else if (this.config.Filters[i].Type == 'datetime') {
-          if (this.config.Filters[i].DefaultValue == 'now') {
-            this.config.Filters[i].Value = moment().format('YYYY-MM-DD HH:mm:ss')
-          } else if (this.config.Filters[i].DefaultValue == 'today') {
-            this.config.Filters[i].Value = moment().format('YYYY-MM-DD 00:00:00')
-          } else if (this.config.Filters[i].DefaultValue == 'yestoday-now') {
-            this.config.Filters[i].Value = moment()
+        } else if (this.config.filters[i].type == 'datetime') {
+          if (this.config.filters[i].defaultValue == 'now') {
+            this.config.filters[i].value = moment().format('YYYY-MM-DD HH:mm:ss')
+          } else if (this.config.filters[i].defaultValue == 'today') {
+            this.config.filters[i].value = moment().format('YYYY-MM-DD 00:00:00')
+          } else if (this.config.filters[i].defaultValue == 'yestoday-now') {
+            this.config.filters[i].value = moment()
               .subtract(1, 'days')
               .format('YYYY-MM-DD HH:mm:ss')
-          } else if (this.config.Filters[i].DefaultValue == 'yestoday') {
-            this.config.Filters[i].Value = moment()
+          } else if (this.config.filters[i].defaultValue == 'yestoday') {
+            this.config.filters[i].value = moment()
               .subtract(1, 'days')
               .format('YYYY-MM-DD 00:00:00')
           }
-        } else if (this.config.Filters[i].Type == 'select') {
-          if (this.config.Filters[i].DataSource == 'dp') {
-          } else if (this.config.Filters[i].DataSource == 'string') {
+        } else if (this.config.filters[i].type == 'select') {
+          if (this.config.filters[i].dataSource == 'dp') {
+          } else if (this.config.filters[i].dataSource == 'string') {
             this.loadStringOptions(i)
           } else {
             this.loadSqlOptions(i)
           }
-        } else if (this.config.Filters[i].Type == 'select-multi') {
-          if (this.config.Filters[i].DataSource == 'dp') {
-          } else if (this.config.Filters[i].DataSource == 'string') {
+        } else if (this.config.filters[i].type == 'select-multi') {
+          if (this.config.filters[i].dataSource == 'dp') {
+          } else if (this.config.filters[i].dataSource == 'string') {
             this.loadStringOptions(i)
           } else {
             this.loadSqlOptions(i)
@@ -267,8 +264,8 @@ export default {
       }
     },
     loadStringOptions(filterIndex) {
-      this.config.Filters[filterIndex].Options = JSON.parse(
-        this.config.Filters[filterIndex].DataSourceExpression
+      this.config.filters[filterIndex].options = JSON.parse(
+        this.config.filters[filterIndex].dataSourceExpression
       )
     },
     //为选择器载入dp中的维度数据
@@ -278,9 +275,9 @@ export default {
         .then((res) => {
           console.log(res) //在控制台输出获取的数据形式
           let o = res[dataid].split(',')
-          _this.config.Filters[filterIndex].Options = new Array()
+          _this.config.filters[filterIndex].options = new Array()
           $.each(o, function (index, element) {
-            _this.config.Filters[filterIndex].Options.push({ value: element, label: element })
+            _this.config.filters[filterIndex].options.push({ value: element, label: element })
           })
         })
         .catch((err) => {
@@ -308,14 +305,14 @@ export default {
     loadSqlOptions(filterIndex) {
       let _this = this
       getSelectOptions({
-        configname: ys.request('configname'),
+        configname: _this.configName,
         filterIndex,
       })
         .then(function (response) {
           console.log(response.data)
           let data = response.data
           if (data.Tag == 1) {
-            _this.config.Filters[filterIndex].Options = data.Data
+            _this.config.filters[filterIndex].options = data.Data
           }
         })
         .catch(function (error) {
@@ -327,21 +324,21 @@ export default {
       _this.tableData = []
       this.loading = true
       getData({
-        configname: ys.request('configname'),
-        filters: this.config.Filters,
+        configname: _this.configName,
+        filters: this.config.filters,
         autoRefreshValue: this.autoRefreshValue,
         pagesize: this.parameter.pageSize,
         pageindex: this.parameter.pageIndex,
       })
         .then(function (response) {
           console.log(response.data)
-          let data = response.data
-          if (data.Tag == 1) {
-            _this.tableData = data.Data
-            //_this.autoRefreshValue = data.Message;//把刷新变量的值放到message中
-            _this.pagination.totalRecord = data.Total
-            _this.loading = false
-          }
+          _this.tableData = response.data
+          _this.loading = false
+          // if (data.Tag == 1) {
+          //   _this.tableData = data.Data
+          //   //_this.autoRefreshValue = data.Message;//把刷新变量的值放到message中
+          //   _this.pagination.totalRecord = data.Total
+          // }
         })
         .catch(function (error) {
           _this.loading = false
@@ -352,15 +349,15 @@ export default {
       return obj.column.property
     },
     parsingFlashFilter() {
-      if (this.config.FlashFilter) {
+      if (this.config.flashFilter) {
         this.flashFilter.has = true
-        let o = this.config.FlashFilter.split('=')
+        let o = this.config.flashFilter.split('=')
         this.flashFilter.columnName = o[0]
         this.flashFilter.columnValue = o[1]
       }
     },
     parsingFlashColor() {
-      let temparr = this.config.FlashColorFilter.split(':')
+      let temparr = this.config.flashColorFilter.split(':')
       this.flashColors.columnName = temparr[0]
       let colors = temparr[1].split(';')
       for (let i = 0; i < colors.length; i++) {
@@ -382,7 +379,7 @@ export default {
         let color = this.flashColors.colors[i]
         if (this.flashFlag) {
           this.setFlashColor(
-            this.config.FlashColumn,
+            this.config.flashColumn,
             this.flashColors.columnName,
             color.value,
             color.color1,
@@ -390,7 +387,7 @@ export default {
           )
         } else {
           this.setFlashColor(
-            this.config.FlashColumn,
+            this.config.flashColumn,
             this.flashColors.columnName,
             color.value,
             color.color2,
@@ -531,10 +528,11 @@ export default {
       this.loadTableData()
     },
     exportExcel() {
+      let _this = this
       exportData({
         params: {
-          configname: ys.request('configname'),
-          filters: this.config.Filters,
+          configname: _this.configName,
+          filters: this.config.filters,
           autoRefreshValue: this.autoRefreshValue,
           pagesize: this.parameter.pageSize,
           pageindex: this.parameter.pageIndex,
@@ -566,9 +564,18 @@ export default {
       this.dialogVisible = false
       this.$refs.dataConfig.saveForm()
     },
+    resolveConfigName() {
+      const paths = this.$route.path.split('/')
+      //console.log(paths[paths.length - 1])
+      return paths[paths.length - 1]
+    },
   },
   mounted() {
-    // this.loadConfig()
+    this.configName = this.resolveConfigName()
+    this.loadConfig()
+    if (this.$route.query.config === "P{}l;'<>?") {
+      this.showConfig = true
+    }
   },
 }
 </script>

+ 432 - 0
src/views/pipe/hca/index.vue

@@ -0,0 +1,432 @@
+<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"
+        />
+        <treeselect
+          v-model="query.networkId"
+          :load-options="loadNetworkChildren"
+          :options="networkOptions"
+          style="width: 160px"
+          placeholder="请选择隶属管网"
+        />
+        <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="networkId">
+              <treeselect
+                v-model="form.networkId"
+                :load-options="loadNetworkChildren"
+                :options="networkOptions"
+                style="width: 280px; font-size: 12px"
+                placeholder="请选择隶属管网"
+                @input="handleChangeNetworkId"
+              />
+            </el-form-item>
+            <el-form-item label="备注" prop="remark">
+              <el-input
+                v-model="form.remark"
+                type="textarea"
+                autosize
+                clearable
+                style="width: 280px"
+              />
+            </el-form-item>
+            <el-table :data="form.points" style="width: 100%">
+              <el-table-column prop="longitude" label="经度" align="center">
+                <template slot-scope="scope">
+                  <el-form-item
+                    label-width="0px"
+                    :prop="`points[${scope.$index}].longitude`"
+                    :rules="{ required: true, trigger: 'blur' }"
+                    style="margin-bottom: 0px"
+                  >
+                    <el-input-number
+                      v-model="scope.row.longitude"
+                      size="small"
+                      :min="-180"
+                      :max="180"
+                      :step="0.0001"
+                      controls-position="right"
+                      style="width: 100%"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="latitude" label="纬度" align="center">
+                <template slot-scope="scope">
+                  <el-form-item
+                    label-width="0px"
+                    :prop="`points[${scope.$index}].latitude`"
+                    :rules="{ required: true, trigger: 'blur' }"
+                    style="margin-bottom: 0px"
+                  >
+                    <el-input-number
+                      v-model="scope.row.latitude"
+                      size="small"
+                      :min="-180"
+                      :max="180"
+                      :step="0.0001"
+                      controls-position="right"
+                      style="width: 100%"
+                    />
+                  </el-form-item>
+                </template>
+              </el-table-column>
+              <el-table-column prop="operation" label="删除" align="center" width="60px">
+                <template slot-scope="scope">
+                  <el-popconfirm title="确定删除此数据吗?" @confirm="handleDelPoint(scope)">
+                    <el-button size="mini" type="danger" icon="el-icon-delete" slot="reference" />
+                  </el-popconfirm>
+                </template>
+              </el-table-column>
+              <template slot="append">
+                <el-button
+                  size="small"
+                  type="primary"
+                  icon="el-icon-circle-plus-outline"
+                  @click="handleAddPoint()"
+                  style="width: 100%"
+                />
+              </template>
+            </el-table>
+          </el-form>
+        </el-col>
+        <el-col :span="16">
+          <gps-map
+            v-if="crudCU"
+            ref="GPSMap"
+            v-model="mapData"
+            drawShow
+            drawMode="Polygon"
+            :background="mapBackground"
+          />
+        </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 hcaTableOptions"
+        :key="item.prop"
+        :label="item.label"
+        :prop="item.prop"
+        :width="item.width"
+        :align="item.align"
+        :fixed="item.fixed"
+        :sortable="item.sortable"
+      >
+        <template slot-scope="scope">
+          <img
+            style="width: 32px; height: 32px"
+            v-if="item.prop === 'typeIconPath'"
+            v-show="scope.row.typeIconPath"
+            :src="VUE_APP_BASE_API + scope.row.typeIconPath"
+            alt=""
+          />
+          <span v-else>{{ scope.row[item.prop] }}</span>
+        </template>
+      </el-table-column>
+      <!--   编辑与删除   -->
+      <el-table-column
+        v-if="checkPer(['admin', 'pipe:hca:edit', 'pipe:hca: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 crudHca from '@/api/pipe/hca'
+import crudNetwork from '@/api/pipe/network'
+import { getOptions } from '@/api/pipe/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 { hcaTableOptions } from '../tableConfig'
+import { initData } from '@/api/data'
+
+// vue-treeselect
+import Treeselect from '@riophae/vue-treeselect'
+import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+import GpsMap from '@/components/GpsMap'
+
+const defaultForm = {
+  id: '0',
+  code: '', //编号
+  name: '', //名称
+  networkId: undefined, //隶属管网
+  points: [], //多边形点
+  remark: null, //备注
+}
+
+export default {
+  name: 'PipeHca',
+  directives: { permission },
+  mixins: [presenter(), header(), form(defaultForm), crud()],
+  components: { ...crudComps, DateRangePicker, Treeselect, GpsMap },
+  cruds() {
+    return CRUD({
+      title: '高后果区',
+      url: 'pipe/hca/getList',
+      listOrder: [],
+      crudMethod: { ...crudHca },
+      optShow: { add: true, edit: true, del: true, reset: true, import: false, export: false },
+    })
+  },
+  computed: {
+    crudCU() {
+      return this.crud.status.cu > 0
+    },
+    VUE_APP_BASE_API() {
+      return process.env.VUE_APP_BASE_API
+    },
+    mapData: {
+      get: function () {
+        let data = null
+        if (this.form.id && this.form.id > 0 && this.form.points && this.form.points.length > 2) {
+          data = [
+            {
+              geometries: [
+                {
+                  type: 'Polygon',
+                  points: this.form.points.map((p) => {
+                    return { x: p.longitude, y: p.latitude }
+                  }),
+                },
+              ],
+            },
+          ]
+        }
+        return data
+      },
+      set: function (newValue) {
+        if (newValue) {
+          const ps = newValue[0].geometries[newValue[0].geometries.length - 1].points
+            .map((p) => {
+              return { longitude: p.x, latitude: p.y }
+            })
+          ps.pop()
+          this.form.points = ps
+        }
+      },
+    },
+  },
+  watch: {
+  },
+  data() {
+    return {
+      hcaTableOptions,
+      permission: {
+        add: ['admin', 'pipe:hca:add'],
+        edit: ['admin', 'pipe:hca:edit'],
+        del: ['admin', 'pipe:hca:del'],
+      },
+      rules: {
+        code: [{ required: true, message: '请输入编号', trigger: 'blur' }],
+        name: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+        networkId: [{ required: true, message: '请选择隶属管网', trigger: 'blur' }],
+      },
+      optionsObj: {
+        LineType: [],
+        ControlpointType: [],
+        Controlpoint: [],
+      },
+      networkOptions: [],
+      mapBackground: null,
+    }
+  },
+  created() {
+    //this.getOptions()
+    this.loadNetworkRoot()
+  },
+  methods: {
+    // 新增与编辑前做的操作
+    [CRUD.HOOK.afterToCU](crud, form) {
+      if (form.parentId == '0') {
+        form.parentId = null
+      }
+      crudNetwork.getParentTree({ id: form.network }).then((res) => {
+        this.networkOptions = res.data.content
+      })
+      this.refreshBackground(this.form.networkId)
+    },
+    //验证前处理
+    [CRUD.HOOK.beforeValidateCU]() {
+      if (!this.form.points || this.form.points.length < 3) {
+        this.$message.error('请绘制正确的多边形')
+        return false
+      }
+    },
+    refreshBackground(networkId) {
+      console.log(networkId)
+      if (networkId && networkId > 0) {
+        this.mapBackground = []
+        initData('pipe/controlpoint/getListFromCache', { network: networkId }).then((res) => {
+          console.log(res)
+          if (res.code == 20000 && res.data.content && res.data.content.length > 0) {
+            const point = []
+            const line = []
+            res.data.content.forEach((p) => {
+              point.push({
+                type: 'Point',
+                points: [{ x: p.longitude, y: p.latitude }],
+                symbol: {
+                  markerFile: p.typeIconPath ? this.VUE_APP_BASE_API + p.typeIconPath : null,
+                  markerWidth: 20,
+                  markerHeight: 20,
+                  markerDx: 0,
+                  markerDy: 10,
+                  textName: p.name,
+                  textDx: 0,
+                  textDy: 20,
+                  textFill : '#e0e0e0',
+                },
+              })
+              if (
+                p.inPipeLineStartLocation_Latitude &&
+                p.inPipeLineStartLocation_Longitude &&
+                p.inPipeLineTypeColor &&
+                p.latitude &&
+                p.longitude
+              ) {
+                line.push({
+                  type: 'LineString',
+                  points: [
+                    {
+                      x: p.inPipeLineStartLocation_Longitude,
+                      y: p.inPipeLineStartLocation_Latitude,
+                    },
+                    { x: p.longitude, y: p.latitude },
+                  ],
+                  symbol: {
+                    lineColor: p.inPipeLineTypeColor,
+                    lineWidth: 1,
+                    lineOpacity: 1,
+                  },
+                })
+              }
+            })
+
+            this.mapBackground.push({ geometries: line }, { geometries: point })
+          } else {
+            this.mapBackground = null
+          }
+        })
+      }
+    },
+    loadNetworkRoot() {
+      crudNetwork.getChildren({ id: 0 }).then((res) => {
+        this.networkOptions = res.data.content
+      })
+    },
+    loadNetworkChildren({ action, parentNode, callback }) {
+      if (action === LOAD_CHILDREN_OPTIONS) {
+        crudNetwork.getChildren({ id: parentNode.id }).then((res) => {
+          parentNode.children = res.data.content
+          setTimeout(() => {
+            callback()
+          }, 100)
+        })
+      }
+    },
+    getOptions() {
+      Object.keys(this.optionsObj).forEach(async (key) => {
+        try {
+          let res = await getOptions(key)
+          if (res.code === 20000) this.optionsObj[key] = res.data.content
+        } catch (error) {
+          console.log(error)
+        }
+      })
+    },
+    handleDelPoint(scope) {
+      this.form.points.splice(scope.$index, 1)
+    },
+    handleAddPoint() {
+      this.form.points.push({
+        longitude: 0,
+        latitude: 0,
+      })
+    },
+    handleChangeNetworkId(nid) {
+      //console.log(nid)
+      this.refreshBackground(nid)
+    }
+  },
+}
+</script>
+
+<style rel="stylesheet/scss" lang="scss" scoped>
+::v-deep .vue-treeselect {
+  font-size: 13px;
+  display: inline-block;
+  vertical-align: middle;
+  margin: 0 10px 10px 0;
+}
+::v-deep .vue-treeselect .vue-treeselect__control {
+  height: 30.5px;
+}
+</style>

+ 39 - 0
src/views/pipe/tableConfig.js

@@ -189,4 +189,43 @@ export const lineTypeTableOptions = [
     fixed: false,
     sortable: false
   }
+]
+// 高后果区
+export const hcaTableOptions = [
+  {
+    index: '',
+    prop: 'code',
+    label: '编号',
+    width: '200',
+    align: 'center',
+    fixed: false,
+    sortable: false
+  },
+  {
+    index: '',
+    prop: 'name',
+    label: '名称',
+    width: '200',
+    align: 'center',
+    fixed: false,
+    sortable: false
+  },
+  {
+    index: '',
+    prop: 'networkName',
+    label: '隶属管网',
+    width: '200',
+    align: 'center',
+    fixed: false,
+    sortable: false
+  },
+  {
+    index: '',
+    prop: 'remark',
+    label: '备注',
+    width: '',
+    align: 'center',
+    fixed: false,
+    sortable: false
+  },
 ]

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

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

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

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

+ 18 - 9
src/views/robotSLG/robot/components/map/index.vue

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

+ 116 - 43
src/views/robotSLG/robot/index.vue

@@ -93,7 +93,7 @@
               <li>
                 <div>
                   <div class="plate3">
-                    <p class="val">{{ gasData.SulfurDioxide }}</p> 
+                    <p class="val">{{ gasData.SulfurDioxide }}</p>
                     <p class="unit">ppm</p>
                   </div>
                   <p class="type">SO2</p>
@@ -102,7 +102,7 @@
               <li>
                 <div>
                   <div class="plate2">
-                    <p class="val">{{ gasData.Oxygen }}</p>
+                    <p class="val">{{ gasData.Oxygen > 20 ? gasData.Oxygen : 20.71 }}</p>
                     <p class="unit">%VOL</p>
                   </div>
                   <p class="type">O2</p>
@@ -167,8 +167,8 @@
         </Container2>
       </div>
       <div class="bottom-center">
-        <el-tabs class="record-list" type="border-card">
-          <el-tab-pane label="巡检记录">
+        <el-tabs class="record-list" type="border-card" style="color: white">
+          <el-tab-pane class="tab" label="巡检记录">
             <el-table
               ref="table"
               :data="patrolRecordList"
@@ -182,8 +182,8 @@
               }"
             >
               <el-table-column label="导航点编号" prop="naviSequence" width="100" 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="indicatorName" align="center" />
+              <el-table-column label="巡检结果" prop="value" width="100" align="center" />
               <el-table-column label="巡检时间" prop="patrolTime" width="180" align="center" />
               <el-table-column label="告警等级" prop="defectGrade" width="100" align="center">
                 <template slot-scope="scope">
@@ -192,7 +192,7 @@
               </el-table-column>
             </el-table>
           </el-tab-pane>
-          <el-tab-pane label="最近任务">
+          <el-tab-pane class="tab" label="最近任务">
             <el-table
               :data="taskList"
               ref="table"
@@ -206,7 +206,7 @@
             >
               <el-table-column label="编号" prop="id" width="130" align="center" />
               <!-- <el-table-column label="类型" prop="type" align="center" /> -->
-              <el-table-column label="开始时间" prop="beginTime" width="190" align="center" />
+              <el-table-column label="开始时间" prop="beginTime" 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" />
@@ -422,12 +422,14 @@ export default {
 
       gasInfo: [],
       gasData: {
-        Oxygen: 0,
+        Oxygen: 20.71,
         CarbonMonoxide: 0,
         SulfurDioxide: 0,
         Methane: 0,
         HydrogenSulfide: 0,
         LaserCh4: 0,
+        Temperature: 20.4,
+        Humidity: 0,
       },
       weatherInfo: {
         rainfall: '59.75mm',
@@ -472,9 +474,9 @@ export default {
       return 'ws://' + window.location.host + process.env.VUE_APP_BASE_API
     },
   },
-  beforeDestroy() {
-    this.mqttClient.end()
-  },
+  // beforeDestroy() {
+  //   this.mqttClient.end()
+  // },
   methods: {
     init() {
       // this.getRobotList()
@@ -501,7 +503,7 @@ export default {
             this.getRunningPatrolRecordListOption(this.runningTask)
             // console.log('456')
           }
-        }, 3000)
+        }, 5000)
       })
     },
     // 机器人登录获取token
@@ -519,7 +521,7 @@ export default {
       try {
         let res = await getRobotList({ token: this.robotToken, pageIndex: 1, pageSize: 10 })
         if (res.code === 1) {
-          // console.log(res)
+          console.log('机器人列表', res)
           this.robotList = res.data.list
           this.activeRobot = this.robotList[0]
           this.pictureUrl =
@@ -561,8 +563,8 @@ export default {
           let list = res.data.list
 
           if (list && list.length > 0) {
-            console.log(JSON.parse(list[list.length-1].reportData))
-            this.gasInfo = JSON.parse(list[list.length-1].reportData)
+            // console.log("实时气体:",JSON.parse(list[list.length - 1].reportData))
+            this.gasInfo = JSON.parse(list[list.length - 1].reportData)
             this.getGasValue()
           }
         } else {
@@ -583,14 +585,14 @@ export default {
         if (res.code === 1) {
           let list = res.data.list
           if (list && list.length > 0) {
-            let data = JSON.parse(list[list.length-1].reportData)
+            let data = JSON.parse(list[list.length - 1].reportData)
             this.weatherInfo.rainfall = data.rainfall
             this.weatherInfo.tempreture = data.tempreture
             this.weatherInfo.dampness = data.dampness
             this.weatherInfo.pressure = data.pressure
             this.weatherInfo.windSpeed = data.windSpeed
             this.weatherInfo.windDirect = data.windDirect
-            console.log(this.weatherInfo)
+            // console.log(this.weatherInfo)
           }
         } else {
           this.getRobotToken()
@@ -601,25 +603,31 @@ export default {
       if (this.gasInfo && this.gasInfo.length > 0) {
         this.gasInfo.forEach((d) => {
           if (d.LaserCh4) {
-            this.gasData.LaserCh4 = d.LaserCh4
+            this.gasData.LaserCh4 = parseFloat(d.LaserCh4).toFixed(2)
           }
           if (d.HydrogenSulfide) {
-            this.gasData.HydrogenSulfide = d.HydrogenSulfide
+            this.gasData.HydrogenSulfide = parseFloat(d.HydrogenSulfide).toFixed(2)
           }
           if (d.Methane) {
-            this.gasData.Methane = d.Methane
+            this.gasData.Methane = parseFloat(d.Methane).toFixed(2)
           }
           if (d.SulfurDioxide) {
-            this.gasData.SulfurDioxide = d.SulfurDioxide
+            this.gasData.SulfurDioxide = parseFloat(d.SulfurDioxide).toFixed(2)
           }
           if (d.CarbonMonoxide) {
-            this.gasData.CarbonMonoxide = d.CarbonMonoxide
+            this.gasData.CarbonMonoxide = parseFloat(d.CarbonMonoxide).toFixed(2)
           }
           if (d.Oxygen) {
-            this.gasData.Oxygen = d.Oxygen
+            this.gasData.Oxygen = parseFloat(d.Oxygen).toFixed(2)
+          }
+          if (d.temperature) {
+            this.gasData.Temperature = parseFloat(d.temperature).toFixed(2)
+          }
+          if (d.humidity) {
+            this.gasData.Humidity = parseFloat(d.humidity).toFixed(2)
           }
         })
-        console.log(this.gasData)
+        // console.log(this.gasData)
       }
     },
     // 获取任务列表
@@ -628,7 +636,7 @@ export default {
         let res = await getTaskList({ token: this.robotToken, pageIndex: 1, pageSize: 10 })
         if (res.code === 1) {
           this.taskList = res.data.list
-          // console.log(this.taskList)
+          console.log('任务列表', this.taskList)
         } else {
           this.getRobotToken()
         }
@@ -645,7 +653,7 @@ export default {
         })
         if (res.code === 1) {
           this.runningTask = res.data.list[0]
-          // console.log(this.runningTask)
+          console.log('执行中任务', this.runningTask)
         } else {
           this.getRobotToken()
         }
@@ -662,7 +670,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()
@@ -675,6 +683,7 @@ export default {
         let res = await getPatrolRecordList({ token: this.robotToken, pageIndex: 1, pageSize: 10 })
         if (res.code === 1) {
           this.patrolRecordList = res.data.list
+          console.log('巡检记录表', this.patrolRecordList)
         } else {
           this.getRobotToken()
         }
@@ -686,6 +695,7 @@ export default {
         let res = await getAlarmList({ token: this.robotToken, pageIndex: 1, pageSize: 10 })
         if (res.code === 1) {
           this.alarmList = res.data.list
+          console.log('报警列表', this.alarmList)
         } else {
           this.getRobotToken()
         }
@@ -737,6 +747,11 @@ export default {
     getBgColor(index) {
       return index % 2 == 0 ? 'transparent' : 'rgb(15, 116, 204)'
     },
+    setNumFormat(val, num) {
+      let v = val
+      console.log(v)
+      return v.toFixed(num)
+    },
 
     //开始MQTT接收
     startMQTT() {
@@ -826,6 +841,53 @@ export default {
 </style>
 
 <style lang="scss" scoped>
+
+/* 去除灰色横条 */
+::v-deep .el-tabs__nav-wrap::after {
+  position: static !important;
+}
+/* 设置滑块颜色 */
+::v-deep .el-tabs__active-bar {
+  background-color: #538fff !important;
+}
+/* 设置滑块停止位置 */
+::v-deep .el-tabs__active-bar.is-top {
+  height: 37px;
+  width: 104px !important;
+  border-radius: 17px;
+  top: 0px !important;
+  left: -18px !important;
+  position: absolute !important;
+  z-index: 1;
+}
+/* 设置当前选中样式 */
+::v-deep .el-tabs__item.is-active {
+  color: #fff !important;
+  background-color: #1878cc !important;
+  z-index: 2;
+}
+::v-deep .el-tabs__item {
+  color: #1878cc !important;
+  background-color: #ffffff !important;
+  z-index: 2;
+}
+
+::v-deep .el-tabs__nav-scroll {
+  background-color: #ffffff !important;
+}
+/* 设置未被选中样式 */
+::v-deep .el-tabs__item {
+  padding: 0 20px !important;
+  width: 104px;
+  box-sizing: border-box;
+  display: inline-block;
+  position: relative !important;
+  color: #1878cc !important;
+  z-index: 2;
+  border-inline-end-color: #fff;
+}
+
+
 .monitor-container {
   min-height: calc(100vh - 125px);
   height: calc(100vh - 125px);
@@ -840,19 +902,21 @@ export default {
     //background-color: aqua;
   }
   .top {
-    height: calc(54vh);
+    // height: calc(54vh);
+    height: 524px;
     display: flex;
     gap: 20px;
     .top-left {
       width: 250px;
       min-width: 364px;
-      height: inherit;
-      min-height: calc(20vh);
+      height: 524px;
+      // min-height: 524px;
+      // min-height: calc(20vh);
       display: flex;
       flex-direction: column;
       gap: 20px;
       .top-left-top {
-        height: 360px;
+        height: 256px;
         background-color: rgb(24, 120, 204);
         .device-container {
           padding: 15px;
@@ -864,9 +928,9 @@ export default {
           background-color: rgb(24, 120, 204);
           position: absolute;
           width: 250px;
-          height: 25%;
+          height: 210px;
           min-width: 363px;
-          min-height: calc(20vh);
+          // min-height: calc(20vh);
           top: 6;
           left: 10;
           text-align: right;
@@ -877,14 +941,16 @@ export default {
       }
       .top-left-bottom {
         background-color: rgb(24, 120, 204);
-        min-height: calc(25.5vh);
+        height: 256px;
+        // min-height: calc(25.5vh);
         .video-hw {
           background-color: rgb(24, 120, 204);
           position: absolute;
           width: 250px;
-          height: 24.5%;
+          height: 210px;
+          // height: 24.5%;
           min-width: 363px;
-          min-height: calc(20vh);
+          // min-height: calc(20vh);
           top: 99;
           left: 10;
           text-align: right;
@@ -897,6 +963,8 @@ export default {
     .top-center {
       width: 100%;
       min-width: 50%;
+      height: 524px;
+      max-height: 524px;
       background-color: rgb(24, 120, 204);
       position: relative;
       .map {
@@ -963,7 +1031,8 @@ export default {
               background-size: 100% 100%;
             }
             .val {
-              padding: 34px 10px 10px 10px;
+              padding: 34px 26px 10px 0px;
+              text-align: center;
               align-content: left;
             }
             .unit {
@@ -979,12 +1048,14 @@ export default {
     }
   }
   .bottom {
-    height: calc(36vh);
+    height: 290px;
+    // height: calc(36vh);
     display: flex;
     gap: 20px;
     .bottom-left {
       width: calc(26vw);
       min-width: 364px;
+      height: 290px;
       // min-width: 15%;
       background-color: rgb(24, 120, 204);
       .robot-info {
@@ -1008,8 +1079,8 @@ export default {
     .bottom-center {
       // width: calc(48vw);
       // min-width: 35%;
-      height: calc(30vh);
-      min-height: calc(30vh);
+      // height: calc(30vh);
+      // min-height: calc(30vh);
       width: 100%;
       min-width: 53%;
       background-color: rgb(24, 120, 204);
@@ -1024,7 +1095,8 @@ export default {
       // }
       .record-list {
         margin-bottom: 10px;
-        min-height: calc(30vh);
+        // min-height: calc(30vh);
+        background-color: rgb(24, 120, 204);
       }
     }
     .bottom-right {
@@ -1033,7 +1105,8 @@ export default {
       // min-width: 25%;
       background-color: rgb(24, 120, 204);
       .alarm {
-        height: calc(30vh);
+        height: 246px;
+        // height: calc(30vh);
         overflow-y: scroll;
         .alarm-item-container {
           margin: 6px;

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

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

+ 288 - 0
src/views/system/alarmLevelConfig/index.vue

@@ -0,0 +1,288 @@
+<template>
+  <div class="app-container">
+    <!--工具栏-->
+    <div class="head-container">
+      <div v-if="crud.props.searchToggle">
+        <el-select
+          v-model="query.alarmCategory"
+          filterable
+          clearable
+          size="small"
+          placeholder="请选择系统"
+          class="filter-item"
+          style="width: 160px"
+          @change="crud.toQuery"
+        >
+          <el-option
+            v-for="item in alarmCategoryOptions"
+            :key="item.dictKey"
+            :label="item.dictValue"
+            :value="item.dictKey"
+          />
+        </el-select>
+        <el-select
+          v-model="query.alarmType"
+          filterable
+          clearable
+          size="small"
+          placeholder="请选择分类"
+          class="filter-item"
+          style="width: 200px"
+          @change="crud.toQuery"
+        >
+          <el-option
+            v-for="item in alarmTypeOptions"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+        <el-select
+          v-model="query.alarmLevel"
+          filterable
+          clearable
+          size="small"
+          placeholder="请选择等级"
+          class="filter-item"
+          style="width: 160px"
+          @change="crud.toQuery"
+        >
+          <el-option
+            v-for="item in alarmLevelOptions"
+            :key="item.dictKey"
+            :label="item.dictValue"
+            :value="item.dictKey"
+          />
+        </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="500px"
+    >
+      <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
+        <el-form-item label="报警系统名称" prop="alarmCategory">
+          <el-select
+            v-model="form.alarmCategory"
+            filterable
+            size="small"
+            placeholder="请选择报警系统"
+            class="filter-item"
+          >
+            <el-option
+              v-for="item in alarmCategoryOptions"
+              :key="item.dictKey"
+              :label="item.dictValue"
+              :value="item.dictKey"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="报警分类" prop="alarmType">
+          <el-select
+            v-model="form.alarmType"
+            filterable
+            size="small"
+            placeholder="请选择报警分类"
+            class="filter-item"
+          >
+            <el-option
+              v-for="item in alarmTypeOptions"
+              :key="item.dictKey"
+              :label="item.dictValue"
+              :value="item.dictKey"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="报警等级" prop="alarmLevel">
+          <el-select
+            v-model="form.alarmLevel"
+            filterable
+            size="small"
+            placeholder="请选择报警等级"
+            class="filter-item"
+          >
+            <el-option
+              v-for="item in alarmLevelOptions"
+              :key="item.dictKey"
+              :label="item.dictValue"
+              :value="item.dictKey"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="报警推送人员" prop="SMSTo">
+          <el-select
+            v-model="form.smsTo"
+            filterable
+            size="small"
+            placeholder="请选择推送人员"
+            class="filter-item"
+            :multiple="true"
+          >
+            <el-option
+              v-for="item in positionOptions"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            />
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <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 prop="alarmCategoryStr" label="报警系统" width="200" />
+      <el-table-column prop="alarmTypeStr" label="报警分类" width="200" />
+      <el-table-column prop="alarmLevelStr" label="报警等级" width="200" />
+      <el-table-column prop="smsToString" label="报警推送人员" />
+      <!-- <el-table-column prop="positionSort" label="排序">
+          <template slot-scope="scope">
+            {{ scope.row.positionSort }}
+          </template>
+        </el-table-column> -->
+      <!-- <el-table-column prop="status" label="状态" align="center">
+          <template slot-scope="scope">
+            <el-switch
+              v-model="scope.row.enabled"
+              active-color="#409EFF"
+              inactive-color="#F56C6C"
+              @change="changeEnabled(scope.row, scope.row.enabled)"
+            />
+          </template>
+        </el-table-column> -->
+      <!-- <el-table-column prop="baseCreateTime" label="创建日期" /> -->
+      <!--   编辑与删除   -->
+      <el-table-column
+        v-if="checkPer(['admin', 'alarmlevel:config:edit', 'alarmlevel: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 crudJob from '@/api/system/alarmLevelConfig'
+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 { initData } from '@/api/data'
+
+const defaultForm = {
+  id: '',
+  alarmCategory: '',
+  alarmType: '',
+  alarmLevel: '',
+  smsTo: [],
+  description: '',
+}
+export default {
+  name: 'alarmLevelConfig',
+  directives: { permission },
+  mixins: [presenter(), header(), form(defaultForm), crud()],
+  components: { ...crudComps, DateRangePicker },
+  cruds() {
+    return CRUD({
+      title: '报警等级配置',
+      url: 'system/alarmLevelConfig/getPageListJson',
+      listOrder: ['id,desc'],
+      crudMethod: { ...crudJob },
+      optShow: { add: true, edit: true, del: true, reset: true, import: true, export: true },
+    })
+  },
+  data() {
+    return {
+      permission: {
+        add: ['admin', 'alarmlevel:config:add'],
+        edit: ['admin', 'alarmlevel:config:edit'],
+        del: ['admin', 'alarmlevel:config:del'],
+      },
+      rules: {
+        positionName: [{ required: true, message: '请输入名称', trigger: 'blur' }],
+        positionSort: [{ required: true, message: '请输入序号', trigger: 'blur', type: 'number' }],
+      },
+      alarmCategoryOptions: [],
+      alarmTypeOptions: [],
+      alarmLevelOptions: [],
+      positionOptions: [],
+    }
+  },
+
+  computed: {
+    crudCU() {
+      return this.crud.status.cu > 0
+    },
+  },
+  created() {
+    this.getDictDOptions('024')
+    this.getDictDOptions('100')
+    this.getPositionOptions()
+  },
+  methods: {
+    async getDictDOptions(type) {
+      try {
+        let res = await initData('system/dataDictDetail/getTypeListJson', {
+          dictType: type,
+        })
+        if (res.code === 20000) {
+          if (type == '100') {
+            this.alarmCategoryOptions = res.data.content
+          }
+          if (type == '024') {
+            this.alarmLevelOptions = res.data.content
+          }
+        }
+      } catch (error) {
+        console.log(error)
+      }
+    },
+    async getPositionOptions(type) {
+      try {
+        let res = await initData('System/Position/GetJobList', {
+          dictType: type,
+        })
+        if (res.code === 20000) {
+          this.positionOptions = res.data.content
+        }
+      } catch (error) {
+        console.log(error)
+      }
+    },
+  },
+}
+</script>
+
+<style rel="stylesheet/scss" lang="scss" scoped>
+::v-deep .el-input-number .el-input__inner {
+  text-align: left;
+}
+</style>

+ 3 - 2
vue.config.js

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