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