Browse Source

[Fix 0000] 修复均压报警的问题

houzekong 5 days ago
parent
commit
85a4e86349

+ 9 - 7
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHomeBD.vue

@@ -130,6 +130,7 @@
   import { getToken } from '/@/utils/auth';
   import { useUserStore } from '/@/store/modules/user';
   import { usePressControl } from '../hooks/useControl';
+  import dayjs from 'dayjs';
   // import { Config } from '../../../deviceManager/configurationTable/types';
 
   const props = defineProps({
@@ -313,23 +314,24 @@
       if (data.cmd !== 'topic' || data.topic !== 'warn') return;
       if (!data.msgTxt) return;
 
-      const { info = '', type = '', avgPressLogId, date } = JSON.parse(data.msgTxt);
+      const { info = '', type = '', avgPressureLogId, date } = JSON.parse(data.msgTxt);
+      const datestr = dayjs(date).format('YYYY-MM-DD HH:mm:ss');
       switch (type) {
         case 'o2':
           if (warnModal1.value) break;
           warnModal1.value = Modal.confirm({
             title: data.msgTitle,
-            content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
+            content: h('div', { style: { color: '#fff' } }, [h('p', datestr), h('p', info)]),
             centered: true,
             okText: '下发调节指令',
             mask: true,
             class: 'balancePress',
             async onOk() {
-              await autoControl(avgPressLogId);
+              await autoControl(avgPressureLogId);
               warnModal1.value = null;
             },
             async onCancel() {
-              await cancelControl(avgPressLogId);
+              await cancelControl(avgPressureLogId);
               warnModal1.value = null;
             },
           });
@@ -343,17 +345,17 @@
           if (warnModal1.value) break;
           warnModal1.value = Modal.confirm({
             title: data.msgTitle,
-            content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
+            content: h('div', { style: { color: '#fff' } }, [h('p', datestr), h('p', info)]),
             centered: true,
             okText: '下发调节指令',
             mask: true,
             class: 'balancePress',
             async onOk() {
-              await autoControl(avgPressLogId);
+              await autoControl(avgPressureLogId);
               warnModal1.value = null;
             },
             async onCancel() {
-              await cancelControl(avgPressLogId);
+              await cancelControl(avgPressureLogId);
               warnModal1.value = null;
             },
           });

+ 2 - 2
src/views/vent/monitorManager/balancePressMonitor/hooks/useControl.ts

@@ -109,7 +109,7 @@ export function usePressControl() {
   function autoControl(avgPressLogId) {
     return controlWindow({ avgPressId: avePressSetting.value.id, avgPressLogId })
       .then(() => {
-        message.success('下发成功');
+        message.success('预警已处理');
       })
       .catch(() => {
         message.error('下发失败');
@@ -119,7 +119,7 @@ export function usePressControl() {
   function cancelControl(avgPressLogId) {
     return cancelcontrolWindow({ avgPressId: avePressSetting.value.id, avgPressLogId })
       .then(() => {
-        message.success('下发成功');
+        message.success('已取消');
       })
       .catch(() => {
         message.error('下发失败');