From ca891f367c5b23ea841695c50ddbb7f08ae23292 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期一, 24 十月 2022 15:20:35 +0800 Subject: [PATCH] 首页改造完成,待添加系统信息 --- web_src/src/components/console/ConsoleNet.vue | 32 ++++++++++++++++++-------------- 1 files changed, 18 insertions(+), 14 deletions(-) diff --git a/web_src/src/components/console/ConsoleNet.vue b/web_src/src/components/console/ConsoleNet.vue index a6d7111..22d4f34 100644 --- a/web_src/src/components/console/ConsoleNet.vue +++ b/web_src/src/components/console/ConsoleNet.vue @@ -1,6 +1,6 @@ <template> <div id="ConsoleNet" style="width: 100%; height: 100%; background: #FFFFFF; text-align: center"> - <ve-line :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" ></ve-line> + <ve-line ref="ConsoleNet" :data="chartData" :extend="extend" :settings="chartSettings" width="100%" height="100%" ></ve-line> </div> </template> @@ -14,7 +14,7 @@ data() { return { chartData: { - columns: ['time', 'in', 'out'], + columns: ['time','out','in'], rows: [] }, chartSettings: { @@ -48,13 +48,18 @@ showMaxLabel: true, }, }, + yAxis: { + type: 'value', + min: 0, + max: 1000, + splitNumber: 6, + position: "left", + silent: true, + }, tooltip: { trigger: 'axis', formatter: (data)=>{ - console.log(parseFloat(data[0].data[1]).toFixed(2)) - console.log(parseFloat(data[1].data[1]).toFixed(2)) - console.log("############") - return "涓嬭浇锛�" + parseFloat(data[0].data[1]).toFixed(2) + "Mbps" + "</br> 涓婁紶锛�" + parseFloat(data[1].data[1]).toFixed(2) + "Mbps"; + return data[1].marker + "涓嬭浇锛�" + parseFloat(data[1].data[1]).toFixed(2) + "Mbps" + "</br> "+ data[0].marker +" 涓婁紶锛�" + parseFloat(data[0].data[1]).toFixed(2) + "Mbps"; } }, legend: { @@ -65,19 +70,18 @@ }; }, mounted() { - // setInterval(()=>{ - // // console.log(111111) - // for (let i = 0; i < this.chartData.rows.length; i++) { - // this.chartData.rows[i].閿�鍞 += 1000; - // } - // },1000) + this.$nextTick(_ => { + setTimeout(()=>{ + this.$refs.ConsoleNet.echarts.resize() + }, 100) + }) }, destroyed() { }, methods: { - setData: function(data) { - console.log(data) + setData: function(data, total) { this.chartData .rows = data; + this.extend.yAxis.max= total; } } -- Gitblit v1.8.0