Преглед изворни кода

多参数传感器模拟数据修改-提交

lxh пре 1 година
родитељ
комит
3e6a5b40c8

+ 1 - 1
src/views/vent/monitorManager/alarmMonitor/fire/gasPage.vue

@@ -130,7 +130,7 @@ watch(
         cardListWs.push({
           label: '甲烷',
           // value: el.readData.gasC || '--',
-          value: (Math.random()*(1-0)+0).toFixed(2),
+          value: 0,
           listR: [
             { id: 0, label: '测点类型', value: '瓦斯' },
             { id: 1, label: '测点位置', value: el.strinstallpos || '--' },

+ 7 - 0
src/views/vent/monitorManager/sensorMonitor/index.vue

@@ -181,6 +181,13 @@
     const type = devicetype ? devicetype : 'modelsensor';
     const res = await list({ devicetype: type, pagetype: 'normal' });
     dataSource.value = res.msgTxt[0].datalist || [];
+    console.log( dataSource.value,' dataSource.value----------')
+    //lxh
+    dataSource.value.forEach(el=>{
+      el.readData.temperature=(Math.random()*(60-50)+50).toFixed(2)
+      el.readData.humidity=(Math.random()*(60-50)+50).toFixed(2)
+      el.readData.pa=(Math.random()*(102000-100000)+100000).toFixed(2)
+    })
     dataSource.value.map((data: any) => {
       const readData = data.readData;
       data = Object.assign(data, readData);