Browse Source

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

hongrunxia 1 tuần trước cách đây
mục cha
commit
f71eafdf2a

+ 1 - 0
src/views/vent/deviceManager/configurationTable/configuration.api.ts

@@ -59,5 +59,6 @@ export const saveOrUpdate = (formData: Record<string, number | string | undefine
   const url = isUpdate ? Api.edit : Api.save;
   const params = parseFormDataToParams(formData);
   console.log('debug', params);
+  // return Promise.reject();
   return defHttp.post({ url: url, params });
 };

+ 3 - 9
src/views/vent/home/configurable/dustBD.vue

@@ -69,7 +69,7 @@
   // import { testConfigBDDust } from './configurable.data.bd';
   // import { getToken } from '/@/utils/auth';
 
-  const { configs, fetchConfigs } = useInitConfigs();
+  const { configs, devicesTypes, fetchConfigs } = useInitConfigs();
   const { mainTitle, data, updateData } = useInitPage('保德煤矿粉尘灾害预警系统');
   let interval: number | undefined;
   // function hideLoading() {
@@ -80,18 +80,12 @@
       // configs.value = testConfigBDDust;
 
       getDisHome({
-        dataList: configs.value
-          .map((e) => e.deviceType)
-          .concat('dustAllMineWarn')
-          .join(','),
+        dataList: devicesTypes.value.concat('dustAllMineWarn').join(','),
       }).then(updateData);
     });
     setInterval(() => {
       getDisHome({
-        dataList: configs.value
-          .map((e) => e.deviceType)
-          .concat('dustAllMineWarn')
-          .join(','),
+        dataList: devicesTypes.value.concat('dustAllMineWarn').join(','),
       }).then(updateData);
     }, 60000);
   });

+ 3 - 9
src/views/vent/home/configurable/fireBD.vue

@@ -95,7 +95,7 @@
       return index === 4;
     })
   );
-  const { configs, fetchConfigs } = useInitConfigs();
+  const { configs, devicesTypes, fetchConfigs } = useInitConfigs();
   const { mainTitle, data, updateData } = useInitPage('保德煤矿火灾预警系统');
   let interval: number | undefined;
   // function hideLoading() {
@@ -106,18 +106,12 @@
       // configs.value = testConfigBDFire;
 
       getDisHome({
-        dataList: configs.value
-          .map((e) => e.deviceType)
-          .concat('fireAllMineWarn')
-          .join(','),
+        dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
       }).then(updateData);
     });
     setInterval(() => {
       getDisHome({
-        dataList: configs.value
-          .map((e) => e.deviceType)
-          .concat('fireAllMineWarn')
-          .join(','),
+        dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
       }).then(updateData);
     }, 60000);
   });

+ 3 - 9
src/views/vent/home/configurable/fireWZ.vue

@@ -69,7 +69,7 @@
   import { testConfigWZFire } from './configurable.data.wz';
   // import { getToken } from '/@/utils/auth';
 
-  const { configs } = useInitConfigs();
+  const { configs, devicesTypes } = useInitConfigs();
   const { mainTitle, data, updateData, updateEnhancedConfigs } = useInitPage('王庄煤矿火灾智能监测系统');
   let interval: number | undefined;
   // function hideLoading() {
@@ -81,18 +81,12 @@
     updateEnhancedConfigs(configs.value);
 
     getDisHome({
-      dataList: configs.value
-        .map((e) => e.deviceType)
-        .concat('fireAllMineWarn')
-        .join(','),
+      dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
     }).then(updateData);
     // });
     setInterval(() => {
       getDisHome({
-        dataList: configs.value
-          .map((e) => e.deviceType)
-          .concat('fireAllMineWarn')
-          .join(','),
+        dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
       }).then(updateData);
     }, 60000);
   });

+ 9 - 1
src/views/vent/home/configurable/hooks/useInit.ts

@@ -3,7 +3,7 @@ import { list as cfgList } from '@/views/vent/deviceManager/configurationTable/c
 // import { list } from '@/views/vent/deviceManager/deviceTable/device.api';
 import { Config } from '@/views/vent/deviceManager/configurationTable/types';
 import { getData, getFormattedText } from './helper';
-import { get } from 'lodash-es';
+import { get, isNil } from 'lodash-es';
 
 interface EnhancedConfig extends Config {
   visible: boolean;
@@ -45,6 +45,13 @@ export function useInitConfigs() {
       return c.showStyle.version === '保德';
     });
   });
