瀏覽代碼

[Wip 0000] 内因火灾场景添加注氮机控制按钮

houzekong 2 月之前
父節點
當前提交
44cdf43ad5
共有 1 個文件被更改,包括 50 次插入7 次删除
  1. 50 7
      src/views/vent/monitorManager/alarmMonitor/common/closeWall.vue

+ 50 - 7
src/views/vent/monitorManager/alarmMonitor/common/closeWall.vue

@@ -40,6 +40,18 @@
           <span>{{ topContent.smokeJd || '-' }}</span>
         </div>
       </div>
+      <div class="pl-10px pr-10px">
+        <div class="mb-10px">
+          <APopconfirm title="确认操作?" @confirm="controlDevice('dianwei', 'zhi')">
+            <AButton class="w-full" type="primary">超值启动注氮机</AButton>
+          </APopconfirm>
+        </div>
+        <div>
+          <APopconfirm title="确认操作?" @confirm="controlDevice('dianwei', 'zhi')">
+            <AButton class="w-full" type="primary">启动应急控制</AButton>
+          </APopconfirm>
+        </div>
+      </div>
     </div>
     <div class="content">
       <div class="title-b">采空区密闭参数</div>
@@ -109,12 +121,14 @@
   import echartLine1 from './echartLine1.vue';
   import warnZb from './warnZb.vue';
   import PredictionCurve from './predictionCurve.vue';
-  import BaseTab from '../../../gas/components/tab/baseTab.vue';
+  import { message } from 'ant-design-vue';
+  import { deviceControlApi } from '/@/api/vent/index';
 
   let props = defineProps({
     listData: Object,
   });
 
+  const globalConfig = inject('globalConfig');
   const shownChart = ref('default');
   let maxY = ref<any>(0);
   let selectSj = ref<any[]>([]);
@@ -122,7 +136,7 @@
   let selectList = reactive<any[]>([]);
   let widthV = ref('75%');
   let heightV = ref('80%');
-  let coordDw = ref<any[]>([31,62, 110]);
+  let coordDw = ref<any[]>([31, 62, 110]);
   let widthCanvas = ref(562);
   let heightCanvas = ref(316);
   //设备连接状态
@@ -388,6 +402,32 @@
     netStatus.value = data['netStatus'];
   }
 
+  // 设备控制
+  function controlDevice(code, value?) {
+    Promise.all(
+      [].map(({ deviceID, deviceType }) => {
+        return deviceControlApi({
+          deviceid: deviceID,
+          devicetype: deviceType,
+          paramcode: code,
+          value,
+          // password: passWord || globalConfig?.simulatedPassword,
+        });
+      })
+    ).then((res) => {
+      // 模拟时开启
+      if (res.success) {
+        if (globalConfig.History_Type == 'remote') {
+          message.success('指令已下发至生产管控平台成功!');
+        } else {
+          message.success('指令已下发成功!');
+        }
+      } else {
+        message.error(res.message);
+      }
+    });
+  }
+
   /** 预测曲线的配置,数据分别为平均、最大、最小、当前值 */
   const curveConfig = ref<any>({ id: '0', label: '', time: new Date(), data: [0, 0, 0, 0] });
 
@@ -510,8 +550,9 @@
         display: flex;
 
         &:nth-child(1) {
-          justify-content: space-around;
+          justify-content: space-between;
           align-items: center;
+          padding: 0px 40px;
           flex: 2;
           height: 100%;
           border-right: 2px solid;
@@ -524,13 +565,15 @@
           justify-content: space-around;
           align-items: center;
           height: 73%;
+          border-right: 2px solid;
+          border-image: var(--border-image-2) 1 1 1;
         }
 
         .contents {
           height: 73%;
 
           &:nth-child(1) {
-            width: 40%;
+            width: 50%;
             display: flex;
             flex-direction: column;
             justify-content: space-around;
@@ -554,17 +597,17 @@
           }
 
           &:nth-child(2) {
-            width: 40%;
+            width: 50%;
             display: flex;
             justify-content: center;
             align-items: center;
 
             img {
               position: relative;
-              width: 23%;
+              width: 90px;
               height: 100%;
               background: var(--image-pj) no-repeat center;
-              background-size: 50% 50%;
+              background-size: 90px 50%;
             }
 
             .text {