|
@@ -34,13 +34,26 @@
|
|
|
|
|
|
<script setup name="SysTrendCard">
|
|
<script setup name="SysTrendCard">
|
|
import * as echarts from 'echarts'
|
|
import * as echarts from 'echarts'
|
|
|
|
+ import alarmTrendApi from '@/api/coldchain/alarmTrendApi.js'
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- getEcharts1()
|
|
|
|
- getEcharts2()
|
|
|
|
- getEcharts3()
|
|
|
|
|
|
+ init()
|
|
})
|
|
})
|
|
- const getEcharts1 = () => {
|
|
|
|
|
|
+
|
|
|
|
+ const data = ref([])
|
|
|
|
+
|
|
|
|
+ const init = () => {
|
|
|
|
+ alarmTrendApi.threeDays().then((res) => {
|
|
|
|
+ if (res && res.length > 0) {
|
|
|
|
+ getEcharts1(res[2])
|
|
|
|
+ getEcharts2(res[1])
|
|
|
|
+ getEcharts3(res[0])
|
|
|
|
+ console.log(res, 'xxxxxxxxxxxxxxxxxxxxxxx')
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ const getEcharts1 = (val) => {
|
|
let Echarts = echarts.init(document.getElementById('echart1'))
|
|
let Echarts = echarts.init(document.getElementById('echart1'))
|
|
const option = {
|
|
const option = {
|
|
tooltip: {
|
|
tooltip: {
|
|
@@ -61,16 +74,7 @@
|
|
},
|
|
},
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
- data: [
|
|
|
|
- '00:00-03:00',
|
|
|
|
- '03:00-06:00',
|
|
|
|
- '06:00-09:00',
|
|
|
|
- '09:00-12:00',
|
|
|
|
- '12:00-15:00',
|
|
|
|
- '15:00-18:00',
|
|
|
|
- '18:00-21:00',
|
|
|
|
- '21:00-24:00'
|
|
|
|
- ],
|
|
|
|
|
|
+ data: val.timePeriodList,
|
|
|
|
|
|
axisPointer: {
|
|
axisPointer: {
|
|
type: 'shadow'
|
|
type: 'shadow'
|
|
@@ -104,7 +108,7 @@
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
name: '报警次数',
|
|
name: '报警次数',
|
|
- data: [12, 34, 41, 5, 28, 19, 4, 36],
|
|
|
|
|
|
+ data: val.countList,
|
|
type: 'line',
|
|
type: 'line',
|
|
smooth: true,
|
|
smooth: true,
|
|
showSymbol: false,
|
|
showSymbol: false,
|
|
@@ -139,7 +143,7 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- const getEcharts2 = () => {
|
|
|
|
|
|
+ const getEcharts2 = (val) => {
|
|
let Echarts = echarts.init(document.getElementById('echart2'))
|
|
let Echarts = echarts.init(document.getElementById('echart2'))
|
|
const option = {
|
|
const option = {
|
|
tooltip: {
|
|
tooltip: {
|
|
@@ -160,16 +164,7 @@
|
|
},
|
|
},
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
- data: [
|
|
|
|
- '00:00-03:00',
|
|
|
|
- '03:00-06:00',
|
|
|
|
- '06:00-09:00',
|
|
|
|
- '09:00-12:00',
|
|
|
|
- '12:00-15:00',
|
|
|
|
- '15:00-18:00',
|
|
|
|
- '18:00-21:00',
|
|
|
|
- '21:00-24:00'
|
|
|
|
- ],
|
|
|
|
|
|
+ data: val.timePeriodList,
|
|
axisPointer: {
|
|
axisPointer: {
|
|
type: 'shadow'
|
|
type: 'shadow'
|
|
},
|
|
},
|
|
@@ -202,7 +197,7 @@
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
name: '报警次数',
|
|
name: '报警次数',
|
|
- data: [6, 64, 34, 10, 30, 21, 49, 14],
|
|
|
|
|
|
+ data: val.countList,
|
|
type: 'line',
|
|
type: 'line',
|
|
smooth: true,
|
|
smooth: true,
|
|
showSymbol: false,
|
|
showSymbol: false,
|
|
@@ -236,7 +231,7 @@
|
|
Echarts.resize()
|
|
Echarts.resize()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- const getEcharts3 = () => {
|
|
|
|
|
|
+ const getEcharts3 = (val) => {
|
|
let Echarts = echarts.init(document.getElementById('echart3'))
|
|
let Echarts = echarts.init(document.getElementById('echart3'))
|
|
const option = {
|
|
const option = {
|
|
tooltip: {
|
|
tooltip: {
|
|
@@ -257,16 +252,7 @@
|
|
},
|
|
},
|
|
xAxis: {
|
|
xAxis: {
|
|
type: 'category',
|
|
type: 'category',
|
|
- data: [
|
|
|
|
- '00:00-03:00',
|
|
|
|
- '03:00-06:00',
|
|
|
|
- '06:00-09:00',
|
|
|
|
- '09:00-12:00',
|
|
|
|
- '12:00-15:00',
|
|
|
|
- '15:00-18:00',
|
|
|
|
- '18:00-21:00',
|
|
|
|
- '21:00-24:00'
|
|
|
|
- ],
|
|
|
|
|
|
+ data: val.timePeriodList,
|
|
axisPointer: {
|
|
axisPointer: {
|
|
type: 'shadow'
|
|
type: 'shadow'
|
|
},
|
|
},
|
|
@@ -299,7 +285,7 @@
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
name: '报警次数',
|
|
name: '报警次数',
|
|
- data: [10, 25, 51, 3, 4, 0, 0, 0],
|
|
|
|
|
|
+ data: val.countList,
|
|
type: 'line',
|
|
type: 'line',
|
|
smooth: true,
|
|
smooth: true,
|
|
showSymbol: false,
|
|
showSymbol: false,
|