This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/src/views/charts2/charts/NetworkOverviewLine.vue

99 lines
2.4 KiB
Vue
Raw Normal View History

2022-07-06 21:08:12 +08:00
<template>
2022-07-08 09:34:09 +08:00
<div class="line">
<div id="chart"></div>
<div class="line-select">
<div class="line-select-metric">
2022-07-08 09:34:09 +08:00
<span>{{$t('network.metric')}}:</span>
<div class="line-select__operation">
<el-select
size="mini"
2022-07-08 17:06:24 +08:00
v-model="value1"
class="option__select select-topn"
placeholder=""
popper-class="option-popper"
>
2022-07-08 17:06:24 +08:00
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value"></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>
<div class="line-select__operation">
<el-select
size="mini"
2022-07-08 17:06:24 +08:00
v-model="value2"
class="option__select select-topn"
placeholder=""
popper-class="option-popper"
>
2022-07-08 17:06:24 +08:00
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value"></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'
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 {
2022-07-08 17:06:24 +08:00
options1: [
2022-07-08 09:34:09 +08:00
{
2022-07-08 17:06:24 +08:00
value: 'Bits',
label: 'Bits'
2022-07-08 09:34:09 +08:00
},
{
value: 'Option2',
label: 'Option2'
},
{
value: 'Option3',
label: 'Option3'
},
2022-07-08 17:06:24 +08:00
],
value1: '',
options2: [
{
value: 'Average',
label: 'Average'
},
2022-07-08 09:34:09 +08:00
{
2022-07-08 17:06:24 +08:00
value: 'Option2',
label: 'Option2'
2022-07-08 09:34:09 +08:00
},
{
2022-07-08 17:06:24 +08:00
value: 'Option3',
label: 'Option3'
},
],
2022-07-08 17:06:24 +08:00
value2: '',
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>