Commit f2cc8309 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化首页图表日期显示

parent c721d4b1
...@@ -194,9 +194,11 @@ export default { ...@@ -194,9 +194,11 @@ export default {
this.totalDataset.source = thirtyStatList this.totalDataset.source = thirtyStatList
.map((item) => { .map((item) => {
return { return {
name: this.$moment( name: `${item.year}-${String(item.month).padStart(
`${item.year}-${item.month}-${item.day}` 2,
).format("YYYY-MM-DD"), "0"
)}-${String(item.day).padStart(2, "0")}`,
value: item.count, value: item.count,
}; };
}) })
...@@ -204,9 +206,10 @@ export default { ...@@ -204,9 +206,10 @@ export default {
this.phDataset.source = thirtyPhStatList this.phDataset.source = thirtyPhStatList
.map((item) => { .map((item) => {
return { return {
name: this.$moment( name: `${item.year}-${String(item.month).padStart(
`${item.year}-${item.month}-${item.day}` 2,
).format("YYYY-MM-DD"), "0"
)}-${String(item.day).padStart(2, "0")}`,
value: item.phCount, value: item.phCount,
}; };
}) })
...@@ -214,9 +217,10 @@ export default { ...@@ -214,9 +217,10 @@ export default {
this.pjDataset.source = thirtyPjStatList this.pjDataset.source = thirtyPjStatList
.map((item) => { .map((item) => {
return { return {
name: this.$moment( name: `${item.year}-${String(item.month).padStart(
`${item.year}-${item.month}-${item.day}` 2,
).format("YYYY-MM-DD"), "0"
)}-${String(item.day).padStart(2, "0")}`,
value: item.pjCount, value: item.pjCount,
}; };
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment