fix:修改时间格式的相关错误
This commit is contained in:
@@ -130,7 +130,6 @@ export default {
|
|||||||
// 参数 isRefresh 标识是否是刷新操作
|
// 参数 isRefresh 标识是否是刷新操作
|
||||||
getChartData (isRefresh) {
|
getChartData (isRefresh) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
console.log(this.timeRange)
|
|
||||||
// TODO assetInfo、endpointInfo、echarts等进行不同的处理
|
// TODO assetInfo、endpointInfo、echarts等进行不同的处理
|
||||||
let startTime = ''
|
let startTime = ''
|
||||||
let endTime = ''
|
let endTime = ''
|
||||||
@@ -238,7 +237,7 @@ export default {
|
|||||||
this.logChartDataFormat()
|
this.logChartDataFormat()
|
||||||
}
|
}
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
console.log(res)
|
console.info(res)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default {
|
|||||||
obj: {
|
obj: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
handler (n) {
|
handler (n) {
|
||||||
this.formatTime = new Date(bus.computeTimezoneTime(new Date()))
|
this.formatTime = bus.timeFormate(new Date(bus.computeTimezoneTime(new Date())))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -153,7 +153,7 @@ export default {
|
|||||||
this.formatTime = this.getTime(size, unit)
|
this.formatTime = this.getTime(size, unit)
|
||||||
},
|
},
|
||||||
getTime (size, unit) { // 计算时间
|
getTime (size, unit) { // 计算时间
|
||||||
const now = !this.formatTime ? new Date(bus.computeTimezone(new Date().getTime())) : new Date(this.formatTime)
|
const now = !this.formatTime ? new Date(bus.computeTimezone(new Date().getTime())) : new Date(bus.formateTimeToTime(this.formatTime))
|
||||||
if (unit) {
|
if (unit) {
|
||||||
switch (unit) {
|
switch (unit) {
|
||||||
case 'y':
|
case 'y':
|
||||||
@@ -191,7 +191,8 @@ export default {
|
|||||||
minute = minute < 10 ? '0' + minute : minute
|
minute = minute < 10 ? '0' + minute : minute
|
||||||
let second = now.getSeconds()
|
let second = now.getSeconds()
|
||||||
second = second < 10 ? '0' + second : second
|
second = second < 10 ? '0' + second : second
|
||||||
return year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
|
const str = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
|
||||||
|
return bus.timeFormate(new Date(str))
|
||||||
},
|
},
|
||||||
viewGraph () {
|
viewGraph () {
|
||||||
this.$refs.endpointQueryTab.viewGraph()
|
this.$refs.endpointQueryTab.viewGraph()
|
||||||
|
|||||||
@@ -617,7 +617,6 @@ export default {
|
|||||||
const _self = this
|
const _self = this
|
||||||
this.scrollbarWrap.addEventListener('scroll', bus.debounce(function () {
|
this.scrollbarWrap.addEventListener('scroll', bus.debounce(function () {
|
||||||
_self.showTopBtn = _self.scrollbarWrap.scrollTop > 50
|
_self.showTopBtn = _self.scrollbarWrap.scrollTop > 50
|
||||||
console.log(_self.scrollbarWrap.scrollTop)
|
|
||||||
// _self.$refs.chartList.loadChartData(_self.scrollbarWrap.scrollTop)
|
// _self.$refs.chartList.loadChartData(_self.scrollbarWrap.scrollTop)
|
||||||
_self.$refs.chartList.onScroll(_self.scrollbarWrap.scrollTop)
|
_self.$refs.chartList.onScroll(_self.scrollbarWrap.scrollTop)
|
||||||
}, 300))
|
}, 300))
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<transition>
|
<transition>
|
||||||
<div v-show="showDropdown" id="panel-calender" class="calendar">
|
<div v-show="showDropdown" id="panel-calender" class="calendar">
|
||||||
<my-date-picker prefix-icon=" " size="mini" ref="calendar"
|
<my-date-picker prefix-icon=" " size="mini" ref="calendar"
|
||||||
|
:value-format="timeFormatStrToDatePickFormat(multipleTime)"
|
||||||
:format="timeFormatStrToDatePickFormat(multipleTime)" class="panel-time-picker-hidden" @change="dateChange" v-model="startTime" type="datetime"
|
:format="timeFormatStrToDatePickFormat(multipleTime)" class="panel-time-picker-hidden" @change="dateChange" v-model="startTime" type="datetime"
|
||||||
popper-class="panel-time-picker-popper"
|
popper-class="panel-time-picker-popper"
|
||||||
align="right">
|
align="right">
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ export default {
|
|||||||
this.tableData = []
|
this.tableData = []
|
||||||
this.tableDataCopy = ''
|
this.tableDataCopy = ''
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.$get('/prom/api/v1/query?query=' + encodeURIComponent("{endpoint_id='" + this.currentEndpoint.id + "'}") + '&time=' + this.$stringTimeParseToUnix(new Date(this.formatTime).getTime())).then(response => {
|
this.$get('/prom/api/v1/query?query=' + encodeURIComponent("{endpoint_id='" + this.currentEndpoint.id + "'}") + '&time=' + this.$stringTimeParseToUnix(bus.formateTimeToTime(this.formatTime))).then(response => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (response.status === 'success') {
|
if (response.status === 'success') {
|
||||||
const results = response.data.result
|
const results = response.data.result
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="panel-calender" :class="{'calendar--small': size === 'small'}" class="calendar">
|
<div id="panel-calender" :class="{'calendar--small': size === 'small'}" class="calendar">
|
||||||
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar"
|
<my-date-picker prefix-icon=" " class="panel-time-picker-hidden " size="mini" ref="calendar"
|
||||||
|
:value-format="timeFormatStrToDatePickFormat(timePicker)"
|
||||||
:format="timeFormatStrToDatePickFormat(timePicker)" @change="dateChange" v-model="searchTime" type="datetimerange"
|
:format="timeFormatStrToDatePickFormat(timePicker)" @change="dateChange" v-model="searchTime" type="datetimerange"
|
||||||
popper-class="panel-time-picker-popper time-picker-popover__select-top"
|
popper-class="panel-time-picker-popper time-picker-popover__select-top"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="['00:00:00', '23:59:59']"
|
||||||
|
|||||||
Reference in New Issue
Block a user