Merge branch 'dev-3.7' of https://git.mesalab.cn/nezha/nezha-fronted into dev-3.8
This commit is contained in:
@@ -194,7 +194,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 参数 isRefresh 标识是否是刷新操作
|
// 参数 isRefresh 标识是否是刷新操作
|
||||||
getChartData (isRefresh, params) { // 获取chart的数据前的准备 主要用于处理时间参数
|
getChartData (isRefresh, params) { // 获取chart的数据前的准备 主要用于处理时间参数
|
||||||
if (!this.variablesInit) { // 变量未加载完成 不请求数据
|
if (!this.variablesInit || !this.timerInit) { // 变量未加载完成 不请求数据
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.chartData = window.dataJson ? this.chartData : []
|
this.chartData = window.dataJson ? this.chartData : []
|
||||||
|
|||||||
@@ -618,6 +618,10 @@ export default {
|
|||||||
this.$set(this.searchTime, 2, val + 'd')
|
this.$set(this.searchTime, 2, val + 'd')
|
||||||
}
|
}
|
||||||
this.$refs.pickTime.$refs.timePicker.searchTime = this.searchTime
|
this.$refs.pickTime.$refs.timePicker.searchTime = this.searchTime
|
||||||
|
this.$store.dispatch('dispatchPanelTime', {
|
||||||
|
time: this.searchTime,
|
||||||
|
nowTimeType: this.nowTimeType
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getVarType (from) {
|
getVarType (from) {
|
||||||
if (from === this.fromRoute.asset) {
|
if (from === this.fromRoute.asset) {
|
||||||
@@ -878,13 +882,15 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
setTimePickerRange () {
|
setTimePickerRange () {
|
||||||
|
this.$nextTick(() => {
|
||||||
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
||||||
this.setDefaultTimeRange()
|
this.setDefaultTimeRange()
|
||||||
}
|
}
|
||||||
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
||||||
this.searchTime = this.timePickerRange.time
|
this.searchTime = this.timePickerRange.time
|
||||||
this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.searchTime)
|
this.$refs.pickTime && this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.searchTime)
|
||||||
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 设置默认刷新
|
// 设置默认刷新
|
||||||
setDefaultRefresh () {
|
setDefaultRefresh () {
|
||||||
|
|||||||
@@ -137,13 +137,15 @@ export default {
|
|||||||
this.queryLogData()
|
this.queryLogData()
|
||||||
},
|
},
|
||||||
setTimePickerRange () {
|
setTimePickerRange () {
|
||||||
|
this.$nextTick(() => {
|
||||||
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
||||||
this.filterTime = this.timePickerRange.time
|
this.filterTime = this.timePickerRange.time
|
||||||
this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.filterTime)
|
this.$refs.pickTime && this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.filterTime)
|
||||||
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
setSearchTime (type, val) { // 设置searchTime
|
setSearchTime (type, val) { // 设置searchTime
|
||||||
if (type === 'minute') {
|
if (type === 'minute') {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<div class="calendar-popover-text">
|
<div class="calendar-popover-text">
|
||||||
<i class="nz-icon"
|
<i class="nz-icon"
|
||||||
v-if="showLocked"
|
v-if="showLocked"
|
||||||
@click.stop="changeLocked"
|
@click.stop="changeLocked()"
|
||||||
:title="timePickerLocked ? $t('timepicker.unlockTime') : $t('timepicker.lockTime')"
|
:title="timePickerLocked ? $t('timepicker.unlockTime') : $t('timepicker.lockTime')"
|
||||||
:class="timePickerLocked ? 'nz-icon-push-pin-line colorfa901c' : 'nz-icon-push-pin-line'"
|
:class="timePickerLocked ? 'nz-icon-push-pin-line colorfa901c' : 'nz-icon-push-pin-line'"
|
||||||
style="margin-right: 5px;cursor: pointer"
|
style="margin-right: 5px;cursor: pointer"
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
<chart-list
|
<chart-list
|
||||||
ref="chartList"
|
ref="chartList"
|
||||||
:variablesInit="variablesInit"
|
:variablesInit="variablesInit"
|
||||||
|
:timerInit="true"
|
||||||
name="dashboard"
|
name="dashboard"
|
||||||
:dashboardId="showPanel.id"
|
:dashboardId="showPanel.id"
|
||||||
:class="{'show-top':showTopBtn, 'is-dashboard': true}"
|
:class="{'show-top':showTopBtn, 'is-dashboard': true}"
|
||||||
@@ -1171,14 +1172,17 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
setTimePickerRange () {
|
setTimePickerRange () {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
console.log(13123213,this.timePickerLocked, this.timePickerRange.nowTimeType)
|
||||||
if (this.$route.query.searchTime) return
|
if (this.$route.query.searchTime) return
|
||||||
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
||||||
this.setDefaultTimeRange()
|
this.setDefaultTimeRange()
|
||||||
}
|
}
|
||||||
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
||||||
this.searchTime = this.timePickerRange.time
|
this.searchTime = this.timePickerRange.time
|
||||||
this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.searchTime)
|
this.$refs.pickTime && this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.searchTime)
|
||||||
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
// 设置默认刷新
|
// 设置默认刷新
|
||||||
setDefaultRefresh () {
|
setDefaultRefresh () {
|
||||||
@@ -1203,10 +1207,12 @@ export default {
|
|||||||
mode: { target: this, propertyName: 'mode', type: 'string' }
|
mode: { target: this, propertyName: 'mode', type: 'string' }
|
||||||
}
|
}
|
||||||
this.initQueryFromPath(searchKeys)
|
this.initQueryFromPath(searchKeys)
|
||||||
|
if (this.$route.query.searchTime) {
|
||||||
this.$store.dispatch('dispatchTimePickerRange', {
|
this.$store.dispatch('dispatchTimePickerRange', {
|
||||||
time: this.searchTime,
|
time: this.searchTime,
|
||||||
nowTimeType: this.nowTimeType
|
nowTimeType: this.nowTimeType
|
||||||
})
|
})
|
||||||
|
}
|
||||||
this.showPanel.id = this.dashboardId
|
this.showPanel.id = this.dashboardId
|
||||||
this.filter.dashboardId = this.dashboardId
|
this.filter.dashboardId = this.dashboardId
|
||||||
// 设置查看模式
|
// 设置查看模式
|
||||||
|
|||||||
@@ -3657,14 +3657,16 @@ export default {
|
|||||||
dom.querySelector(id).scrollIntoView(true)
|
dom.querySelector(id).scrollIntoView(true)
|
||||||
},
|
},
|
||||||
setTimePickerRange () {
|
setTimePickerRange () {
|
||||||
|
this.$nextTick(() => {
|
||||||
console.log(this.timePickerLocked, !this.timePickerRange.nowTimeType)
|
console.log(this.timePickerLocked, !this.timePickerRange.nowTimeType)
|
||||||
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
if (!this.timePickerLocked || !this.timePickerRange.nowTimeType) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
const nowTimeType = this.nowTimeType = this.timePickerRange.nowTimeType
|
||||||
this.filterTime = this.timePickerRange.time
|
this.filterTime = this.timePickerRange.time
|
||||||
this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.filterTime)
|
this.$refs.pickTime && this.$refs.pickTime.$refs.timePicker.setTimeRange(this.nowTimeType, this.filterTime)
|
||||||
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
this.setSearchTime(nowTimeType.type, nowTimeType.value, nowTimeType)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
selectMetricsLogs (val, icon, label) {
|
selectMetricsLogs (val, icon, label) {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const timePicker = {
|
|||||||
store.commit('setTimePickerLocked', flag)
|
store.commit('setTimePickerLocked', flag)
|
||||||
},
|
},
|
||||||
dispatchTimePickerRange (store, range) {
|
dispatchTimePickerRange (store, range) {
|
||||||
|
console.log('dispatchTimePickerRange', range)
|
||||||
store.commit('setTimePickerRange', range)
|
store.commit('setTimePickerRange', range)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user