Selaa lähdekoodia

1. 神东安全监控预警历史接口对接

hongrunxia 9 kuukautta sitten
vanhempi
commit
a2609100af

+ 2 - 4
src/utils/http/axios/index.ts

@@ -49,7 +49,8 @@ const transform: AxiosTransform = {
       throw new Error(t('sys.api.apiRequestFailed'));
     }
     //  这里 code,result,message为 后台统一的字段,需要在 types.ts内修改为项目自己的接口返回格式
-    if (data.result) {//lxh
+    if (data.result) {
+      //lxh
       const { code, result, message, success } = data;
       // 这里逻辑可以根据项目进行修改
       const hasSuccess = data && Reflect.has(data, 'code') && (code === ResultEnum.SUCCESS || code == 200);
@@ -71,9 +72,6 @@ const transform: AxiosTransform = {
       return data;
     }
 
-
-
-
     // 在此处根据自己项目的实际情况对不同的code执行不同的操作
     // 如果不希望中断当前请求,请return数据,否则直接抛出异常即可
     let timeoutMsg = '';

+ 1 - 1
src/views/monitor/redis/index.vue

@@ -12,7 +12,7 @@
       </a-row>
     </a-card>
 
-    <BasicTable @register="registerTable" :api="getInfo"></BasicTable>
+    <BasicTable @register="registerTable" :api="getInfo" />
   </div>
 </template>
 <script lang="ts" name="monitor-redis" setup>

+ 206 - 207
src/views/vent/monitorManager/compressor/nitrogen.data.lt.ts

@@ -1,213 +1,212 @@
 export const nitrogenMonitorData = [
-    {
-        title: '总累计流量',
-        code: 'FluxTotal1',
-        unit: 'm³',
-    },
-    {
-        title: '瞬时流量',
-        code: 'InputFlux',
-        unit: 'm³/min',
-    },
-    {
-        title: '氮气浓度',
-        code: 'NitrogenPurity',
-        unit: '%',
-    },
-    {
-        title: '膜前温度',
-        code: 'PreMembraneTemperature',
-        unit: '℃',
-    },
-    {
-        title: '电机电压',
-        code: 'AirCompressor_SysVoltage',
-        unit: 'V',
-    },
-    {
-        title: '电机电流',
-        code: 'AirCompressor_MainMotor_Current',
-        unit: 'A',
-    },
+  {
+    title: '总累计流量',
+    code: 'FluxTotal1',
+    unit: 'm³',
+  },
+  {
+    title: '瞬时流量',
+    code: 'InputFlux',
+    unit: 'm³/min',
+  },
+  {
+    title: '氮气浓度',
+    code: 'NitrogenPurity',
+    unit: '%',
+  },
+  {
+    title: '膜前温度',
+    code: 'PreMembraneTemperature',
+    unit: '℃',
+  },
+  {
+    title: '电机电压',
+    code: 'AirCompressor_SysVoltage',
+    unit: 'V',
+  },
+  {
+    title: '电机电流',
+    code: 'AirCompressor_MainMotor_Current',
+    unit: 'A',
+  },
 ];
 export const preFanMonitorData = [
-    {
-        title: '电源信号',
-        code: 'AirCompressor_PowerFault',
-        unit: 'signal',
-    },
-    {
-        title: '启停状态',
-        code: 'AirCompressor_Status',
-        unit: 'signal',
-    },
-    {
-        title: '三相不平衡',
-        code: 'AirCompressor_UnbalanceFault',
-        unit: 'signal',
-    },
-    {
-        title: '断相',
-        code: 'AirCompressor_PhaseFailureFault',
-        unit: 'signal',
-    },
-    {
-        title: '先导_上位机',
-        code: 'AirCompressor_CtrlMode',
-        unit: 'signal',
-    },
-    {
-        title: '加载_卸载',
-        code: 'AirCompressor_LoadorUnload',
-        unit: 'signal',
-    },
-    {
-        title: '排气高温',
-        code: 'AirCompressor_ExhaustTemp1',
-        unit: 'signal',
-    },
-    {
-        title: '排气压力过高',
-        code: 'AirCompressor_ExhaustPreHighFault',
-        unit: 'signal',
-    },
-    {
-        title: '接线错误',
-        code: 'AirCompressor_PhaseSequenceFault1',
-        unit: 'signal',
-    },
-    {
-        title: '风机过载',
-        code: 'AirCompressor_Fan_OverloadFault',
-        unit: 'signal',
-    },
-    {
-        title: '合闸失败',
-        code: 'AirCompressor_CloseFail',
-        unit: 'signal',
-    },
-    {
-        title: '油气桶高压',
-        code: 'AirCompressor_OilGasBarrel_HighPressureFault',
-        unit: 'signal',
-    },
-    {
-        title: '油气桶高温',
-        code: 'AirCompressor_OilGasBarrel_OverTempAlarm',
-        unit: 'signal',
-    },
-    {
-        title: '油气桶高温预警预留',
-        code: 'AirCompressor_OilGasBarrel_OverTempAlarm1',
-        unit: 'signal',
-    },
-    {
-        title: '主电机高温',
-        code: 'AirCompressor_MainMotor_OverTempFault',
-        unit: 'signal',
-    },
-    {
-        title: '主机过载',
-        code: 'AirCompressor_MainMotor_OverloadFault',
-        unit: 'signal',
-    },
-    {
-        title: '油压过低',
-        code: 'AirCompressor_OilPressureLowFault',
-        unit: 'signal',
-    },
-    {
-        title: '分闸失败',
-        code: 'AirCompressor_OpenFail',
-        unit: 'signal',
-    },
-    {
-        title: '三相电抗器缺相故障',
-        code: 'AirCompressor_PhaseFailureFault1',
-        unit: 'signal',
-    },
-    {
-        title: '相序故障',
-        code: 'AirCompressor_PhaseSequenceFault',
-        unit: 'signal',
-    },
-    {
-        title: '短路故障',
-        code: 'AirCompressor_ShortCutFaul',
-        unit: 'signal',
-    },
-    {
-        title: '重故障',
-        code: 'AirCompressor_TotalFailureSignal',
-        unit: 'signal',
-    },
-    {
-        title: '轻故障预留',
-        code: 'AirCompressor_TotalFailureSignal1',
-        unit: 'signal',
-    },
-    {
-        title: '过压故障',
-        code: 'AirCompressor_OverVoltageFault',
-        unit: 'signal',
-    },
-    {
-        title: '漏电闭锁故障',
-        code: 'AirCompressor_LeakageLock',
-        unit: 'signal',
-    },
+  {
+    title: '电源信号',
+    code: 'AirCompressor_PowerFault',
+    unit: 'signal',
+  },
+  {
+    title: '启停状态',
+    code: 'AirCompressor_Status',
+    unit: 'signal',
+  },
+  {
+    title: '三相不平衡',
+    code: 'AirCompressor_UnbalanceFault',
+    unit: 'signal',
+  },
+  {
+    title: '断相',
+    code: 'AirCompressor_PhaseFailureFault',
+    unit: 'signal',
+  },
+  {
+    title: '先导_上位机',
+    code: 'AirCompressor_CtrlMode',
+    unit: 'signal',
+  },
+  {
+    title: '加载_卸载',
+    code: 'AirCompressor_LoadorUnload',
+    unit: 'signal',
+  },
+  {
+    title: '排气高温',
+    code: 'AirCompressor_ExhaustTemp1',
+    unit: 'signal',
+  },
+  {
+    title: '排气压力过高',
+    code: 'AirCompressor_ExhaustPreHighFault',
+    unit: 'signal',
+  },
+  {
+    title: '接线错误',
+    code: 'AirCompressor_PhaseSequenceFault1',
+    unit: 'signal',
+  },
+  {
+    title: '风机过载',
+    code: 'AirCompressor_Fan_OverloadFault',
+    unit: 'signal',
+  },
+  {
+    title: '合闸失败',
+    code: 'AirCompressor_CloseFail',
+    unit: 'signal',
+  },
+  {
+    title: '油气桶高压',
+    code: 'AirCompressor_OilGasBarrel_HighPressureFault',
+    unit: 'signal',
+  },
+  {
+    title: '油气桶高温',
+    code: 'AirCompressor_OilGasBarrel_OverTempAlarm',
+    unit: 'signal',
+  },
+  {
+    title: '油气桶高温预警预留',
+    code: 'AirCompressor_OilGasBarrel_OverTempAlarm1',
+    unit: 'signal',
+  },
+  {
+    title: '主电机高温',
+    code: 'AirCompressor_MainMotor_OverTempFault',
+    unit: 'signal',
+  },
+  {
+    title: '主机过载',
+    code: 'AirCompressor_MainMotor_OverloadFault',
+    unit: 'signal',
+  },
+  {
+    title: '油压过低',
+    code: 'AirCompressor_OilPressureLowFault',
+    unit: 'signal',
+  },
+  {
+    title: '分闸失败',
+    code: 'AirCompressor_OpenFail',
+    unit: 'signal',
+  },
+  {
+    title: '三相电抗器缺相故障',
+    code: 'AirCompressor_PhaseFailureFault1',
+    unit: 'signal',
+  },
+  {
+    title: '相序故障',
+    code: 'AirCompressor_PhaseSequenceFault',
+    unit: 'signal',
+  },
+  {
+    title: '短路故障',
+    code: 'AirCompressor_ShortCutFaul',
+    unit: 'signal',
+  },
+  {
+    title: '重故障',
+    code: 'AirCompressor_TotalFailureSignal',
+    unit: 'signal',
+  },
+  {
+    title: '轻故障预留',
+    code: 'AirCompressor_TotalFailureSignal1',
+    unit: 'signal',
+  },
+  {
+    title: '过压故障',
+    code: 'AirCompressor_OverVoltageFault',
+    unit: 'signal',
+  },
+  {
+    title: '漏电闭锁故障',
+    code: 'AirCompressor_LeakageLock',
+    unit: 'signal',
+  },
 
-    {
-        title: '欠压故障',
-        code: 'AirCompressor_LowVoltageFault',
-        unit: 'signal',
-    },
-    {
-        title: '失水故障',
-        code: 'AirCompressor_NoWaterFault',
-        unit: 'signal',
-    },
-    {
-        title: '油过滤器堵塞故障',
-        code: 'AirCompressor_OilGasBarrel_FilterBlockageFault',
-        unit: 'signal',
-    },
-    {
-        title: '油细分离器故障',
-        code: 'AirCompressor_OilGasBarrel_SeparatorFault',
-        unit: 'signal',
-    },
+  {
+    title: '欠压故障',
+    code: 'AirCompressor_LowVoltageFault',
+    unit: 'signal',
+  },
+  {
+    title: '失水故障',
+    code: 'AirCompressor_NoWaterFault',
+    unit: 'signal',
+  },
+  {
+    title: '油过滤器堵塞故障',
+    code: 'AirCompressor_OilGasBarrel_FilterBlockageFault',
+    unit: 'signal',
+  },
+  {
+    title: '油细分离器故障',
+    code: 'AirCompressor_OilGasBarrel_SeparatorFault',
+    unit: 'signal',
+  },
 ];
 export const preMonitorList = [
-    {
-        title: `排气压力`,
-        code: `AirCompressor_ExhaustPre`,
-        unit: 'MPa',
-        child: [],
-    },
-    {
-        title: `排气温度`,
-        code: `AirCompressor_ExhaustTemp`,
-        unit: '℃',
-        child: [],
-    },
-    {
-        title: `加载时间`,
-        code: `AirCompressor_LoadTime`,
-        unit: 'h',
-        child: [],
-    },
-    {
-        title: `运行时间`,
-        code: `RunTime3`,
-        unit: 'h',
-        child: [],
-    },
-    {
-        title: `保养时间`,
-        code: `RunTime4`,
-        unit: 'h',
-        child: [],
-    },
-   
-];
+  {
+    title: `排气压力`,
+    code: `AirCompressor_ExhaustPre`,
+    unit: 'MPa',
+    child: [],
+  },
+  {
+    title: `排气温度`,
+    code: `AirCompressor_ExhaustTemp`,
+    unit: '℃',
+    child: [],
+  },
+  {
+    title: `加载时间`,
+    code: `AirCompressor_LoadTime`,
+    unit: 'h',
+    child: [],
+  },
+  {
+    title: `运行时间`,
+    code: `RunTime3`,
+    unit: 'h',
+    child: [],
+  },
+  {
+    title: `保养时间`,
+    code: `RunTime4`,
+    unit: 'h',
+    child: [],
+  },
+];

+ 16 - 4
src/views/vent/monitorManager/safetyMonitor/index.vue

@@ -179,7 +179,16 @@
         <div class="tab-item">
           <AlarmHistoryTable
             ref="alarmHistoryTable"
-            v-if="activeKey == '3'"
+            v-if="globalConfig.History_Type == 'remote' && activeKey == '3'"
+            columns-type="alarm"
+            :list="safetyList"
+            :device-type="deviceType"
+            :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, pageSize: 10000 })"
+            designScope="alarm-history"
+          />
+          <AlarmHistoryCommentTable
+            ref="alarmHistoryTable"
+            v-else-if="activeKey == '3'"
             columns-type="alarm"
             :device-type="deviceType"
             :device-list-api="getDeviceList.bind(null, { devicekind: deviceType, pageSize: 10000 })"
@@ -204,10 +213,11 @@
 </template>
 
 <script setup lang="ts">
-  import { ref, onMounted, onUnmounted, shallowRef, defineProps, watch, nextTick, unref } from 'vue';
+  import { ref, onMounted, onUnmounted, shallowRef, defineProps, watch, inject, unref } from 'vue';
   import BarAndLine from '/@/components/chart/BarAndLine.vue';
-  import { list, getDeviceList } from './safety.api';
-  import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
+  import { list, getDeviceList, safetyList } from './safety.api';
+  import AlarmHistoryCommentTable from '../comment/AlarmHistoryTable.vue';
+  import AlarmHistoryTable from './AlarmHistoryTable.vue';
   import HistoryTable from './HistoryTable.vue';
   import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
   import MonitorTable from '../comment/MonitorTable.vue';
@@ -218,8 +228,10 @@
   import { getDictItemsByCode } from '/@/utils/dict';
   import { usePermission } from '/@/hooks/web/usePermission';
   import { useGlobSetting } from '/@/hooks/setting';
+
   const { sysOrgCode } = useGlobSetting();
   const { hasPermission } = usePermission();
+  const globalConfig = inject('globalConfig');
 
   // import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
 

+ 3 - 0
src/views/vent/monitorManager/safetyMonitor/safety.api.ts

@@ -6,6 +6,7 @@ enum Api {
   deviceTypeList = '/safety/ventanalyDeviceInfo/DeviceKind/queryBySystem',
   itemList = '/sys/dictItem/list',
   safetyDeviceList = '/ventanaly-device/monitor/codeDict',
+  safetyList = '/ventanaly-device/history/getAlarmHistoryData',
 }
 /**
  * 列表接口
@@ -13,6 +14,8 @@ enum Api {
  */
 export const list = (params) => defHttp.post({ url: Api.list, params });
 
+export const safetyList = (params) => defHttp.post({ url: Api.safetyList, params });
+
 export const safetyDeviceList = (params) => defHttp.post({ url: Api.safetyDeviceList, params });
 
 /**