|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<div class="centerImg"></div>
|
|
|
|
|
<BoardTopNav nowMenu="1"></BoardTopNav>
|
|
|
|
|
<BoardTopNav nowMenu="1" @sceneIdChange="sceneIdChange"></BoardTopNav>
|
|
|
|
|
<Chart ref="chart1" class="chart1"></Chart>
|
|
|
|
|
<div class="chart1Right">
|
|
|
|
|
<p v-for="(i,k) in chart1Data.slice(0,4)" :key="k" :style="'color:'+ chart1Color[k]">{{ i.name }}</p>
|
|
|
|
@ -292,6 +292,13 @@ export default {
|
|
|
|
|
this.setDeviceOperations()
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
sceneIdChange(){
|
|
|
|
|
this.setChart1()
|
|
|
|
|
this.setChart2()
|
|
|
|
|
this.setAllNums()
|
|
|
|
|
this.setTable3()
|
|
|
|
|
this.setDeviceOperations()
|
|
|
|
|
},
|
|
|
|
|
async setChart1() {
|
|
|
|
|
const {rows: data} = await monitorPercentage()
|
|
|
|
|
let option1 = {
|
|
|
|
@ -362,10 +369,16 @@ export default {
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
async setDeviceOperations() {
|
|
|
|
|
const {data: data} = await getDeviceOperations()
|
|
|
|
|
console.log(data)
|
|
|
|
|
let x = Object.keys(data)
|
|
|
|
|
let y = Object.values(data)
|
|
|
|
|
let {data: data} = await getDeviceOperations()
|
|
|
|
|
let sortArr = Object.keys(data)
|
|
|
|
|
sortArr = sortArr.sort((a,b)=>{
|
|
|
|
|
return new Date(a).getTime() - new Date(b).getTime()
|
|
|
|
|
})
|
|
|
|
|
console.log(sortArr)
|
|
|
|
|
let x = sortArr
|
|
|
|
|
let y = sortArr.map(e=>{
|
|
|
|
|
return data[e]
|
|
|
|
|
})
|
|
|
|
|
this.inTransitNum = y.reduce((a, b) => {
|
|
|
|
|
return a + b
|
|
|
|
|
}, 0)
|
|
|
|
|