Browse Source

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh 6 months ago
parent
commit
76fd370dd2

+ 5 - 1
src/views/vent/monitorManager/comment/AlarmHistoryTable.vue

@@ -41,6 +41,10 @@
     sysId: {
       type: String,
     },
+    deviceId: {
+      type: String,
+      default: '',
+    },
     scroll: {
       type: Object,
       default: { y: 0 },
@@ -208,7 +212,7 @@
             label: '查询设备',
             field: 'deviceid',
             component: 'Select',
-            defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
+            defaultValue: props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
             componentProps: {
               showSearch: true,
               filterOption: (input: string, option: any) => {

+ 7 - 0
src/views/vent/monitorManager/comment/HandlerHistoryTable.vue

@@ -35,6 +35,10 @@
     sysId: {
       type: String,
     },
+    deviceId: {
+      type: String,
+      default: '',
+    },
     scroll: {
       type: Object,
       default: { y: 0 },
@@ -162,6 +166,9 @@
         if (props.sysId) {
           params.sysId = props.sysId;
         }
+        if (props.deviceId) {
+          params.deviceid = props.deviceId;
+        }
       },
     },
   });

+ 1 - 1
src/views/vent/monitorManager/comment/HistoryTable.vue

@@ -347,7 +347,7 @@
                   label: computed(() => `${deviceKide.value.startsWith('location') ? '查询人员' : '查询设备'}`),
                   field: 'gdeviceid',
                   component: 'Select',
-                  defaultValue: deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
+                  defaultValue: props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
                   required: true,
                   componentProps: {
                     showSearch: true,

+ 32 - 8
src/views/vent/monitorManager/fanLocalMonitor/fanLocal.data.ts

@@ -278,17 +278,41 @@ export const formAgentSchema: FormSchema[] = [
   },
 ];
 
-export const chartsColumns = [
+export const chartsColumnsZDKZ = [
   {
-    legend: '瓦斯浓度',
-    seriesName: '瓦斯浓度(%)',
-    ymax: 100,
-    yname: '%',
-    linetype: 'bar',
+    legend: '供风量',
+    seriesName: '供风量(m³/min)',
+    ymax: 1000,
+    yname: 'm³/min',
+    linetype: 'line',
     yaxispos: 'left',
-    color: '#cd5fff',
+    color: '#FCB146',
     sort: 1,
-    dataIndex: '',
+    dataIndex: 'windQuantity2',
+    xRotate: 0,
+  },
+  {
+    legend: '迎头瓦斯',
+    seriesName: '迎头瓦斯(%)',
+    ymax: 0.8,
+    yname: '%',
+    linetype: 'line',
+    yaxispos: 'right',
+    color: '#02FBA7',
+    sort: 2,
+    dataIndex: 'gas1',
+    xRotate: 0,
+  },
+  {
+    legend: '风机频率',
+    seriesName: '风机频率(Hz)',
+    ymax: 50,
+    yname: 'Hz',
+    linetype: 'line',
+    yaxispos: 'right',
+    color: '#AD19FE',
+    sort: 3,
+    dataIndex: 'FanfHz',
     xRotate: 0,
   },
 ];

+ 38 - 7
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -69,7 +69,7 @@
             >
           </div>
         </div>
-        <div class="elementTag" id="gateBox">
+        <div class="elementTag" id="gateBox" v-if="modalType == 'fm'">
           <div class="elementContent">
             <p>风门状态:关</p>
             <p>风门过风面积:{{ selectData.gas1 ? selectData.gas1 : '-' }}</p>
@@ -419,8 +419,8 @@
               />
             </div>
           </a-tab-pane>
-          <a-tab-pane key="2" tab="曲线配置" v-if="hasPermission('show:fanEcharts')">
-            <div v-if="activeKey == '2'" class="tab-item" style="display: flex">
+          <a-tab-pane key="6" tab="风机曲线" v-if="hasPermission('show:fanEcharts')">
+            <div v-if="activeKey == '6'" class="tab-item" style="display: flex">
               <div style="width: calc(50% - 20px); height: 100%">
                 <div style="color: #fff; width: 100%; text-align: center; margin: 5px 0px">主机</div>
                 <BarAndLine
@@ -449,6 +449,21 @@
               </div>
             </div>
           </a-tab-pane>
+          <a-tab-pane key="2" tab="风量实时曲线图" force-render v-if="hasPermission('echart:show')">
+            <div class="tab-item" style="height: 100%; padding-top: 15px">
+              <BarAndLine
+                v-if="activeKey == '2'"
+                class="echarts-line"
+                xAxisPropType="time"
+                :dataSource="historyList"
+                height="100%"
+                width="100%"
+                :chartsColumns="chartsColumnsZDKZ"
+                :option="echatsOption"
+                chartsType="listMonitor"
+              />
+            </div>
+          </a-tab-pane>
         </a-tabs>
         <a-button
           v-if="hasPermission('btn:reportDown')"
@@ -609,7 +624,7 @@
   import lodash from 'lodash';
   import { getTableList, list, autoAdjust } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
   import { list as baseList } from '../../deviceManager/fanTabel/fan.api';
-  import { echatsOption } from './fanLocal.data';
+  import { echatsOption, chartsColumnsZDKZ } from './fanLocal.data';
   import { deviceControlApi } from '/@/api/vent/index';
   import { setDivHeight } from '/@/utils/event';
   import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
@@ -814,8 +829,6 @@
   const fanControl = ref('');
   const targetVolume = ref(600);
   const historyList = ref([]);
-  // const remoteChartsColumns = getTableHeaderColumns('fanlocal_chart');
-  // const chartsColumns = remoteChartsColumns && remoteChartsColumns.length > 0 ? remoteChartsColumns : chartsColumns1;
 
   const passWord = ref('');
   // 默认初始是第一行
@@ -1004,6 +1017,21 @@
               echartsDataList.value = dataList;
             }
           }
