Sfoglia il codice sorgente

灾害预警系统-定时器添加

lxh 1 anno fa
parent
commit
a49cb50876

+ 18 - 2
src/views/vent/dust/dustAtomizing/index.vue

@@ -172,14 +172,28 @@ let columns = reactive<any[]>([
   },
 ])
 
-
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      await getList()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
 
 //获取喷雾列表
 async function getList() {
-  dataSource.length = 0
+
   let res = await realData({ deviceName: formState.devicename, type: "DustPw" })
   console.log(res, '喷雾列表数据------')
   if (res.length != 0) {
+    dataSource.length = 0
     res.forEach(el => {
       el.timingSwitch = el.timingSwitch == '1' ? '是' : '否'
       el.stateSpray = el.stateSpray == '1' ? '喷雾开' : '喷雾关'
@@ -197,10 +211,12 @@ async function getList() {
 //列表查询
 function getSearch() {
   getList()
+  
 }
 
 onMounted(() => {
   getList()
+  getMonitor()
 })
 </script>
 

+ 27 - 7
src/views/vent/dust/dustHome/index.vue

@@ -2,7 +2,7 @@
   <div class="dustHome">
     <!-- 模型区域 -->
     <div class="moduleArea">
-      <iframe src="http://82.157.13.146:18224/" width="100%" height="100%" frameborder="0"></iframe>
+      <iframe src="http://82.157.13.146:18224/valkyrja" width="100%" height="100%" frameborder="0"></iframe>
     </div>
     <div class="main-container">
       <div class="left-area">
@@ -106,6 +106,21 @@ let dustGlzbData = reactive<any[]>([
   { label: '水阀', val: 0 },
 ])
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      await getFireAreaInfoList()
+      await getRealDataList()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
 
 //综放工作面下拉选项切换
 function changeSelect(data) {
@@ -127,11 +142,12 @@ function changeSelect1(data) {
 }
 //获取工作面风险监测数据
 async function getFireAreaInfoList() {
-  cardData.length = 0
-  echartDataWork.length = 0
+
   let res = await getAreaTypeList()
   console.log(res, '工作面风险监测数据')
   if (res.length != 0) {
+    cardData.length = 0
+    echartDataWork.length = 0
     res.forEach(el => {
       cardData.push({
         title: '风险',
@@ -148,10 +164,11 @@ async function getFireAreaInfoList() {
 }
 //获取粉尘选项数据
 async function getRealSensorDataByTypeList() {
-  selectListBd.length = 0
+
   let res = await getRealSensorDataByType({ areaType: areaType.value })
   console.log(res, '下拉选项数据---')
   if (res.length != 0) {
+    selectListBd.length = 0
     res.forEach(el => {
       selectListBd.push({
         label: el.name, value: el.code, temperature: el.temperature, humidity: el.humidity, windSpeed: el.windSpeed, waterPressure: el.waterPressure,
@@ -178,12 +195,13 @@ async function getDustInfosList() {
 }
 //获取粉尘图表数据
 async function historyAndForecastList(params) {
-  echartData.xData.length = 0
-  echartData.yData.length = 0
+
 
   let res = await historyAndForecast({ areaCode: params })
   console.log(res, '粉尘图表数据----')
   if (res.lineData.length != 0) {
+    echartData.xData.length = 0
+    echartData.yData.length = 0
     res.lineData.forEach(el => {
       echartData.xData.push(el.time)
       echartData.yData.push(el.value || 0)
@@ -193,10 +211,11 @@ async function historyAndForecastList(params) {
 
 //获取智能喷雾降尘装置数据
 async function getRealDataList() {
-  pwData.length = 0
+
   let res = await realData({ type: "DustPw" })
   console.log(res, '智能喷雾降尘装置数据')
   if (res.length != 0) {
+    pwData.length = 0
     deviceTotal.value = res.length
     pwTotal.value = res.filter(v => v.deviceState == '1').length
     interTotal.value = res.filter(v => v.stateConn == '1').length
@@ -213,6 +232,7 @@ async function getRealDataList() {
 onMounted(() => {
   getFireAreaInfoList()
   getRealDataList()
+  getMonitor()
 })
 
 </script>

+ 34 - 15
src/views/vent/dust/dustWarnAnalysis/index.vue

@@ -35,14 +35,14 @@ import { getAreaTypeList, getRealSensorDataByType, getDustInfos, historyAndForec
 let areaType = ref('')
 let sensorCode = ref('')
 
-let warningLevel=ref('')//风险等级
+let warningLevel = ref('')//风险等级
 
 let cardData4 = reactive<any[]>([])
 let cardData5 = reactive<any[]>([
-  {id:0,val:0},
-  {id:1,val:0},
-  {id:2,val:0},
-  {id:3,val:0},
+  { id: 0, val: 0 },
+  { id: 1, val: 0 },
+  { id: 2, val: 0 },
+  { id: 3, val: 0 },
 ])
 
 
@@ -63,17 +63,33 @@ let echartData = reactive({
   legendName: ['实时值', '预测值']
 })
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      await getAreaTypeListd()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
+
 //获取左侧菜单树
 async function getAreaTypeListd() {
   let res = await getAreaTypeList()
 
   if (res.length != 0) {
+    treeData.length = 0
     res.forEach((el, ind) => {
       treeData.push({ name: el.typeName, value: ind, id: ind, pid: null, areaType: el.areaType, warningLevel: el.warningLevel, })
     })
     console.log(treeData, '粉尘左侧菜单树')
     areaType.value = treeData[0]['areaType']
-    warningLevel.value=treeData[0]['warningLevel']==1 ? '低风险' : treeData[0]['warningLevel']==2 ? '中风险': treeData[0]['warningLevel']==3 ? '较高风险' : treeData[0]['warningLevel']==4 ? '重大风险' : '--'
+    warningLevel.value = treeData[0]['warningLevel'] == 1 ? '低风险' : treeData[0]['warningLevel'] == 2 ? '中风险' : treeData[0]['warningLevel'] == 3 ? '较高风险' : treeData[0]['warningLevel'] == 4 ? '重大风险' : '--'
     //获取粉尘选项数据
     getRealSensorDataByTypeList()
   }
@@ -87,10 +103,11 @@ function selectChange(treeNode) {
 
 //获取粉尘选项数据
 async function getRealSensorDataByTypeList() {
-  cardData4.length = 0
+
   let res = await getRealSensorDataByType({ areaType: areaType.value })
   console.log(res, '粉尘选项数据---')
   if (res.length != 0) {
+    cardData4.length = 0
     res.forEach(el => {
       cardData4.push({
         title: el.name, sensorCode: el.code, list: [
@@ -117,23 +134,24 @@ function toggleDustCards(data) {
 async function getDustInfosList() {
   let res = await getDustInfos({ sensorCode: sensorCode.value })
   console.log(res, '单项数据------')
-  cardData5[0].val=res.dustDensity
-  cardData5[1].val=res.dustDensityAverage
-  cardData5[2].val=res.dustDensityAverage40
-  cardData5[3].val=res.explodeDensity
-  
+  cardData5[0].val = res.dustDensity
+  cardData5[1].val = res.dustDensityAverage
+  cardData5[2].val = res.dustDensityAverage40
+  cardData5[3].val = res.explodeDensity
+
   //获取粉尘图表数据
   historyAndForecastList(res.areaCode)
 }
 
 //获取粉尘图表数据
 async function historyAndForecastList(params) {
-  echartData.xData.length = 0
-  echartData.yData.length = 0
-  echartData.yData1.length = 0
+
   let res = await historyAndForecast({ areaCode: params })
   console.log(res, '粉尘图表数据----')
   if (res.lineData.length != 0) {
+    echartData.xData.length = 0
+    echartData.yData.length = 0
+    echartData.yData1.length = 0
     res.lineData.forEach(el => {
       echartData.xData.push(el.time)
       echartData.yData.push(el.value || 0)
@@ -144,6 +162,7 @@ async function historyAndForecastList(params) {
 
 onMounted(() => {
   getAreaTypeListd()
+  getMonitor()
 })
 </script>
 

+ 29 - 8
src/views/vent/fire/compositeWarn/index.vue

@@ -106,6 +106,22 @@ let echartDataGx = reactive(
 let gxSelectList = reactive<any[]>([])
 let gxSelect = ref('')
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      //工作面
+      await getFireAreaInfos()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
+
 //时间选项切换
 function onDataChange(value, dateString) {
   TimeRange.value = [dateString[0], dateString[1]]
@@ -113,15 +129,16 @@ function onDataChange(value, dateString) {
 }
 //获取左侧菜单树
 async function getFireAreaInfos() {
+  treeData.length = 0
   const res = await getFireAreaInfo({ fireCauseType: 2 })
   if (res.length != 0) {
     res.forEach((el, ind) => {
       if (el.areaType == 2) {
-        treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode, gxcwCnt: el.gxcwCnt, sgjcCnt: el.sgjcCnt, infoTypeTwo: el.infoTypeTwo,warningLevel:el.warningLevel })
+        treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode, gxcwCnt: el.gxcwCnt, sgjcCnt: el.sgjcCnt, infoTypeTwo: el.infoTypeTwo, warningLevel: el.warningLevel })
       }
     })
     areaCode.value = treeData[0]['areaCode']
-    warningLevel.value = treeData[0].warningLevel == 1 ? '低风险' : treeData[0].warningLevel == 2 ? '中风险' : treeData[0].warningLevel == 3 ? '较高风险' : treeData[0].warningLevel == 4 ? '重大风险' :   '--'
+    warningLevel.value = treeData[0].warningLevel == 1 ? '低风险' : treeData[0].warningLevel == 2 ? '中风险' : treeData[0].warningLevel == 3 ? '较高风险' : treeData[0].warningLevel == 4 ? '重大风险' : '--'
     console.log(treeData, 'treeData-------')
     cardContentList[0]['val'] = treeData[0].infoTypeTwo.maxTemperature
     cardContentList[1]['val'] = treeData[0].infoTypeTwo.minTemperature
@@ -177,10 +194,11 @@ function selectChange(treeNode) {
 
 //获取工作面光钎条数及测点编号
 async function getInfosByAreaCodeList() {
-  gxSelectList.length = 0
+
   let res = await getInfosByAreaCode({ areaCode: areaCode.value })
   console.log(res, '工作面光钎条数及测点编号')
   if (res.length != 0) {
+    gxSelectList.length = 0
     res.forEach(el => {
       gxSelectList.push({
         label: el.pointName,
@@ -200,11 +218,12 @@ function pointChange(val) {
 }
 //获取光钎测温图表数据
 async function getGxcwHistoryDataByPointCodeList() {
+
+  let res = await getGxcwHistoryDataByPointCode({ pointCode: gxSelect.value })
+  console.log(res, '光钎测温图表数据')
   echartDataGx.xData.length = 0
   echartDataGx.yData.length = 0
   echartDataGx.yData1.length = 0
-  let res = await getGxcwHistoryDataByPointCode({ pointCode: gxSelect.value })
-  console.log(res, '光钎测温图表数据')
   res.time.forEach(el => {
     echartDataGx.xData.push(el)
   })
@@ -246,11 +265,12 @@ function toggleChange(title) {
 }
 //获取束管曲线数据
 async function getSgjcHistoryDataList() {
+
+  let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
+  console.log(res, '束管曲线数据-------')
   echartData.xData.length = 0
   echartData.yData.length = 0
   echartData.yData1.length = 0
-  let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
-  console.log(res, '束管曲线数据-------')
   res.time.forEach(el => {
     echartData.xData.push(el)
   })
@@ -260,8 +280,9 @@ async function getSgjcHistoryDataList() {
 }
 
 onMounted(() => {
-
   getFireAreaInfos()
+  getMonitor()
+
 })
 
 </script>

+ 22 - 1
src/views/vent/fire/fireDistributionPoint/index.vue

@@ -21,7 +21,6 @@
 <script lang="ts" setup>
 import { ref, reactive, onMounted } from 'vue';
 import basicSensor from '../../common/basicSensor.vue';
-import basicTree from '../../common/basicTree.vue'
 import { getFireAreaInfo, getZcHfWd, getHeadingFace, getDsWd, getMainTrafficYw } from './firePoint.api'
 
 let sensorTitle = ref('综放工作面传感器监测');
@@ -52,6 +51,22 @@ let sensorList3 = reactive<any[]>([])
 //数据随便写的,不符合实际情况,因为懒得改
 const treeData = reactive<any[]>([])
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      //工作面
+      await getFireAreaInfos()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
+
 
 //获取左侧菜单树
 async function getFireAreaInfos() {
@@ -74,6 +89,7 @@ async function getZcHfWdList() {
   let res = await getZcHfWd()
   console.log(res, '综放工作面传感器监测数据')
   if (res.length != 0) {
+    sensorList.length=0
     res.forEach(el => {
       sensorList.push({ name: el.nodePlacement, status: el.detectValue + '', warn: el.warningMsg, times: el.dateTime })
     })
@@ -85,6 +101,7 @@ async function getHeadingFaceList() {
   let res = await getHeadingFace()
   console.log(res, '掘进工作面传感器监测数据')
   if (res.length != 0) {
+    sensorList1.length=0
     res.forEach(el => {
       sensorList1.push({ name: el.name, nd: el.co + '', status: el.wd + '', warn: el.warningMsg, times: el.dateTime })
     })
@@ -96,6 +113,7 @@ async function getMainTrafficYwList() {
   let res = await getMainTrafficYw()
   console.log(res, '运输系统烟雾传感器数据')
   if (res.length != 0) {
+    sensorList2.length=0
     res.forEach(el => {
       sensorList2.push({ name: el.nodePlacement, status: el.detectValue + '', warn: el.warningMsg, times: el.dateTime })
     })
@@ -107,6 +125,7 @@ async function getDsWdList() {
   let res = await getDsWd()
   console.log(res, '机电硐室传感器数据')
   if (res.length != 0) {
+    sensorList3.length=0
     res.forEach(el => {
       sensorList3.push({ name: el.nodePlacement, status: el.detectValue + '', warn: el.warningMsg, times: el.dateTime })
     })
@@ -115,6 +134,8 @@ async function getDsWdList() {
 
 onMounted(() => {
   getFireAreaInfos()
+  getMonitor()
+  
 })
 
 </script>

+ 28 - 20
src/views/vent/fire/fireGoaf/index.vue

@@ -8,7 +8,7 @@
         <basicCard3 :card3List="card3List" :warningLevel="warningLevel" @toggleChange="toggleChange"></basicCard3>
       </div>
       <div class="composite-bot-box">
-       
+
         <div class="search-area">
           <div class="area-title">束管系统监测</div>
           <RangePicker v-model="TimeRange" size="small" style="width: 260px" :show-time="{ format: 'HH:mm:ss' }"
@@ -18,7 +18,7 @@
         <div class="content-area">
           <basicEchartLine :gridV="gridV" :echartData="echartData"></basicEchartLine>
         </div>
-       
+
       </div>
     </div>
   </div>
@@ -35,17 +35,7 @@ import { getFireAreaInfo, getMbRealData, getMbHistoryData } from './goaf.api'
 
 
 let TimeRange = ref<any>([dayjs().subtract(60, 'minute').format('YYYY-MM-DD HH:mm:ss'), dayjs().format('YYYY-MM-DD HH:mm:ss')])  //查询时间
-let card3List = reactive<any[]>([
-  // { title: 'O2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'N2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'CO(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'CO2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'CH4(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'C2H4(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'C2H2(ppm)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'H2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-  // { title: 'NO2(%)', ndLabel: '浓度 : ', ndVal: '14.79', tLabel: '时间 : ', tVal: '2023-05-14 15:26:24', aLabel: '位置 : ', aVal: '81203综放工作面' },
-])
+let card3List = reactive<any[]>([])
 
 //左侧菜单树
 const treeData = reactive<any[]>([])
@@ -67,6 +57,22 @@ let echartData = reactive({
   legendName: ['实时值', '预测值']
 })
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      //工作面
+      await getFireAreaInfos()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
+
 //时间选项切换
 function onDataChange(value, dateString) {
   TimeRange.value = [dateString[0], dateString[1]]
@@ -85,11 +91,11 @@ function selectChange(treeNode) {
 //获取左侧菜单树
 async function getFireAreaInfos() {
   const res = await getFireAreaInfo({ fireCauseType: 2 })
-  // treeData.length = 0
   if (res.length != 0) {
+    treeData.length = 0
     res.forEach((el, ind) => {
       if (el.areaType == 1) {
-        treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode,warningLevel:el.warningLevel })
+        treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode, warningLevel: el.warningLevel })
       }
     })
     areaCode.value = treeData[0]['areaCode']
@@ -101,10 +107,11 @@ async function getFireAreaInfos() {
 
 //获取密闭监测实时数据
 async function getMbRealDataList() {
-  card3List.length=0
+
   let res = await getMbRealData({ areaCode: areaCode.value })
   console.log(res, '密闭监测实时数据------')
   if (res.length != 0) {
+    card3List.length = 0
     res.forEach(el => {
       card3List.push({ title: el.type, ndLabel: '浓度 : ', ndVal: el.currentValue, tLabel: '时间 : ', tVal: el.time, aLabel: '位置 : ', aVal: el.position })
     })
@@ -121,12 +128,12 @@ function toggleChange(title) {
 }
 //获取密闭图表数据
 async function getMbHistoryDataList() {
+ 
+  let res = await getMbHistoryData({ areaCode: areaCode.value, type: type.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
+  console.log(res, '密闭图表数据------')
   echartData.xData.length = 0
   echartData.yData.length = 0
   echartData.yData1.length = 0
-  let res = await getMbHistoryData({ areaCode: areaCode.value, type: type.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
-  console.log(res, '密闭图表数据------')
-
   res.time.forEach(el => {
     echartData.xData.push(el)
   })
@@ -138,6 +145,7 @@ async function getMbHistoryDataList() {
 
 onMounted(() => {
   getFireAreaInfos()
+  getMonitor()
 
 })
 </script>
@@ -189,7 +197,7 @@ onMounted(() => {
         justify-content: space-between;
         height: 30px;
 
-        .area-title{
+        .area-title {
           color: #fff;
           font-family: douyuFont;
           font-size: 16px;

+ 56 - 20
src/views/vent/fire/fireHome/index.vue

@@ -2,7 +2,7 @@
   <div class="fireHome">
     <!-- 模型区域 -->
     <div class="moduleArea">
-      <iframe src="http://82.157.13.146:18224/" width="100%" height="100%" frameborder="0"></iframe>
+      <iframe src="http://82.157.13.146:18224/valkyrja" width="100%" height="100%" frameborder="0"></iframe>
     </div>
     <div class="main-container">
       <div class="left-area">
@@ -137,6 +137,30 @@ let selectListAq = reactive<any[]>([
 let safetyHead = reactive<any[]>([])
 let safetyList = reactive<any[]>([])
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      //工作面
+      await getFireAreaInfoList()
+      //密闭
+      await getFireAreaInfoListMb()
+      //带式
+      await getFireAreaInfoListDs()
+      //变电硐室
+      await getFireAreaInfoListBd()
+      //安全监控
+      await getTableList()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
+
 //下拉选项切换
 function changeSelect(data) {
   console.log(data, '下拉------')
@@ -167,13 +191,13 @@ function changeSelect(data) {
 
 //获取工作面风险监测数据
 async function getFireAreaInfoList() {
-  echartDataWork.length = 0
-  cardData.length = 0
+
   let res = await getFireAreaInfo({ fireCauseType: 2 })
 
   if (res.length != 0) {
+    echartDataWork.length = 0
+    cardData.length = 0
     let data = res.filter(v => v.areaType == 2)
-
     data.forEach(el => {
       cardData.push({
         title: '风险',
@@ -191,10 +215,11 @@ async function getFireAreaInfoList() {
 
 //获取密闭下拉列表
 async function getFireAreaInfoListMb() {
-  selectListMb.length = 0
+
   let res = await getFireAreaInfo({ fireCauseType: 2 })
   console.log(res, '密闭数据')
   if (res.length != 0) {
+    selectListMb.length = 0
     let dataMb = res.filter(m => m.areaType == 1)
     dataMb.forEach(m => {
       selectListMb.push({ label: m.areaName, value: m.areaCode })
@@ -206,9 +231,10 @@ async function getFireAreaInfoListMb() {
 }
 //获取密闭监测实时信息
 async function getMbRealDataList() {
-  emptyData.length = 0
+
   let res = await getMbRealData({ areaCode: areaCodeMb.value })
   console.log(res, '密闭监测实时信息')
+  emptyData.length = 0
   res.forEach(el => {
     emptyData.push({ label: el.name, val: el.currentValue },)
   })
@@ -216,10 +242,11 @@ async function getMbRealDataList() {
 
 //工作面束管监测
 async function getSgjcPointInfoList() {
-  selectList.length = 0
+
   let res = await getSgjcPointInfo({ areaCode: areaCode.value })
   console.log(res, '工作面束管列表---')
   if (res.length != 0) {
+    selectList.length = 0
     res.forEach(el => {
       selectList.push({ label: el.pointName, value: el.pointCode })
     })
@@ -230,10 +257,11 @@ async function getSgjcPointInfoList() {
 }
 //获取工作面束管测点实时数据
 async function getSgjcRealDataByPointCodeList() {
-  bunbleData.length = 0
+
   let res = await getSgjcRealDataByPointCode({ pointCode: pointCode.value })
   console.log(res, '束管测点实时数据---')
   if (res.length != 0) {
+    bunbleData.length = 0
     res.forEach(el => {
       bunbleData.push({
         type: el.type,
@@ -250,10 +278,11 @@ async function getSgjcRealDataByPointCodeList() {
 
 //带式输送机防灭火监控系统
 async function getFireAreaInfoListDs() {
-  selectListDs.length = 0
-  outFireData.length = 0
+
   const res = await getFireAreaInfo({})
   if (res.length != 0) {
+    selectListDs.length = 0
+    outFireData.length = 0
     let dataDs = res.filter(m => m.areaType == 4)
     console.log(dataDs, '带式输送机防灭火')
     dataDs.forEach(el => {
@@ -294,10 +323,11 @@ async function getFireAreaInfoListBd() {
 }
 //获取光钎条数及测点编号
 async function getInfosByAreaCodeList() {
-  selectListBd.length = 0
+
   let res = await getInfosByAreaCode({ areaCode: areaCodeBd.value })
   console.log(res, 'res000999')
   if (res.length != 0) {
+    selectListBd.length = 0
     res.forEach(el => {
       selectListBd.push({
         label: el.pointName,
@@ -312,11 +342,12 @@ async function getInfosByAreaCodeList() {
 
 //获取光钎测温图表数据
 async function getGxcwHistoryDataByPointCodeList() {
+
+  let res = await getGxcwHistoryDataByPointCode({ pointCode: pointCodeBd.value })
+  console.log(res, '光钎测温图表数据-------')
   echartDatas.xData.length = 0
   echartDatas.yData.length = 0
   echartDatas.yData1.length = 0
-  let res = await getGxcwHistoryDataByPointCode({ pointCode: pointCodeBd.value })
-  console.log(res, '光钎测温图表数据-------')
   res.time.forEach(el => {
     echartDatas.xData.push(el)
   })
@@ -350,10 +381,11 @@ function getTableList() {
 }
 //获取综放工作面传感器监测数据
 async function getZcHfWdList() {
-  safetyHead.length = 0
-  safetyList.length = 0
+
   let res = await getZcHfWd()
   console.log(res, '综放工作面传感器监测数据')
+  safetyHead.length = 0
+  safetyList.length = 0
   safetyHead.push(
     { label: '测点位置' },
     { label: '温度(°C)' },
@@ -369,9 +401,10 @@ async function getZcHfWdList() {
 
 //获取掘进工作面传感器监测数据
 async function getHeadingFaceList() {
+
+  let res = await getHeadingFace()
   safetyHead.length = 0
   safetyList.length = 0
-  let res = await getHeadingFace()
   safetyHead.push(
     { label: '测点位置' },
     { label: 'CO浓度(%)' },
@@ -388,9 +421,10 @@ async function getHeadingFaceList() {
 }
 //获取运输系统烟雾传感器数据
 async function getMainTrafficYwList() {
+
+  let res = await getMainTrafficYw()
   safetyHead.length = 0
   safetyList.length = 0
-  let res = await getMainTrafficYw()
   safetyHead.push(
     { label: '测点位置' },
     { label: '温度(°C)' },
@@ -407,10 +441,11 @@ async function getMainTrafficYwList() {
 
 //获取机电硐室传感器数据
 async function getDsWdList() {
-  safetyHead.length = 0
-  safetyList.length = 0
+
   let res = await getDsWd()
   console.log(res, '机电硐室传感器数据')
+  safetyHead.length = 0
+  safetyList.length = 0
   safetyHead.push(
     { label: '测点位置' },
     { label: '温度(°C)' },
@@ -434,9 +469,10 @@ onMounted(() => {
   getFireAreaInfoListDs()
   //变电硐室
   getFireAreaInfoListBd()
-
   //安全监控
   getTableList()
+  getMonitor()
+
 })
 </script>
 

+ 29 - 7
src/views/vent/fire/fireMonitor/index.vue

@@ -96,6 +96,22 @@ let echartDataGx = reactive(
 let gxSelectList = reactive<any[]>([])
 let gxSelect = ref('')
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      //工作面
+      await getFireAreaInfos()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
+
 //时间选项切换
 function onDataChange(value, dateString) {
   TimeRange.value = [dateString[0], dateString[1]]
@@ -106,9 +122,10 @@ function onDataChange(value, dateString) {
 async function getFireAreaInfos() {
   const res = await getFireAreaInfo({})
   if (res.length != 0) {
+    treeData.length = 0
     res.forEach((el, ind) => {
       if (el.areaType == 5) {
-        treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode, gxcwCnt: el.gxcwCnt, sgjcCnt: el.sgjcCnt, infoTypeTwo: el.infoTypeTwo,warningLevel:el.warningLevel })
+        treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode, gxcwCnt: el.gxcwCnt, sgjcCnt: el.sgjcCnt, infoTypeTwo: el.infoTypeTwo, warningLevel: el.warningLevel })
       }
     })
     areaCode.value = treeData[0]['areaCode']
@@ -174,10 +191,11 @@ function selectChange(treeNode) {
 
 //获取光钎条数及测点编号
 async function getInfosByAreaCodeList() {
-  gxSelectList.length = 0
+
   let res = await getInfosByAreaCode({ areaCode: areaCode.value })
   console.log(res, '光钎条数及测点编号')
   if (res.length != 0) {
+    gxSelectList.length = 0
     res.forEach(el => {
       gxSelectList.push({
         label: el.pointName,
@@ -197,11 +215,12 @@ function pointChange(val) {
 }
 //获取光钎测温图表数据
 async function getGxcwHistoryDataByPointCodeList() {
+
+  let res = await getGxcwHistoryDataByPointCode({ pointCode: gxSelect.value })
+  console.log(res, '光钎测温图表数据')
   echartDataGx.xData.length = 0
   echartDataGx.yData.length = 0
   echartDataGx.yData1.length = 0
-  let res = await getGxcwHistoryDataByPointCode({ pointCode: gxSelect.value })
-  console.log(res, '光钎测温图表数据')
   res.time.forEach(el => {
     echartDataGx.xData.push(el)
   })
@@ -230,10 +249,11 @@ async function getSgjcPointInfoList() {
 
 //获取束管测点实时数据
 async function getSgjcRealDataByPointCodeList() {
-  card3List.length = 0
+
   let res = await getSgjcRealDataByPointCode({ pointCode: pointCode.value })
   console.log(res, '束管测点实时数据======')
   if (res.length != 0) {
+    card3List.length = 0
     res.forEach(el => {
       card3List.push({ title: el.type, ndLabel: '浓度', ndVal: el.currentValue, tLabel: '时间', tVal: el.time, aLabel: '位置', aVal: el.position })
     })
@@ -244,11 +264,12 @@ async function getSgjcRealDataByPointCodeList() {
 }
 //获取束管曲线数据
 async function getSgjcHistoryDataList() {
+
+  let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
+  console.log(res, '束管曲线数据-------')
   echartData.xData.length = 0
   echartData.yData.length = 0
   echartData.yData1.length = 0
-  let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
-  console.log(res, '束管曲线数据-------')
   res.time.forEach(el => {
     echartData.xData.push(el)
   })
@@ -266,6 +287,7 @@ function toggleChange(title) {
 
 onMounted(() => {
   getFireAreaInfos()
+  getMonitor()
 })
 
 

+ 33 - 9
src/views/vent/fire/wokeFace/index.vue

@@ -121,6 +121,21 @@ let echartDataGx = reactive(
   }
 )
 
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+function getMonitor() {
+  timer = setTimeout(
+    async () => {
+      //工作面
+      await getFireAreaInfos()
+      if (timer) {
+        timer = null;
+      }
+      getMonitor();
+    },
+    5000
+  );
+}
 
 //时间选项切换
 function onDataChange(value, dateString) {
@@ -132,6 +147,7 @@ function onDataChange(value, dateString) {
 async function getFireAreaInfos() {
   const res = await getFireAreaInfo({})
   if (res.length != 0) {
+    treeData.length = 0
     res.forEach((el, ind) => {
       if (el.areaType == 4) {
         treeData.push({ name: el.areaName, value: el.ind, id: el.ind, pid: null, areaCode: el.areaCode, gxcwCnt: el.gxcwCnt, sgjcCnt: el.sgjcCnt, infoTypeTwo: el.infoTypeTwo })
@@ -207,10 +223,11 @@ function selectChange(treeNode) {
 
 //获取光钎条数及测点编号
 async function getInfosByAreaCodeList() {
-  workBtnList.length = 0
+
   let res = await getInfosByAreaCode({ areaCode: areaCode.value })
   console.log(res, '光钎条数及测点编号')
   if (res.length != 0) {
+    workBtnList.length = 0
     res.forEach(el => {
       workBtnList.push({
         label: el.pointName,
@@ -232,11 +249,12 @@ function btnToggle(item) {
 
 //获取光钎测温图表数据
 async function getGxcwHistoryDataByPointCodeList() {
+
+  let res = await getGxcwHistoryDataByPointCode({ pointCode: gxSelect.value })
+  console.log(res, '光钎测温图表数据')
   echartDataGx.xData.length = 0
   echartDataGx.yData.length = 0
   echartDataGx.yData1.length = 0
-  let res = await getGxcwHistoryDataByPointCode({ pointCode: gxSelect.value })
-  console.log(res, '光钎测温图表数据')
   res.time.forEach(el => {
     echartDataGx.xData.push(el)
   })
@@ -250,10 +268,11 @@ async function getGxcwHistoryDataByPointCodeList() {
 
 //获取烟雾传感器监测数据
 async function getYwRealDataList() {
-  botCardList[0].sensorList.length = 0
+
   let res = await getYwRealData({ areaCode: areaCode.value })
   console.log(res, '烟雾传感器监测数据')
   if (res.length != 0) {
+    botCardList[0].sensorList.length = 0
     res.forEach(el => {
       el.isOpen = el.isOpen == '0' ? '无烟' : '有烟'
       botCardList[0].sensorList.push({ name: el.pointName, status: el.isOpen, times: el.time })
@@ -264,10 +283,11 @@ async function getYwRealDataList() {
 
 //获取火焰传感器监测数据
 async function getHyRealDataList() {
-  botCardList[1].sensorList.length = 0
+
   let res = await getHyRealData({ areaCode: areaCode.value })
   console.log(res, '火焰传感器监测数据')
   if (res.length != 0) {
+    botCardList[1].sensorList.length = 0
     res.forEach(el => {
       el.isOpen = el.isOpen == '0' ? '无火' : '有火'
       botCardList[1].sensorList.push({ name: el.pointName, status: el.isOpen, times: el.time })
@@ -278,10 +298,11 @@ async function getHyRealDataList() {
 
 //获取喷淋设备监测数据
 async function getPlzzRealDataList() {
-  botCardList[2].sensorList.length = 0
+
   let res = await getPlzzRealData({ areaCode: areaCode.value })
   console.log(res, '自动喷淋灭火装置数据')
   if (res.length != 0) {
+    botCardList[2].sensorList.length = 0
     res.forEach(el => {
       el.isOpen = el.isOpen == '0' ? '正常' : '异常'
       botCardList[2].sensorList.push({ name: el.pointName, status: el.isOpen, times: el.time })
@@ -310,10 +331,11 @@ function toggleChange(title) {
 
 //获取束管测点实时数据
 async function getSgjcRealDataByPointCodeList() {
-  card3List.length = 0
+
   let res = await getSgjcRealDataByPointCode({ pointCode: pointCode.value })
   console.log(res, '束管测点实时数据======')
   if (res.length != 0) {
+    card3List.length = 0
     res.forEach(el => {
       card3List.push({ title: el.type, ndLabel: '浓度', ndVal: el.currentValue, tLabel: '时间', tVal: el.time, aLabel: '位置', aVal: el.position })
     })
@@ -325,11 +347,12 @@ async function getSgjcRealDataByPointCodeList() {
 
 //获取束管曲线数据
 async function getSgjcHistoryDataList() {
+
+  let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
+  console.log(res, '束管曲线数据-------')
   echartData.xData.length = 0
   echartData.yData.length = 0
   echartData.yData1.length = 0
-  let res = await getSgjcHistoryData({ pointCode: pointCode.value, type: gasType.value, startTime: TimeRange.value[0], endTime: TimeRange.value[1] })
-  console.log(res, '束管曲线数据-------')
   res.time.forEach(el => {
     echartData.xData.push(el)
   })
@@ -340,6 +363,7 @@ async function getSgjcHistoryDataList() {
 
 onMounted(() => {
   getFireAreaInfos()
+  getMonitor()
 })
 </script>