fix:修改alertMes 点击查看不显示的问题

This commit is contained in:
zhangyu
2021-12-30 15:18:38 +08:00
parent 4731db2a43
commit f6225f3fe1
4 changed files with 6 additions and 0 deletions

View File

@@ -30,6 +30,7 @@
<div class="chart-header__title" v-else > <div class="chart-header__title" v-else >
<span @click="groupShow"> <i class="nz-icon" :class="chartInfo.param.collapse ? 'nz-icon-arrow-right': 'nz-icon-arrow-down'"></i></span> <span @click="groupShow"> <i class="nz-icon" :class="chartInfo.param.collapse ? 'nz-icon-arrow-right': 'nz-icon-arrow-down'"></i></span>
{{chartInfo.name}} {{chartInfo.name}}
<span v-show="chartInfo.param.collapse" class="collapse-content">({{chartData.length}} charts)</span>
</div> </div>
<div class="chart-header__tools" v-if="chartInfo.type !== 'endpointInfo' && chartInfo.type !== 'assetInfo'"> <div class="chart-header__tools" v-if="chartInfo.type !== 'endpointInfo' && chartInfo.type !== 'assetInfo'">
<span v-if="chartInfo.param.link" class="chart-header__tool" @click="openUrl"> <span v-if="chartInfo.param.link" class="chart-header__tool" @click="openUrl">

View File

@@ -238,6 +238,7 @@ export default {
groupShow (chart) { groupShow (chart) {
const index = this.copyDataList.findIndex(item => item.id === chart.id) const index = this.copyDataList.findIndex(item => item.id === chart.id)
this.$set(this.copyDataList, index, chart) this.$set(this.copyDataList, index, chart)
this.onScroll(this.scrollTop)
}, },
moveChart () { moveChart () {
if (this.timer) { if (this.timer) {

View File

@@ -589,12 +589,14 @@ export default {
this.chartLoading = true this.chartLoading = true
if (this.currentMsg.alertRule.type === 1) { if (this.currentMsg.alertRule.type === 1) {
const chartInfo = lodash.cloneDeep(lineData) const chartInfo = lodash.cloneDeep(lineData)
chartInfo.elements = [{}]
chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, ''))
chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))
chartInfo.unit = this.currentMsg.unit chartInfo.unit = this.currentMsg.unit
this.showFullscreen(true, chartInfo) this.showFullscreen(true, chartInfo)
} else if (this.currentMsg.alertRule.type === 2) { } else if (this.currentMsg.alertRule.type === 2) {
const chartInfo = lodash.cloneDeep(logData) const chartInfo = lodash.cloneDeep(logData)
chartInfo.elements = [{}]
chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, ''))
chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))
chartInfo.unit = this.currentMsg.unit chartInfo.unit = this.currentMsg.unit

View File

@@ -571,12 +571,14 @@ export default {
this.chartLoading = true this.chartLoading = true
if (this.currentMsg.alertRule.type === 1) { if (this.currentMsg.alertRule.type === 1) {
const chartInfo = lodash.cloneDeep(lineData) const chartInfo = lodash.cloneDeep(lineData)
chartInfo.elements = [{}]
chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, ''))
chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))
chartInfo.unit = this.currentMsg.unit chartInfo.unit = this.currentMsg.unit
this.showFullscreen(true, chartInfo) this.showFullscreen(true, chartInfo)
} else if (this.currentMsg.alertRule.type === 2) { } else if (this.currentMsg.alertRule.type === 2) {
const chartInfo = lodash.cloneDeep(logData) const chartInfo = lodash.cloneDeep(logData)
chartInfo.elements = [{}]
chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, '')) chartInfo.elements[0].expression = encodeURIComponent(this.currentMsg.alertRule.expr.replace(/\"/g, '\'').replace(/\r|\n+/g, ''))
chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels))) chartInfo.elements[0].filter = encodeURIComponent(decodeURIComponent(this.promQueryParamLabels(this.currentMsg.labels)))
chartInfo.unit = this.currentMsg.unit chartInfo.unit = this.currentMsg.unit