Kaynağa Gözat

布尔台局部通风机弹窗新增隐藏和紧急停止功能

bobo04052021@163.com 2 ay önce
ebeveyn
işleme
acc49537d6

+ 26 - 4
src/views/vent/monitorManager/fanLocalMonitor/components/dischargeGas.vue

@@ -33,6 +33,10 @@
           <span class="input-box" size="large">{{ data.ductOutletAirVolume_merge }}</span>
           <div class="input-title">局扇供风量(m³/min):</div>
           <span class="input-box" size="large">{{ data.inletAirVolume_merge }}</span>
+          <div class="input-title">瓦斯超限浓度(%):</div>
+          <span class="input-box" size="large">{{ props.gasMax }}</span>
+          <div class="btn btn1" @click="onHide">隐 藏</div>
+          <div class="btn btn1" @click="stop">紧急停止</div>
         </div>
       </div>
     </div>
@@ -44,6 +48,8 @@ import { BasicModal, useModalInner } from '/@/components/Modal';
 import { ref, nextTick, onMounted, watch } from 'vue';
 import { option, chartsColumnListGas, echatsOption1 } from '../fanLocal.data';
 import BarAndLine from '/@/components/chart/BarAndLine.vue';
+import { autoAdjust } from '../fanLocal.api';
+import { message } from 'ant-design-vue';
 const props = defineProps({
   data: {
     type: Object,
@@ -52,6 +58,9 @@ const props = defineProps({
   gasMax: {
     type: Number,
   },
+  fanlocalId: {
+    type: Number,
+  },
 });
 const emit = defineEmits(['close', 'register', 'openModal']);
 // 注册 modal
@@ -86,7 +95,6 @@ watch(
       echartsData.value.shift();
     }
     echartsData.value = [...echartsData.value, combinedData];
-    console.log('echarts data:', echartsData.value);
   }
 );
 function initEcharts() {
@@ -101,6 +109,19 @@ function initEcharts() {
     });
   }
 }
