diff --git a/nezha-fronted/src/components/common/alert/alertDaysInfo.vue b/nezha-fronted/src/components/common/alert/alertDaysInfo.vue index 188d3f918..bf62e8658 100644 --- a/nezha-fronted/src/components/common/alert/alertDaysInfo.vue +++ b/nezha-fronted/src/components/common/alert/alertDaysInfo.vue @@ -3,7 +3,7 @@
-
{{timestampStr(item.time, 'YYYY-MM-DD')}}
+
{{timestampStr(item.time, dateFormatStr)}}
{{severity.name}}
@@ -24,7 +24,8 @@ export default { return { daysData: [], severityData: this.$store.getters.severityData, - severityDataWeight: this.$store.getters.severityDataWeight + severityDataWeight: this.$store.getters.severityDataWeight, + dateFormatStr: localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD' } }, // watch: { @@ -35,6 +36,14 @@ export default { // } // } // }, + created () { + const dateFormatStr = localStorage.getItem('nz-default-dateFormat') + if (dateFormatStr) { + this.dateFormatStr = dateFormatStr.split(' ')[0] + } else { + this.dateFormatStr = 'YYYY-MM-DD' + } + }, methods: { showPriority (daysData) { let style = {}