|
|
@@ -1,12 +1,17 @@
|
|
|
<template>
|
|
|
-
|
|
|
+ <statistics-template
|
|
|
+ title="上下线统计"
|
|
|
+ :list="[{value: 20, color: 'green', label: '上线次数'}, {value: 20, color: 'red', label: '下线次数'}]"
|
|
|
+ />
|
|
|
<a-card
|
|
|
+ style="margin-top: 20px;"
|
|
|
title="设备分析"
|
|
|
:tab-list="tabListNoTitle"
|
|
|
:active-tab-key="activeTabKey"
|
|
|
@tabChange="key => onTabChange(key)"
|
|
|
>
|
|
|
<a-row :gutter="[8, 8]" style="margin-top: 20px;" >
|
|
|
+
|
|
|
<a-col :span="24" >
|
|
|
<a-space>
|
|
|
<a-spin
|
|
|
@@ -22,7 +27,6 @@
|
|
|
:filter-option="false"
|
|
|
:not-found-content="null"
|
|
|
:options="state.dataSource"
|
|
|
- @change="selectDevice"
|
|
|
@search="getDeviceLabel"
|
|
|
>
|
|
|
<template v-if="state.fetching" #notFoundContent>
|
|
|
@@ -30,7 +34,7 @@
|
|
|
</template>
|
|
|
</a-select>
|
|
|
</a-spin>
|
|
|
- <a-range-picker :value="getDateBeforeByHalf" @change="changeRangePicker" format="YYYY/MM/DD" />
|
|
|
+ <a-range-picker @change="changeRangePicker" format="YYYY/MM/DD" />
|
|
|
</a-space>
|
|
|
</a-col>
|
|
|
<a-col :span="24">
|
|
|
@@ -70,6 +74,7 @@ import * as echarts from 'echarts'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import { sessionEchartsJson, attrEchartsJson, scatterOption, barOption, calculateAverage } from './json/echartsJson'
|
|
|
import dayjs from 'dayjs'
|
|
|
+import StatisticsTemplate from '@/components/StatisticsTemplate'
|
|
|
|
|
|
const tabListNoTitle = [{
|
|
|
key: 'session',
|
|
|
@@ -117,14 +122,7 @@ watch(
|
|
|
)
|
|
|
|
|
|
// 获取当前时间到半小时之前
|
|
|
-const getDateBeforeByHalf = () => {
|
|
|
- const curTimeStamp = new Date().getTime()
|
|
|
-
|
|
|
- const halfHourTimeStampBefore = curTimeStamp - 60 * 30 * 1000
|
|
|
- return [dayjs(curTimeStamp), dayjs(halfHourTimeStampBefore)]
|
|
|
-}
|
|
|
-
|
|
|
-console.log(getDateBeforeByHalf())
|
|
|
+// const get
|
|
|
|
|
|
// watch(
|
|
|
// () => state.attrSource,
|
|
|
@@ -207,10 +205,6 @@ const changeRangePicker = (time) => {
|
|
|
activeTabKey.value === 'session' ? getDeviceSession() : getDeviceAttr()
|
|
|
}
|
|
|
|
|
|
-const selectDevice = () => {
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
const getDeviceLabel = async (val: string) => {
|
|
|
console.log('val:', val)
|
|
|
if (!val) return
|