+function onHide() {
+  closeModal();
+}
+function stop() {
+  const params = { auto: 0, fanlocalId: props.fanlocalId };
+  autoAdjust(params)
+    .then(() => {
+      message.success('指令已下发成功!');
+    })
+    .catch(() => {
+      message.error('指令下发失败');
+    });
+}
 onMounted(() => {});
 function onSubmit() {
   emit('close');
@@ -131,7 +152,7 @@ function onSubmit() {
   }
 }
 .setting-box {
-  width: 1570px;
+  width: 100%;
   height: 70px;
   margin: 10px 0;
   background-color: #ffffff05;
@@ -164,7 +185,7 @@ function onSubmit() {
     max-width: 150px;
   }
   .input-box {
-    width: 220px !important;
+    width: 120px !important;
     background: transparent !important;
     border-color: #00d8ff44 !important;
     margin-right: 20px;
@@ -173,11 +194,12 @@ function onSubmit() {
   .btn {
     padding: 8px 20px;
     position: relative;
+    margin: 10px;
     border-radius: 2px;
     color: #fff;
     width: fit-content;
     cursor: pointer;
-
+    float: right;
     &::before {
       position: absolute;
       display: block;

+ 27 - 6
src/views/vent/monitorManager/fanLocalMonitor/components/supplyAir.vue

@@ -29,9 +29,13 @@
       <div class="right-inputs">
         <div class="vent-flex-row">
           <div class="input-title">出风口风量(m³/min):</div>
-          <span class="input-box" size="large">{{ data.ductOutletAirVolume_merge }}</span>
+          <span class="input-box" size="normal">{{ data.ductOutletAirVolume_merge }}</span>
           <div class="input-title">局扇供风量(m³/min):</div>
-          <span class="input-box" size="large">{{ data.inletAirVolume_merge }}</span>
+          <span class="input-box" size="normal">{{ data.inletAirVolume_merge }}</span>
+          <div class="input-title">目标风量(m³/min):</div>
+          <span class="input-box" size="normal">{{ props.targetVolume }}</span>
+          <div class="btn btn1" @click="onHide">隐藏</div>
+          <div class="btn btn1" @click="stop">紧急停止</div>
         </div>
       </div>
     </div>
@@ -44,7 +48,8 @@ import { ref, onMounted, nextTick, watch } from 'vue';
 import echarts from '/@/utils/lib/echarts';
 import BarAndLine from '/@/components/chart/BarAndLine.vue';
 import { option, chartsColumnList1, echatsOption1 } from '../fanLocal.data';
-
+import { autoAdjust } from '../fanLocal.api';
+import { message } from 'ant-design-vue';
 const emit = defineEmits(['close', 'register', 'openModal']);
 const props = defineProps({
   data: {
@@ -54,6 +59,9 @@ const props = defineProps({
   targetVolume: {
     type: Number,
   },
+  fanlocalId: {
+    type: String,
+  },
 });
 // 注册 modal
 const [register, { closeModal }] = useModalInner((data) => {
@@ -86,7 +94,6 @@ watch(
       echartsData.value.shift();
     }
     echartsData.value = [...echartsData.value, combinedData];
-    console.log('echarts data:', echartsData.value);
   }
 );
 function onSubmit() {
@@ -108,6 +115,19 @@ function initEcharts() {
     });
   }
 }
+function onHide() {
+  closeModal();
+}
+function stop() {
+  const params = { auto: 0, fanlocalId: props.fanlocalId };
+  autoAdjust(params)
+    .then(() => {
+      message.success('指令已下发成功!');
+    })
+    .catch(() => {
+      message.error('指令下发失败');
+    });
+}
 onMounted(() => {
   // initEcharts();
 });
@@ -136,7 +156,7 @@ onMounted(() => {
   }
 }
 .setting-box {
-  width: 1570px;
+  width: 100%;
   height: 70px;
   margin: 10px 0;
   background-color: #ffffff05;
@@ -169,7 +189,7 @@ onMounted(() => {
     max-width: 150px;
   }
   .input-box {
-    width: 220px !important;
+    width: 120px !important;
     background: transparent !important;
     border-color: #00d8ff44 !important;
     margin-right: 20px;
@@ -177,6 +197,7 @@ onMounted(() => {
   }
   .btn {
     padding: 8px 20px;
+    margin: 10px;
     position: relative;
     border-radius: 2px;
     color: #fff;

+ 6 - 6
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -172,7 +172,7 @@
       </div>
       <div class="top-right row">
         <template v-for="(item, index) in modalTypeArr.rightBtnArr" :key="index">
-          <div
+          <!-- <div
             v-if="
               (item.permission === 'fanLocal:gasAlarmSet' ||
                 item.permission === 'fanLocal:kkjc' ||
@@ -183,8 +183,8 @@
             :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
             @click="showModal(item)"
             >{{ item.value }}</div
-          >
-          <!-- <div
+          > -->
+          <div
             v-if="
               item.permission === 'fanLocal:gasAlarmSet' ||
               item.permission === 'fanLocal:kkjc' ||
@@ -194,7 +194,7 @@
             :class="{ 'button-box': btnClick, 'button-disable': !btnClick }"
             @click="showModal(item)"
             >{{ item.value }}</div
-          > -->
+          >
         </template>
       </div>
     </div>
@@ -647,8 +647,8 @@
   <!-- 摄像头显示隐藏图标 -->
   <VideoCameraOutlined class="video-icon" :class="{ 'no-play': !showPlay }" @click="changePlay" />
   <ConditionAssistance @register="registerModalAssistance" :dataSource="historySource" />
-  <SupplyAir @register="registerModal2" :data="currentDeviceData" :targetVolume="targetVolume1" />
-  <DischargeGas @register="registerModal3" :data="currentDeviceData" :gasMax="gasWarningVal1" />
+  <SupplyAir @register="registerModal2" :data="currentDeviceData" :targetVolume="targetVolume1" :fanlocalId="selectData.deviceID" />
+  <DischargeGas @register="registerModal3" :data="currentDeviceData" :gasMax="gasWarningVal1" :fanlocalId="selectData.deviceID" />
   <DeviceBaseInfo @register="registerModal" :device-type="selectData['deviceType']" />
   <reportInfo @register="registerModal1" :editID="editID" :fileType="fileType" />
 </template>