Pārlūkot izejas kodu

粉尘首页-统计信息提交

lxh 4 mēneši atpakaļ
vecāks
revīzija
b9c794b0dc

+ 1 - 0
.env.development

@@ -21,6 +21,7 @@ VITE_GLOB_API_URL=/modelreq
 #后台接口全路径地址(必填)
 # VITE_GLOB_DOMAIN_URL=http://10.10.150.72:9999
 VITE_GLOB_DOMAIN_URL=http://182.92.126.35:9999
+# VITE_GLOB_DOMAIN_URL=http://192.168.8.12:9999
 
 # 接口前缀
 VITE_GLOB_API_URL_PREFIX=

BIN
src/assets/images/zd-1.png


BIN
src/assets/images/zd-2.png


BIN
src/assets/images/zd-3.png


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 664 - 434
src/views/vent/home/dustInfoTj/index.vue


+ 29 - 10
src/views/vent/safetyList/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="safetyList">
-    <customHeader>安全监控分站管理</customHeader>
+    <customHeader>监控分站管理</customHeader>
     <div class="content">
       <div class="left-box">
         <div class="left-title">
@@ -44,7 +44,7 @@
       </div>
       <div class="right-box">
         <div class="right-title">详细信息:</div>
-        <a-table size="small" :scroll="{ y: 680 }" :columns="columns" :data-source="tableData" :pagination="pagination"
+        <a-table size="small" :scroll="{ y: 710 }" :columns="columns" :data-source="tableData" :pagination="pagination"
           @change="pageChange">
           <template #action="{ record }">
             <a v-show="record.linkId == '0'" class="table-action-link" @click="handlerunDeviceMonitor(record)">启动</a>
@@ -53,10 +53,10 @@
             <template v-if="column.dataIndex === 'valueJc' && text">
               <div v-for="item in text.split(',')" :key="item">
                 <span v-if="item.substring(item.indexOf(':') + 1)"
-                  style="display: inline-block;width: 50%;text-align: right; color:rgb(0, 242, 255);margin-right:5px">{{
+                  style="display: inline-block;width: 48%;text-align: right; color:rgb(0, 242, 255);margin-right:5px">{{
                     item.substring(0, item.indexOf(':') + 1) }}</span>
                 <span v-if="item.substring(item.indexOf(':') + 1)"
-                  style="display: inline-block; width:45%;text-align: left; color:#fff">{{
+                  style="display: inline-block; width:47%;text-align: left; color:#fff">{{
                     item.substring(item.indexOf(':') + 1) }} </span>
               </div>
             </template>
@@ -68,7 +68,7 @@
           @cancel="handleCancel">
           <a-form :model="startupData" labelAlign="right" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
             <a-form-item label="安装位置">
-              <a-input v-model:value="startupData.address" placeholder="请输入" style="width: 260px" />
+              <a-input v-model:value="startupData.address" maxlength="8" placeholder="请输入" style="width: 260px" />
             </a-form-item>
           </a-form>
         </a-modal>
@@ -78,12 +78,11 @@
 </template>
 
 <script setup lang="ts">
-import { ref, nextTick, reactive, onMounted } from 'vue';
+import { ref, nextTick, reactive, onMounted, onUnmounted } from 'vue';
 import customHeader from '/@/components/vent/customHeader.vue';
 import { subStationList, getList, getEdit, runDeviceMonitor } from './safetyList.api';
 import { columns } from './safetyList.data'
 
-let value = ref('12111111')
 let isShow = ref(false)
 let stationName = ref('')
 let stationStatus = ref(null)
@@ -113,9 +112,23 @@ let startupData = reactive({
   address: '',
 })
 let devId = ref('')
-let devName = ref('')
 
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor(flag = false) {
+  timer = setTimeout(
+    async () => {
+      // await getSubStationList()
+      await getStationList()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    flag ? 0 : 5000
+  );
+}
 //获取分站信息
 async function getSubStationList() {
   let res = await subStationList({ strtype: "modbus" })
@@ -165,7 +178,7 @@ async function getStationList() {
       v.linkstatus = v.netStatus
       v.linkstatusC = v.linkstatus ? '连接' : '未连接'
       v.updateTime = v.time
-      v.valueJc = `密度:${v.density || ''},气压:${v.pa || ''},温度:${v.temperature || ''},湿度:${v.humidity || ''},风速:${v.windSpeed || ''},压差:${v.difPress || ''}`
+      v.valueJc = `风量:${v.m3 || ''},风速:${v.va || ''},气压:${v.pa || ''},温度:${v.temperature || ''},湿度:${v.humidity || ''},风速:${v.windSpeed || ''},压差:${v.difPress || ''}`
 
     })
   })
@@ -197,8 +210,14 @@ function handleCancel() {
 
 onMounted(() => {
   getSubStationList()
-  getStationList()
+  getMonitor(true);
 })
+onUnmounted(() => {
+  if (timer) {
+    clearTimeout(timer);
+    timer = undefined;
+  }
+});
 </script>
 
 <style lang="less" scoped>

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels