2022-07-06 21:08:12 +08:00
|
|
|
<template>
|
2022-07-08 09:34:09 +08:00
|
|
|
<div class="line">
|
|
|
|
|
<div id="chart"></div>
|
2022-07-08 14:11:30 +08:00
|
|
|
<div class="line-select">
|
|
|
|
|
<div class="line-select-metric">
|
2022-07-08 09:34:09 +08:00
|
|
|
<span>{{$t('network.metric')}}:</span>
|
2022-07-08 14:11:30 +08:00
|
|
|
<div class="line-select__operation">
|
|
|
|
|
<el-select
|
|
|
|
|
size="mini"
|
|
|
|
|
v-model="options"
|
|
|
|
|
class="option__select select-topn"
|
|
|
|
|
placeholder=""
|
|
|
|
|
popper-class="option-popper"
|
|
|
|
|
>
|
|
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="line-select-reference-line">
|
2022-07-08 09:34:09 +08:00
|
|
|
<span>{{$t('network.referenceLine')}}:</span>
|
2022-07-08 14:11:30 +08:00
|
|
|
<div class="line-select__operation">
|
|
|
|
|
<el-select
|
|
|
|
|
size="mini"
|
|
|
|
|
v-model="options"
|
|
|
|
|
class="option__select select-topn"
|
|
|
|
|
placeholder=""
|
|
|
|
|
popper-class="option-popper"
|
|
|
|
|
>
|
|
|
|
|
<el-option v-for="item in options" :key="item.value" :label="item.label"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="line-value">
|
|
|
|
|
<div class="line-value-mpackets" v-for="item in mpackets" :key="item">
|
|
|
|
|
<span>{{item}} </span><span>mpackets/s</span>
|
2022-07-08 09:34:09 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2022-07-06 21:08:12 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-07-08 09:34:09 +08:00
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
import { stackedLineChartOption } from '@/views/charts2/charts/options/pie'
|
2022-07-08 14:11:30 +08:00
|
|
|
import unitConvert from '@/utils/unit-convert'
|
2022-07-06 21:08:12 +08:00
|
|
|
export default {
|
2022-07-08 09:34:09 +08:00
|
|
|
name: 'NetworkOverviewLine',
|
|
|
|
|
props: {
|
|
|
|
|
chart: Object
|
|
|
|
|
},
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
value: 'Option1',
|
|
|
|
|
label: 'Option1'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option2',
|
|
|
|
|
label: 'Option2'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option3',
|
|
|
|
|
label: 'Option3'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option4',
|
|
|
|
|
label: 'Option4'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 'Option5',
|
|
|
|
|
label: 'Option5'
|
|
|
|
|
}
|
2022-07-08 14:11:30 +08:00
|
|
|
],
|
|
|
|
|
mpackets: [42, 1, 2, 1, 12],
|
|
|
|
|
unitConvert
|
2022-07-08 09:34:09 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
init () {
|
|
|
|
|
const dom = document.getElementById('chart')
|
|
|
|
|
const myChart = echarts.init(dom)
|
|
|
|
|
myChart.setOption(stackedLineChartOption)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted () {
|
|
|
|
|
this.init()
|
|
|
|
|
}
|
2022-07-06 21:08:12 +08:00
|
|
|
}
|
|
|
|
|
</script>
|