修复一个指标图表无法显示时间的Bug

This commit is contained in:
GoEdgeLab
2021-07-14 22:44:13 +08:00
parent 9b52f73b11
commit 00c158f0a5
3 changed files with 12 additions and 37 deletions

View File

@@ -17,7 +17,8 @@ Vue.component("metric-chart", {
stats.push({
keys: ["其他"],
value: stats[0].total - sum,
total: stats[0].total
total: stats[0].total,
time: stats[0].time
})
}
}
@@ -324,6 +325,9 @@ Vue.component("metric-chart", {
document.getElementById(this.chartId).innerHTML = table
},
formatTime: function (time) {
if (time == null) {
return ""
}
switch (this.vPeriodUnit) {
case "month":
return time.substring(0, 4) + "-" + time.substring(4, 6)