|
@@ -151,6 +151,7 @@
|
|
|
<a-spin :spinning="analysisState.loading" >
|
|
<a-spin :spinning="analysisState.loading" >
|
|
|
<a-col :span="24" v-if="state.analysisType === 'session'">
|
|
<a-col :span="24" v-if="state.analysisType === 'session'">
|
|
|
<div id="device-session" style="width: 600px;height: 400px;" ></div>
|
|
<div id="device-session" style="width: 600px;height: 400px;" ></div>
|
|
|
|
|
+ <div id="device-session-scatter" style="width: 600px;height: 400px;" ></div>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
<a-col :span="24" v-else>
|
|
<a-col :span="24" v-else>
|
|
|
<div id="device-attr" style="width: 600px;height: 400px;" ></div>
|
|
<div id="device-attr" style="width: 600px;height: 400px;" ></div>
|
|
@@ -168,7 +169,7 @@ import { DeviceAuthTypeEnum } from '@/enum/common'
|
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
|
import { DownOutlined } from '@ant-design/icons-vue'
|
|
import { DownOutlined } from '@ant-design/icons-vue'
|
|
|
import * as echarts from 'echarts'
|
|
import * as echarts from 'echarts'
|
|
|
-import { sessionEchartsJson, attrEchartsJson } from './json/echartsJson'
|
|
|
|
|
|
|
+import { sessionEchartsJson, attrEchartsJson, scatterOption, barOption } from './json/echartsJson'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
|
|
|
|
|
const useForm = Form.useForm
|
|
const useForm = Form.useForm
|
|
@@ -283,9 +284,22 @@ watch(
|
|
|
() => {
|
|
() => {
|
|
|
if (state.analysisType === 'session') {
|
|
if (state.analysisType === 'session') {
|
|
|
const chartDom = document.getElementById('device-session')
|
|
const chartDom = document.getElementById('device-session')
|
|
|
|
|
+ const chartDomScatter = document.getElementById('device-session-scatter')
|
|
|
const myChart = echarts.init(chartDom!)
|
|
const myChart = echarts.init(chartDom!)
|
|
|
- sessionEchartsJson.xAxis.data = analysisState.dataSource.map(item => item.createAt)
|
|
|
|
|
|
|
+ const chartDomScatterChart = echarts.init(chartDomScatter!)
|
|
|
|
|
+ sessionEchartsJson.xAxis.data = analysisState.dataSource.map(item => item.createAt) as never[]
|
|
|
|
|
+ sessionEchartsJson.series[0].data = analysisState.dataSource.map(item => item.sessionType === 'CONNECT' ? '上线' : '下线')
|
|
|
|
|
+
|
|
|
|
|
+ let currentOption = scatterOption
|
|
|
|
|
+
|
|
|
|
|
+ setInterval(function () {
|
|
|
|
|
+ currentOption = currentOption === scatterOption ? barOption : scatterOption
|
|
|
|
|
+ chartDomScatterChart.setOption(currentOption, true)
|
|
|
|
|
+ }, 2000)
|
|
|
|
|
+
|
|
|
|
|
+ chartDomScatterChart.setOption(currentOption)
|
|
|
myChart.setOption(sessionEchartsJson)
|
|
myChart.setOption(sessionEchartsJson)
|
|
|
|
|
+
|
|
|
analysisState.loading = false
|
|
analysisState.loading = false
|
|
|
} else {
|
|
} else {
|
|
|
const chartDom = document.getElementById('device-attr')
|
|
const chartDom = document.getElementById('device-attr')
|
|
@@ -293,7 +307,6 @@ watch(
|
|
|
|
|
|
|
|
attrEchartsJson.xAxis.data = analysisState.dataSource.map(item => item.keyLabel) || []
|
|
attrEchartsJson.xAxis.data = analysisState.dataSource.map(item => item.keyLabel) || []
|
|
|
attrEchartsJson.series[0].data = analysisState.dataSource.map(item => item.longValue) || []
|
|
attrEchartsJson.series[0].data = analysisState.dataSource.map(item => item.longValue) || []
|
|
|
- console.log('attrEchartsJson:', attrEchartsJson)
|
|
|
|
|
|
|
|
|
|
myChart.setOption(attrEchartsJson)
|
|
myChart.setOption(attrEchartsJson)
|
|
|
analysisState.loading = false
|
|
analysisState.loading = false
|