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