NEZ-1801 fix:更改日期格式后Explore内查询图表信息下方日期未同步
This commit is contained in:
@@ -193,6 +193,7 @@ export default {
|
||||
return { minTime, maxTime, minValue, maxValue, copies, unit, dot }
|
||||
},
|
||||
xAxisLabelFormatter (minTime, maxTime) {
|
||||
let self = this
|
||||
return function (val, index) {
|
||||
const value = val * 1000
|
||||
let offset = localStorage.getItem('nz-sys-timezone')
|
||||
@@ -211,12 +212,23 @@ export default {
|
||||
const diffSec = (maxTime - minTime)
|
||||
const secOneDay = 24 * 60 * 60// 1天的秒数
|
||||
const secOneMonth = secOneDay * 30// 30天的秒数
|
||||
const dateFormatStr = self.timeFormatMain.split(' ')[0]
|
||||
let str = ''
|
||||
const month = tData.getMonth() + 1
|
||||
const day = tData.getDate()
|
||||
if (dateFormatStr === 'DD/MM/YYYY') {
|
||||
str += [day, month].join('/')
|
||||
} else if (dateFormatStr === 'MM/DD/YYYY') {
|
||||
str += [month, day].join('/')
|
||||
} else {
|
||||
str += [month, day].join('-')
|
||||
}
|
||||
if (diffSec <= secOneDay) { // 同一天
|
||||
return [hour, minute].join(':')
|
||||
} else if (diffSec < secOneMonth) { // 大于1天,小于30天
|
||||
return [tData.getMonth() + 1, tData.getDate()].join('/') + '\n' + [hour, minute].join(':')
|
||||
return str + '\n' + [hour, minute].join(':')
|
||||
} else { // 大于等于30天
|
||||
return [tData.getMonth() + 1, tData.getDate()].join('/')
|
||||
return str
|
||||
}
|
||||
} else {
|
||||
return [tData.getFullYear(), tData.getMonth() + 1, tData.getDate()].join('/') + '\n' +
|
||||
|
||||
@@ -387,7 +387,16 @@ export default {
|
||||
const day = tData.getDate() > 9 ? tData.getDate() : '0' + tData.getDate()
|
||||
const hour = tData.getHours() > 9 ? tData.getHours() : '0' + tData.getHours()
|
||||
const minute = tData.getMinutes() > 9 ? tData.getMinutes() : '0' + tData.getMinutes()
|
||||
return [month, day].join('-') + '\n' +
|
||||
const dateFormatStr = this.timeFormatMain.split(' ')[0]
|
||||
let str = ''
|
||||
if (dateFormatStr === 'DD/MM/YYYY') {
|
||||
str += [day, month].join('/')
|
||||
} else if (dateFormatStr === 'MM/DD/YYYY') {
|
||||
str += [month, day].join('/')
|
||||
} else {
|
||||
str += [month, day].join('-')
|
||||
}
|
||||
return str + '\n' +
|
||||
[hour, minute].join(':')
|
||||
},
|
||||
defaultToolBoxFormatter (params) {
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
<span>{{$t('ping.progress')}}:<span class="margin-l-10 margin-r-30">{{process}}%</span></span>
|
||||
</div>
|
||||
<el-button class="nz-btn nz-btn-size-normal nz-btn-style-normal" v-if="!isStart" @click="startTask">
|
||||
{{$t('ping.trance')}}
|
||||
{{$t('ping.trace')}}
|
||||
</el-button>
|
||||
<el-button class="nz-btn nz-btn-size-normal nz-btn-style-normal" v-else @click="clearTask">
|
||||
{{$t('config.terminallog.stop')}}
|
||||
|
||||
Reference in New Issue
Block a user