+  const devicesTypes = computed(() => {
+    return configs.value
+      .map((e) => e.deviceType)
+      .filter((e) => {
+        return !isNil(e);
+      });
+  });
 
   function fetchConfigs(pageType?: string) {
     return cfgList({ pageType }).then(({ records }) => {
@@ -56,6 +63,7 @@ export function useInitConfigs() {
   return {
     fetchConfigs,
     configs,
+    devicesTypes,
     isOriginal,
     isCommon,
     isBD,

+ 5 - 4
src/views/vent/safetyList/common/detail.vue

@@ -663,15 +663,16 @@ async function getStationList1() {
     let res = await getList({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize, })
     res.forEach(el => {
         el.key = el.id
-        el.linkstatusC = el.linkstatus ? '连接' : '未连接'
+        el.linkIdC = el.linkId || ''
+        el.linkstatusC = el.linkstatus ? '连接' : '断开'
         el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : ''
         el.debugTitle = '调试'
         el.children = el.devInfoList
         el.children.forEach(v => {
             v.key = v.id
-            v.linkstatus = v.linkId
             v.debugTitle = '调试'
-            v.linkstatusC = v.linkstatus == '0' ? '待启用' : v.linkstatus == '1' ? '连接' : '断开'
+            v.linkstatusC = v.netStatus ? '连接' : '断开'
+            v.linkIdC = v.linkId == '0' ? '未启用' : v.linkId == '1' ? '启用' : v.linkId == '2' ? '设备异常' : ''
             v.updateTime = v.time
             v.gdmsC = v.gdms == '1' ? '直流供电' : v.gdms == '0' ? '交流供电' : ''
             v.valueJc = `风向:${v.forward || ''},风量:${v.m3 || ''}m³/min,风速:${v.windSpeed || ''}m/s,气压:${v.pa || ''}Pa,压差:${v.difPress || ''}Pa,温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,断面积:${v.area || ''}㎡`
@@ -829,7 +830,7 @@ onUnmounted(() => {
         clearTimeout(timer);
         timer = undefined;
     }
-    if(timer1){
+    if (timer1) {
         clearTimeout(timer1);
         timer1 = undefined;
     }

+ 4 - 3
src/views/vent/safetyList/index.vue

@@ -218,15 +218,16 @@ async function getStationList() {
   let res = await getList({ subId: stationId.value, pageNo: pagination.current, pageSize: pagination.pageSize, })
   res.forEach(el => {
     el.key = el.id
-    el.linkstatusC = el.linkstatus ? '连接' : '未连接'
     el.gdmsC = el.gdms == '1' ? '直流供电' : el.gdms == '0' ? '交流供电' : ''
+    el.linkIdC = el.linkId || ''
+    el.linkstatusC = el.linkstatus ? '连接' : '断开'
     el.debugTitle = '调试'
     el.children = el.devInfoList
     el.children.forEach(v => {
       v.key = v.id
-      v.linkstatus = v.linkId
       v.debugTitle = '调试'
-      v.linkstatusC = v.linkstatus == '0' ? '待启用' : v.linkstatus == '1' ? '连接' : '断开'
+      v.linkstatusC = v.netStatus ? '连接' : '断开'
+      v.linkIdC = v.linkId == '0' ? '未启用' : v.linkId == '1' ? '启用' : v.linkId == '2' ? '设备异常' : ''
       v.updateTime = v.time
       v.gdmsC = v.gdms == '1' ? '直流供电' : v.gdms == '0' ? '交流供电' : ''
       v.valueJc = `风向:${v.forward || ''},风量:${v.m3 || ''}m³/min,风速:${v.windSpeed || ''}m/s,气压:${v.pa || ''}Pa,压差:${v.difPress || ''}Pa,温度:${v.temperature || ''}℃,湿度:${v.humidity || ''}%,断面积:${v.area || ''}㎡`

+ 10 - 2
src/views/vent/safetyList/safetyList.data.ts

@@ -23,7 +23,7 @@ export const columns: BasicColumn[] = [
         title: '供电模式',
         dataIndex: 'gdmsC',
         key: 'gdmsC',
-        width: 100,
+        width: 90,
         align: 'center',
     },
     {
@@ -34,12 +34,20 @@ export const columns: BasicColumn[] = [
         align: 'center',
     },
     {
-        title: '连接状态',
+        title: '启用状态',
+        dataIndex: 'linkIdC',
+        key: 'linkIdC',
+        width: 80,
+        align: 'center',
+    },
+    {
+        title: '通讯状态',
         dataIndex: 'linkstatusC',
         key: 'linkstatusC',
         width: 80,
         align: 'center',
     },
+
     {
         title: '时间',
         dataIndex: 'updateTime',

BIN
分站管理通讯状态,连接状态修改.zip