7 changed files with 222 additions and 124 deletions
@ -1,107 +1,165 @@ |
|||
var option = { |
|||
legend: { |
|||
x: 'center', |
|||
y: 'top', |
|||
data: ['传感器1', '传感器2'], |
|||
textStyle: { |
|||
fontWeight: 'normal', |
|||
color: '#ccc', //标题颜色
|
|||
}, |
|||
}, |
|||
xAxis: { |
|||
type: 'category', |
|||
boundaryGap: false, |
|||
axisLine: { |
|||
//y轴
|
|||
show: false, |
|||
}, |
|||
}, |
|||
yAxis: { |
|||
show: true, |
|||
type: 'value', |
|||
splitLine: { show: false }, //去除网格线
|
|||
nameTextStyle: { |
|||
color: '#abb8ce', |
|||
show: false, |
|||
}, |
|||
axisLabel: { |
|||
color: '#abb8ce', |
|||
show: false, |
|||
}, |
|||
axisTick: { |
|||
//y轴刻度线
|
|||
show: false, |
|||
}, |
|||
axisLine: { |
|||
//y轴
|
|||
show: false, |
|||
}, |
|||
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], // 传感器1
|
|||
series3: [30, 10, 20, 30, 10, 20, 30, 10, 20], // 传感器1
|
|||
}; |
|||
}, |
|||
series: [ |
|||
{ |
|||
name: '传感器1', |
|||
data: [320, 932, 401, 834, 290, 530, 620], |
|||
type: 'line', |
|||
smooth: true, |
|||
symbol: 'none', |
|||
itemStyle: { |
|||
color: { |
|||
type: 'linear', |
|||
x: 0, |
|||
y: 0, |
|||
x2: 0, |
|||
y2: 1, |
|||
colorStops: [ |
|||
{ |
|||
offset: 0, |
|||
color: 'rgba(10,73,130,1)', // 0% 处的颜色
|
|||
computed: { |
|||
...mapState('messages', ['vibrationSensor']), |
|||
option() { |
|||
return { |
|||
legend: { |
|||
x: 'center', |
|||
y: 'top', |
|||
data: ['传感器1', '传感器2', '传感器3'], |
|||
textStyle: { |
|||
fontWeight: 'normal', |
|||
color: '#ccc', //标题颜色
|
|||
}, |
|||
}, |
|||
xAxis: { |
|||
type: 'category', |
|||
boundaryGap: false, |
|||
axisLine: { |
|||
//y轴
|
|||
show: false, |
|||
}, |
|||
}, |
|||
yAxis: { |
|||
show: true, |
|||
type: 'value', |
|||
splitLine: { show: false }, //去除网格线
|
|||
nameTextStyle: { |
|||
color: '#abb8ce', |
|||
show: false, |
|||
}, |
|||
axisLabel: { |
|||
color: '#abb8ce', |
|||
show: false, |
|||
}, |
|||
axisTick: { |
|||
//y轴刻度线
|
|||
show: false, |
|||
}, |
|||
axisLine: { |
|||
//y轴
|
|||
show: false, |
|||
}, |
|||
}, |
|||
series: [ |
|||
{ |
|||
name: '传感器1', |
|||
data: this.series1, |
|||
type: 'line', |
|||
smooth: true, |
|||
symbol: 'none', |
|||
itemStyle: { |
|||
color: { |
|||
type: 'linear', |
|||
x: 0, |
|||
y: 0, |
|||
x2: 0, |
|||
y2: 1, |
|||
colorStops: [ |
|||
{ |
|||
offset: 0, |
|||
color: 'rgba(10,73,130,1)', // 0% 处的颜色
|
|||
}, |
|||
{ |
|||
offset: 1, |
|||
color: 'rgba(10,73,130,0)', // 100% 处的颜色
|
|||
}, |
|||
], |
|||
global: false, // 缺省为 false
|
|||
}, |
|||
}, |
|||
{ |
|||
offset: 1, |
|||
color: 'rgba(10,73,130,0)', // 100% 处的颜色
|
|||
areaStyle: {}, |
|||
lineStyle: { normal: { color: 'rgb(39,149,243)', width: 2 } }, |
|||
}, |
|||
{ |
|||
name: '传感器2', |
|||
data: this.series2, |
|||
type: 'line', |
|||
smooth: true, |
|||
symbol: 'none', |
|||
itemStyle: { |
|||
color: { |
|||
type: 'linear', |
|||
x: 0, |
|||
y: 0, |
|||
x2: 0, |
|||
y2: 1, |
|||
colorStops: [ |
|||
{ |
|||
offset: 0, |
|||
color: 'rgba(91,225,251,1)', // 0% 处的颜色
|
|||
}, |
|||
{ |
|||
offset: 1, |
|||
color: 'rgba(91,225,251,0)', // 100% 处的颜色
|
|||
}, |
|||
], |
|||
global: false, // 缺省为 false
|
|||
}, |
|||
}, |
|||
], |
|||
global: false, // 缺省为 false
|
|||
}, |
|||
}, |
|||
areaStyle: {}, |
|||
lineStyle: { normal: { color: 'rgb(39,149,243)', width: 2 } }, |
|||
}, |
|||
{ |
|||
name: '传感器2', |
|||
data: [420, 232, 401, 234, 490, 230, 420], |
|||
type: 'line', |
|||
smooth: true, |
|||
symbol: 'none', |
|||
itemStyle: { |
|||
color: { |
|||
type: 'linear', |
|||
x: 0, |
|||
y: 0, |
|||
x2: 0, |
|||
y2: 1, |
|||
colorStops: [ |
|||
{ |
|||
offset: 0, |
|||
color: 'rgba(91,225,251,1)', // 0% 处的颜色
|
|||
areaStyle: {}, |
|||
lineStyle: { |
|||
normal: { |
|||
color: 'rgb(91,225,251)', |
|||
width: 2, |
|||
}, |
|||
}, |
|||
{ |
|||
offset: 1, |
|||
color: 'rgba(91,225,251,0)', // 100% 处的颜色
|
|||
}, |
|||
{ |
|||
name: '传感器3', |
|||
data: this.series3, |
|||
type: 'line', |
|||
smooth: true, |
|||
symbol: 'none', |
|||
itemStyle: { |
|||
color: { |
|||
type: 'linear', |
|||
x: 0, |
|||
y: 0, |
|||
x2: 0, |
|||
y2: 1, |
|||
colorStops: [ |
|||
{ |
|||
offset: 0, |
|||
color: 'rgba(241,158,194,1)', // 0% 处的颜色
|
|||
}, |
|||
{ |
|||
offset: 1, |
|||
color: 'rgba(241,158,194,0)', // 100% 处的颜色
|
|||
}, |
|||
], |
|||
global: false, // 缺省为 false
|
|||
}, |
|||
}, |
|||
], |
|||
global: false, // 缺省为 false
|
|||
}, |
|||
}, |
|||
areaStyle: {}, |
|||
lineStyle: { |
|||
normal: { |
|||
color: 'rgb(91,225,251)', |
|||
width: 2, |
|||
}, |
|||
}, |
|||
areaStyle: {}, |
|||
lineStyle: { |
|||
normal: { |
|||
color: 'rgb(241,158,194)', |
|||
width: 2, |
|||
}, |
|||
}, |
|||
}, |
|||
], |
|||
}; |
|||
}, |
|||
}, |
|||
watch: { |
|||
vibrationSensor(val) { |
|||
var vibList = val.split(','); |
|||
this.series1 = this.series1.concat(parseInt(vibList[0])); |
|||
this.series2 = this.series1.concat(parseInt(vibList[1])); |
|||
this.series3 = this.series1.concat(parseInt(vibList[2])); |
|||
console.log('vibrationSensor:', val); |
|||
}, |
|||
], |
|||
}, |
|||
}; |
|||
|
|||
export default option; |
|||
export default mixin; |
|||
|
@ -1,15 +1,15 @@ |
|||
const state = { |
|||
syncMessages: [], // 同步消息
|
|||
weightMessage: null, // 体重
|
|||
weightMessage: 0, // 体重
|
|||
rfidMessage: null, // RFID
|
|||
weighSensor1: null, // 称重传感器一
|
|||
weighSensor2: null, // 称重传感器二
|
|||
weighSensor3: null, // 称重传感器三
|
|||
weighSensor4: null, // 称重传感器四
|
|||
vibrationSensor: null, // 震动传感器
|
|||
thrombolyticDose: null, // 溶栓剂量(总量)
|
|||
bolusDose: null, // 团注剂量
|
|||
maintenanceDose: null, // 维持剂量
|
|||
thrombolyticDose: 0, // 溶栓剂量(总量)
|
|||
bolusDose: 0, // 团注剂量
|
|||
maintenanceDose: 0, // 维持剂量
|
|||
}; |
|||
|
|||
export default state; |
|||
|
Loading…
Reference in new issue