Browse Source

传感器

master
aBin 5 years ago
parent
commit
2415e0f03c
  1. 8
      src/components/Sensor/Sensor.js
  2. 10
      src/mixins/socket.js

8
src/components/Sensor/Sensor.js

@ -2,9 +2,9 @@ import { mapState } from 'vuex';
const mixin = {
data() {
return {
series1: [10, 20, 30, 10, 20, 30, 10, 20, 30], // 传感器1
series2: [20, 30, 10, 20, 30, 10, 20, 30, 10], // 传感器2
series3: [30, 10, 20, 30, 10, 20, 30, 10, 20], // 传感器3
series1: [10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30], // 传感器1
series2: [20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10], // 传感器2
series3: [30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20, 30, 10, 20], // 传感器3
};
},
computed: {
@ -23,6 +23,8 @@ const mixin = {
xAxis: {
type: 'category',
boundaryGap: false,
max: this.series1.length >= 6 ? this.series1.length - 1 : 6,
min: this.series1.length >= 6 ? this.series1.length - 6 : 0,
axisLine: {
//y轴
show: false,

10
src/mixins/socket.js

@ -101,7 +101,15 @@ const mixin = {
break;
}
},
/**
*
* data:{
* data: {
* value: ''
* },
* type: '',
* }
*/
/**
* 收到ws 消息
* @param {object} res 收到的消息数据

Loading…
Cancel
Save