+          // 制动控制echarts数据获取
+          let echartsData = dataArr[selectRowIndex.value]['history'] || [];
+          echartsData = echartsData.filter((item) => {
+            item['FanfHz'] = data['Fan1StartStatus'] == '1' ? item['Fan1fHz'] : data['Fan2StartStatus'] == '1' ? item['Fan2fHz'] : 0;
+            item['windQuantity2'] =
+              item['windQuantity2'] ||
+              item['m3'] ||
+              item['ductOutletAirVolume_merge'] ||
+              item['windOutSpeed_merge'] ||
+              item['windOutSpeed1'] ||
+              item['windOutSpeed2'] ||
+              item['windOutSpeed_merge'];
+            return true;
+          });
+          historyList.value = echartsData;
         }
       } else {
         return (dataSource.value = []);
@@ -1434,7 +1462,7 @@
               : { auto: 1, fanlocalId: selectData.deviceID, gasMax: gasWarningVal.value };
           autoAdjust(params)
             .then(() => {
-              activeKey.value = '2';
+              if (hasPermission('echart:show')) activeKey.value = '2';
               if (globalConfig.History_Type == 'remote') {
                 message.success('指令已下发至生产管控平台成功!');
               } else {
@@ -1506,6 +1534,9 @@
   :deep(.@{ventSpace}-tabs-tabpane-active) {
     height: 100%;
   }
+  :deep(.zxm-tabs-content) {
+    height: 100%;
+  }
   .scene-box {
     .title-text {
       height: 32px;

+ 55 - 38
src/views/vent/monitorManager/fanLocalMonitor1/components/fanlocal-echart-line.vue

@@ -1,54 +1,71 @@
 <template>
-    <div class="alarm-history">
-        <BarAndLine class="echarts-line" xAxisPropType="time" :dataSource="historyLists" height="90%" width="100%"
-            :chartsColumns="chartsColumn" :option="echatsOption" chartsType="listMonitor" />
-    </div>
+  <div class="alarm-history">
+    <BarAndLine
+      class="echarts-line"
+      xAxisPropType="time"
+      :dataSource="historyLists"
+      height="90%"
+      width="100%"
+      :chartsColumns="chartsColumn"
+      :option="echatsOption"
+      chartsType="listMonitor"
+    />
+  </div>
 </template>
 <script setup lang="ts">
-import { onBeforeMount, ref, watch, onMounted, nextTick, defineAsyncComponent, reactive, onUnmounted, inject, unref } from 'vue';
-import BarAndLine from '../../../../../components/chart/BarAndLine.vue';
-import { echatsOption } from '../fanLocal.data';
-const props = defineProps({
+  import { onBeforeMount, ref, watch, onMounted, nextTick, defineAsyncComponent, reactive, onUnmounted, inject, unref } from 'vue';
+  import BarAndLine from '../../../../../components/chart/BarAndLine.vue';
+  import { echatsOption } from '../fanLocal.data';
+  const props = defineProps({
     devicekide: {
-        type: String,
-        default: '',
+      type: String,
+      default: '',
     },
     historyList: {
-        type: Array,
-        default: () => {
-            return []
-        }
+      type: Array,
+      default: () => {
+        return [];
+      },
     },
     chartsColumns: {
-        type: Array,
-        default: () => {
-            return []
-        }
-    }
-});
-let scroll = reactive({
+      type: Array,
+      default: () => {
+        return [];
+      },
+    },
+    deviceId: {
+      type: String,
+      default: '',
+    },
+  });
+  let scroll = reactive({
     y: 700,
-});
-let historyLists = ref<any[]>([])
-let chartsColumn = ref<any[]>([])
-
-watch(() => props.historyList, (newH, oldH) => {
-    historyLists.value = newH
-},
-    { immediate: true })
-watch(() => props.chartsColumns, (newC, oldC) => {
-    chartsColumn.value = newC
-}, {
-    immediate: true
-})
-
+  });
+  let historyLists = ref<any[]>([]);
+  let chartsColumn = ref<any[]>([]);
 
+  watch(
+    () => props.historyList,
+    (newH, oldH) => {
+      historyLists.value = newH;
+    },
+    { immediate: true }
+  );
+  watch(
+    () => props.chartsColumns,
+    (newC, oldC) => {
+      chartsColumn.value = newC;
+    },
+    {
+      immediate: true,
+    }
+  );
 </script>
 <style lang="less" scoped>
-.alarm-history {
+  .alarm-history {
     width: 100%;
     height: 730px;
     position: fixed;
     top: 100px;
-}
-</style>
+  }
+</style>

+ 4 - 0
src/views/vent/monitorManager/fanLocalMonitor1/components/fanlocal-history.vue

@@ -31,6 +31,10 @@
         return {};
       },
     },
+    deviceId: {
+      type: String,
+      default: '',
+    },
   });
 
   let selectDatas = reactive({});

+ 4 - 0
src/views/vent/monitorManager/fanLocalMonitor1/components/fanlocal-operate-history.vue

@@ -19,6 +19,10 @@
       type: String,
       default: '',
     },
