diff --git a/nezha-fronted/src/components/common/multipleTime.vue b/nezha-fronted/src/components/common/multipleTime.vue index 52a852d6e..1f00b2ef7 100644 --- a/nezha-fronted/src/components/common/multipleTime.vue +++ b/nezha-fronted/src/components/common/multipleTime.vue @@ -160,8 +160,7 @@ export default { }, isPopoverDisabled: false, isCustom: false, - valueArr: [], - multipleTime: localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss' + valueArr: [] } }, watch: { diff --git a/nezha-fronted/src/components/common/pickTime.vue b/nezha-fronted/src/components/common/pickTime.vue index 25bf9eb19..49775c48b 100644 --- a/nezha-fronted/src/components/common/pickTime.vue +++ b/nezha-fronted/src/components/common/pickTime.vue @@ -80,8 +80,7 @@ export default { theme: { themeColor: '' }, - timer: '', - pickTimer: localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss', + timer: '' } }, created () { diff --git a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue index de10794f8..26f270737 100644 --- a/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertSilenceBox.vue @@ -213,8 +213,7 @@ export default { moduleData: null, endpointData: null, startAtTamp: '', - endAtTamp: '', - alertSilenceTime: localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss' + endAtTamp: '' } }, mounted () { diff --git a/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue b/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue index f3384b757..7a518ddbb 100644 --- a/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue +++ b/nezha-fronted/src/components/common/rightBox/asset/assetBatchEditBox.vue @@ -147,8 +147,7 @@ size="small" :value-format="timeFormatStrToDatePickFormat(timeFormatMain)" :format="timeFormatStrToDatePickFormat(timeFormatMain)" - style="width: 100%" - value-format="yyyy-MM-dd"> + style="width: 100%"> diff --git a/nezha-fronted/src/components/common/timePicker.vue b/nezha-fronted/src/components/common/timePicker.vue index 90319e0f6..15a2c5ee3 100644 --- a/nezha-fronted/src/components/common/timePicker.vue +++ b/nezha-fronted/src/components/common/timePicker.vue @@ -68,10 +68,9 @@ export default { return { isPopoverDisabled: false, isCustom: false, - timePicker: localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss', searchTime: [ - bus.timeFormate(bus.getOffsetTimezoneData(-1), this.timePicker), - bus.timeFormate(bus.getOffsetTimezoneData(), this.timePicker) + bus.timeFormate(bus.getOffsetTimezoneData(-1)), + bus.timeFormate(bus.getOffsetTimezoneData()) ], showTime: { id: 4, @@ -165,8 +164,8 @@ export default { }, methods: { dateChange (val) { - const startTime = bus.timeFormate(val[0], this.timePicker) - const endTime = bus.timeFormate(val[1], this.timePicker) + const startTime = bus.timeFormate(val[0]) + const endTime = bus.timeFormate(val[1]) this.$set(this.searchTime, 0, startTime) this.$set(this.searchTime, 1, endTime) @@ -190,11 +189,11 @@ export default { } const time = bus.getTimezontDateRange() if (timeGroup.start_time) { - this.$set(this.searchTime, 0, bus.timeFormate(timeGroup.start_time, this.timePicker)) - this.$set(this.searchTime, 1, bus.timeFormate(timeGroup.end_time, this.timePicker)) + this.$set(this.searchTime, 0, bus.timeFormate(timeGroup.start_time)) + this.$set(this.searchTime, 1, bus.timeFormate(timeGroup.end_time)) } else { - this.$set(this.searchTime, 0, bus.timeFormate(time[0], this.timePicker)) - this.$set(this.searchTime, 1, bus.timeFormate(time[1], this.timePicker)) + this.$set(this.searchTime, 0, bus.timeFormate(time[0])) + this.$set(this.searchTime, 1, bus.timeFormate(time[1])) } } } else { @@ -263,20 +262,20 @@ export default { }, setSearchTime (type, val) { if (type === 'minute') { - const startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setMinutes(new Date(bus.computeTimezone(new Date().getTime())).getMinutes() - val), this.timePicker) - const endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())), this.timePicker) + const startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setMinutes(new Date(bus.computeTimezone(new Date().getTime())).getMinutes() - val)) + const endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime()))) this.$set(this.searchTime, 0, startTime) this.$set(this.searchTime, 1, endTime) this.$set(this.searchTime, 2, val + 'm') } else if (type === 'hour') { - const startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setHours(new Date(bus.computeTimezone(new Date().getTime())).getHours() - val), this.timePicker) - const endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())), this.timePicker) + const startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setHours(new Date(bus.computeTimezone(new Date().getTime())).getHours() - val)) + const endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime()))) this.$set(this.searchTime, 0, startTime) this.$set(this.searchTime, 1, endTime) this.$set(this.searchTime, 2, val + 'h') } else if (type === 'date') { - const startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setDate(new Date(bus.computeTimezone(new Date().getTime())).getDate() - val), this.timePicker) - const endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())), this.timePicker) + const startTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime())).setDate(new Date(bus.computeTimezone(new Date().getTime())).getDate() - val)) + const endTime = bus.timeFormate(new Date(bus.computeTimezone(new Date().getTime()))) this.$set(this.searchTime, 0, startTime) this.$set(this.searchTime, 1, endTime) this.$set(this.searchTime, 2, val + 'd') diff --git a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue index d1ea5a16c..f8e1cd4fe 100644 --- a/nezha-fronted/src/components/page/config/system/apiKeyTable.vue +++ b/nezha-fronted/src/components/page/config/system/apiKeyTable.vue @@ -165,8 +165,7 @@ export default { disabledDate (time) { return time.getTime() < Date.now() - 24 * 60 * 60 * 1000 } - }, - apiKeyTableTime: localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss' + } } }, methods: { diff --git a/nezha-fronted/src/components/page/dashboard/panel.vue b/nezha-fronted/src/components/page/dashboard/panel.vue index 9919117df..b53026dd3 100644 --- a/nezha-fronted/src/components/page/dashboard/panel.vue +++ b/nezha-fronted/src/components/page/dashboard/panel.vue @@ -276,8 +276,7 @@ export default { // ---图表相关参数--end scrollbarWrap: null, batchDeleteObjs: [], - nowTimeType: {}, - panelDateFormatTime: localStorage.getItem('nz-default-dateFormat') ? localStorage.getItem('nz-default-dateFormat') : 'YYYY-MM-DD HH:mm:ss' + nowTimeType: {} } }, components: {