mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-27 05:00:25 +08:00
优化界面
This commit is contained in:
@@ -4,12 +4,24 @@ Tea.context(function () {
|
||||
|
||||
this.$delay(function () {
|
||||
this.reloadHourlyTrafficChart()
|
||||
|
||||
let that = this
|
||||
window.addEventListener("resize", function () {
|
||||
if (that.trafficTab == "hourly") {
|
||||
that.resizeHourlyTrafficChart()
|
||||
}
|
||||
if (that.trafficTab == "daily") {
|
||||
that.resizeDailyTrafficChart()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
this.selectTrafficTab = function (tab) {
|
||||
this.trafficTab = tab
|
||||
if (tab == "hourly") {
|
||||
|
||||
this.$delay(function () {
|
||||
this.reloadHourlyTrafficChart()
|
||||
})
|
||||
} else if (tab == "daily") {
|
||||
this.$delay(function () {
|
||||
this.reloadDailyTrafficChart()
|
||||
@@ -17,6 +29,12 @@ Tea.context(function () {
|
||||
}
|
||||
}
|
||||
|
||||
this.resizeHourlyTrafficChart = function () {
|
||||
let chartBox = document.getElementById("hourly-traffic-chart-box")
|
||||
let chart = echarts.init(chartBox)
|
||||
chart.resize()
|
||||
}
|
||||
|
||||
this.reloadHourlyTrafficChart = function () {
|
||||
let chartBox = document.getElementById("hourly-traffic-chart-box")
|
||||
let chart = echarts.init(chartBox)
|
||||
@@ -58,6 +76,13 @@ Tea.context(function () {
|
||||
animation: false
|
||||
}
|
||||
chart.setOption(option)
|
||||
chart.resize()
|
||||
}
|
||||
|
||||
this.resizeDailyTrafficChart = function () {
|
||||
let chartBox = document.getElementById("daily-traffic-chart-box")
|
||||
let chart = echarts.init(chartBox)
|
||||
chart.resize()
|
||||
}
|
||||
|
||||
this.reloadDailyTrafficChart = function () {
|
||||
@@ -101,5 +126,6 @@ Tea.context(function () {
|
||||
animation: false
|
||||
}
|
||||
chart.setOption(option)
|
||||
chart.resize()
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user