+    deviceId: {
+      type: String,
+      default: '',
+    },
   });
   let scroll = reactive({
     y: 580,

+ 5 - 1
src/views/vent/monitorManager/fanLocalMonitor1/components/fanlocal-warn-history.vue

@@ -4,7 +4,7 @@
   </div>
 </template>
 <script setup lang="ts">
-  import { onBeforeMount, ref, watch, onMounted, nextTick, defineAsyncComponent, reactive, onUnmounted, inject, unref } from 'vue';
+  import { reactive } from 'vue';
   import AlarmHistoryTable from '../../comment/AlarmHistoryTable.vue';
 
   const props = defineProps({
@@ -12,6 +12,10 @@
       type: String,
       default: '',
     },
+    deviceId: {
+      type: String,
+      default: '',
+    },
   });
   let scroll = reactive({
     y: 580,

+ 5 - 5
src/views/vent/monitorManager/fanLocalMonitor1/index.vue

@@ -345,7 +345,7 @@
           <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan1Reset')">复位</div>
         </div>
         <div class="startSmoke-select">
-          <div class="label">1#风机:</div>
+          <div class="label">2#风机:</div>
           <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Open')">开启</div>
           <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Stop')">停止</div>
           <div :class="{ 'button-box': true, 'button-disable': false }" @click="handleOk('Fan2Reset')">复位</div>
@@ -430,10 +430,10 @@
     </div>
   </a-modal>
 
-  <fanlocalHistory v-if="activeBtn == 'fanLocal-history'" :selectData="selectData" :devicekide="devicekide" />
-  <fanlocalWarnHistory v-if="activeBtn == 'fanLocal-warn'" :devicekide="devicekide" />
-  <fanlocalOperateHistory v-if="activeBtn == 'fanLocal-operate'" :devicekide="devicekide" />
-  <fanlocalEchartLine v-if="activeBtn == 'fanLocal-wind'" :historyList="historyList" :chartsColumns="chartsColumns" />
+  <fanlocalHistory v-if="activeBtn == 'fanLocal-history'" :selectData="selectData" :devicekide="devicekide" :deviceId="deviceId" />
+  <fanlocalWarnHistory v-if="activeBtn == 'fanLocal-warn'" :devicekide="devicekide" :deviceId="deviceId" />
+  <fanlocalOperateHistory v-if="activeBtn == 'fanLocal-operate'" :devicekide="devicekide" :deviceId="deviceId" />
+  <fanlocalEchartLine v-if="activeBtn == 'fanLocal-wind'" :historyList="historyList" :chartsColumns="chartsColumns" :deviceId="deviceId" />
   <BottomMenu :nav-list="navList" @change="changeActive" />
 </template>