NEZ-3170 fix:params改为json字符串

This commit is contained in:
zyh
2023-09-07 17:57:30 +08:00
parent 122f79c3cf
commit dac6ce8cea
3 changed files with 8 additions and 2 deletions

View File

@@ -26,6 +26,7 @@
<div class="info-box-left-top"> <div class="info-box-left-top">
<chart <chart
ref="chart" ref="chart"
:globalVariables="globalVariables"
v-if="chartInfo.alertRule && chartInfo.alertRule.type !== 3" v-if="chartInfo.alertRule && chartInfo.alertRule.type !== 3"
:chart-data="chartData" :chart-data="chartData"
:chart-info="chartInfo" :chart-info="chartInfo"
@@ -67,8 +68,10 @@ import logsData from '@/components/chart/logsData'
import lodash from 'lodash' import lodash from 'lodash'
import alertMessageInfoTab from '@/components/common/alert/alertMessageInfoTab' import alertMessageInfoTab from '@/components/common/alert/alertMessageInfoTab'
import alertMessageInfoTimeLine from '@/components/common/alert/alertMessageInfoTimeLine' import alertMessageInfoTimeLine from '@/components/common/alert/alertMessageInfoTimeLine'
import globalVariablesMixin from '@/components/common/mixin/globalVariables'
export default { export default {
name: 'alertMessageInfo', name: 'alertMessageInfo',
mixins: [globalVariablesMixin],
components: { components: {
alertMessageInfoTab, alertMessageInfoTab,
chart, chart,
@@ -126,6 +129,7 @@ export default {
const step = bus.getStep(startTime, endTime) const step = bus.getStep(startTime, endTime)
startTime = this.$stringTimeParseToUnix(startTime) startTime = this.$stringTimeParseToUnix(startTime)
endTime = this.$stringTimeParseToUnix(endTime) endTime = this.$stringTimeParseToUnix(endTime)
this.setGlobalVariablesValue([filter.start_time, filter.end_time])
const elements = this.chartInfo.elements || [] const elements = this.chartInfo.elements || []
if (multipleTime.length) { if (multipleTime.length) {
const minusTime = (new Date(bus.formateTimeToTime(filter.start_time)).getTime() - new Date(bus.formateTimeToTime(multipleTime[0])).getTime()) const minusTime = (new Date(bus.formateTimeToTime(filter.start_time)).getTime() - new Date(bus.formateTimeToTime(multipleTime[0])).getTime())

View File

@@ -710,7 +710,7 @@ export default {
method: this.editAlertRule.method.join(','), method: this.editAlertRule.method.join(','),
type: this.editAlertRule.type, type: this.editAlertRule.type,
condition, condition,
param param: JSON.stringify(param)
} }
if (this.editAlertRule.trbShot && this.editAlertRule.trbShot == '<div class="editor-core ql-container ql-snow"><div class="ql-editor"><p><br></p></div></div>') { if (this.editAlertRule.trbShot && this.editAlertRule.trbShot == '<div class="editor-core ql-container ql-snow"><div class="ql-editor"><p><br></p></div></div>') {
this.editAlertRule.trbShot = '' this.editAlertRule.trbShot = ''
@@ -958,6 +958,8 @@ export default {
obj.param = { obj.param = {
dataLink: [] dataLink: []
} }
} else {
obj.param = JSON.parse(obj.param)
} }
this.editAlertRule = this.$lodash.cloneDeep(obj) this.editAlertRule = this.$lodash.cloneDeep(obj)
this.showPanel.id = this.editAlertRule.dashboardId this.showPanel.id = this.editAlertRule.dashboardId

View File

@@ -647,7 +647,7 @@ export default {
// 设置dataLink // 设置dataLink
if (this.currentMsg.alertRule.param) { if (this.currentMsg.alertRule.param) {
chartInfo.param.dataLink = this.currentMsg.alertRule.param.dataLink chartInfo.param.dataLink = JSON.parse(this.currentMsg.alertRule.param).dataLink
} }
chartInfo.id = this.currentMsg.id chartInfo.id = this.currentMsg.id