Przeglądaj źródła

feat: 增加瞬时流量3s请求

sunxiao 4 miesięcy temu
rodzic
commit
49ca6690e5

+ 5 - 1
src/api/control.js

@@ -66,5 +66,9 @@ export const controlApi = {
    */
   getAllEchartData: (params) => http.get(`/front/bigModel/smartAdd/charListAll`, { params }),
   
-    
+  /**
+   * 碳源投加 单独获取碳源投加瞬时流量 - 新
+   */
+  getRealTimeFeedBackValue: () => http.get(`/front/bigModel/smartAdd/getRealTimeFeedBackValue`),
+  
 }

+ 10 - 2
src/views/control/MedicinalView.vue

@@ -25,6 +25,7 @@ let msgReactive = '';
 let timer1 = '';
 let timer2 = '';
 let timerInterval = '';
+let aloneTimer = null;
 const resultNumberSet = ref({
   flowNum1: 0,
   flowNum2: 0,
@@ -433,10 +434,14 @@ const waringTips = () => {
       }
     }
   }).filter(Boolean);
-
-  console.log("warningList", warningList);
 }
 
+// 单独更新碳源投加瞬时流量
+const getRealAloneData = async () => {
+  const { data } = await controlApi.getRealTimeFeedBackValue();
+  resultNumberSet.value.flowNum1 = data.one || 0;
+  resultNumberSet.value.flowNum2 = data.two || 0;
+}
 
 onMounted(async () => {
   let countDown = 5;
@@ -547,6 +552,8 @@ onMounted(async () => {
       return item;
     })
   })
+  
+  aloneTimer = setInterval(getRealAloneData, 3 * 1000)
 
   // 获取是否允许投药开关 - 锡林浩特
   // await controlApi.getSystemStatus().then(({ data }) => {
@@ -560,6 +567,7 @@ onUnmounted(() => {
   clearTimeout(timer1);
   clearTimeout(timer2);
   clearTimeout(timerInterval);
+  clearInterval(aloneTimer)
 })
 
 </script>

+ 2 - 4
src/views/control/components/TheResultPanel.vue

@@ -53,15 +53,13 @@ const emitEvent = (type) => {
 
   const name = type == 'one' ? '北池' : '南池';
   
-
-
   if ( type == 'one' ) {
-    if ( modelSystemStatus.activeOne != 1 ) {
+    if ( modelSystemStatus.value.activeOne != 1 ) {
       return message.warning(name + '-在组态投放下无法开启投放', {duration: 5 * 1000});
     }
     systemStatus.value.activeOne = systemStatus.value.activeOne === 1 ? 0 : 1;
   } else {
-    if ( modelSystemStatus.activeTwo != 1 ) {
+    if ( modelSystemStatus.value.activeTwo != 1 ) {
       return message.warning(name + '-在组态投放下无法开启投放', {duration: 5 * 1000});
     }
     systemStatus.value.activeTwo = systemStatus.value.activeTwo === 1 ? 0 : 1;