Browse Source

加入开机时间曲线

master
xh 4 days ago
parent
commit
ee32b06757
  1. 80
      web/src/views/HandDevice/Home/components/HistoricalCurve.vue

80
web/src/views/HandDevice/Home/components/HistoricalCurve.vue

@ -146,6 +146,7 @@ const gas = computed(() => {
var rsrp: (number | null)[] = [] var rsrp: (number | null)[] = []
var rsrq: (number | null)[] = [] var rsrq: (number | null)[] = []
var sinr: (number | null)[] = [] var sinr: (number | null)[] = []
var boot: (number | null)[] = []
var time: string[] = [] var time: string[] = []
historicalData.value historicalData.value
@ -187,6 +188,11 @@ const gas = computed(() => {
rsrq.push(null) rsrq.push(null)
sinr.push(null) sinr.push(null)
} }
if (item.boot) {
boot.push(item.boot / 60)
} else {
boot.push(null)
}
time.push(item.timeStr) time.push(item.timeStr)
}) })
@ -199,7 +205,8 @@ const gas = computed(() => {
rsrp, rsrp,
rsrq, rsrq,
sinr, sinr,
time
time,
boot
} }
}) })
const gasLineOptions = computed<EChartsOption>(() => { const gasLineOptions = computed<EChartsOption>(() => {
@ -250,73 +257,92 @@ const gasLineOptions = computed<EChartsOption>(() => {
animationEasing: 'cubicInOut' animationEasing: 'cubicInOut'
}, },
{ {
name: '电池电量',
name: 'RSSI',
smooth: true, smooth: true,
type: 'line', type: 'line',
yAxisIndex: 1,
yAxisIndex: 0,
symbol: 'none', symbol: 'none',
data: gas.value.battery,
data: gas.value.rssi,
animationDuration: 2800, animationDuration: 2800,
animationEasing: 'cubicInOut' animationEasing: 'cubicInOut'
}, },
{ {
name: '内存占用',
name: 'RSRP',
smooth: true, smooth: true,
type: 'line', type: 'line',
yAxisIndex: 1,
yAxisIndex: 0,
symbol: 'none', symbol: 'none',
data: gas.value.mem,
data: gas.value.rsrp,
animationDuration: 2800, animationDuration: 2800,
animationEasing: 'cubicInOut',
tooltip: {
valueFormatter: function (value) {
if (value === null || value === undefined || isNaN(value)) {
return '-'
}
return Number(value).toFixed(3) + 'KB' //
}
}
animationEasing: 'cubicInOut'
}, },
{ {
name: 'RSSI',
name: 'RSRQ',
smooth: true, smooth: true,
type: 'line', type: 'line',
yAxisIndex: 0, yAxisIndex: 0,
symbol: 'none', symbol: 'none',
data: gas.value.rssi,
data: gas.value.rsrq,
animationDuration: 2800, animationDuration: 2800,
animationEasing: 'cubicInOut' animationEasing: 'cubicInOut'
}, },
{ {
name: 'RSRP',
name: 'SINR',
smooth: true, smooth: true,
type: 'line', type: 'line',
yAxisIndex: 0, yAxisIndex: 0,
symbol: 'none', symbol: 'none',
data: gas.value.rsrp,
data: gas.value.sinr,
animationDuration: 2800, animationDuration: 2800,
animationEasing: 'cubicInOut' animationEasing: 'cubicInOut'
}, },
{ {
name: 'RSRQ',
name: '电池电量',
smooth: true, smooth: true,
type: 'line', type: 'line',
yAxisIndex: 0,
yAxisIndex: 1,
symbol: 'none', symbol: 'none',
data: gas.value.rsrq,
data: gas.value.battery,
animationDuration: 2800, animationDuration: 2800,
animationEasing: 'cubicInOut' animationEasing: 'cubicInOut'
}, },
{ {
name: 'SINR',
name: '内存占用',
smooth: true, smooth: true,
type: 'line', type: 'line',
yAxisIndex: 0,
yAxisIndex: 1,
symbol: 'none', symbol: 'none',
data: gas.value.sinr,
data: gas.value.mem,
animationDuration: 2800, animationDuration: 2800,
animationEasing: 'cubicInOut'
animationEasing: 'cubicInOut',
tooltip: {
valueFormatter: function (value) {
if (value === null || value === undefined || isNaN(value)) {
return '-'
}
return Number(value).toFixed(3) + 'KB' //
}
}
},
{
name: '系统运行时间',
smooth: true,
type: 'line',
yAxisIndex: 1,
symbol: 'none',
data: gas.value.boot,
animationDuration: 2800,
animationEasing: 'cubicInOut',
tooltip: {
valueFormatter: function (value) {
if (value === null || value === undefined || isNaN(value)) {
return '-'
}
return Number(value).toFixed(3) + '分钟' //
}
}
} }
] ]
} }

Loading…
Cancel
Save