fix: 1. Panel > 编辑图标功能,判断兼容老数据添加默认值
2. 修复 告警等级 Priority select 初始化 color 为 undefined
This commit is contained in:
@@ -232,41 +232,35 @@ export default {
|
||||
label: 'ID',
|
||||
prop: 'id',
|
||||
show: true,
|
||||
width: 80
|
||||
width: 160,
|
||||
sortable: 'custom'
|
||||
},{
|
||||
label: this.$t('alert.alertName'),
|
||||
prop: 'alertRule',
|
||||
show: true,
|
||||
}, /* {
|
||||
label: this.$t("alert.list.type"),
|
||||
prop: 'type',
|
||||
show: true,
|
||||
width: 100
|
||||
}, {
|
||||
label: this.$t("alert.list.linked"),
|
||||
prop: 'linkObject',
|
||||
show: true,
|
||||
width: 140
|
||||
}, */{
|
||||
label: this.$t('alert.list.labels'),
|
||||
prop: 'labels',
|
||||
show: true,
|
||||
width: 300
|
||||
NotSet: true,
|
||||
minWidth: 250,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('alert.severity'),
|
||||
prop: 'severity',
|
||||
prop: 'severityId',
|
||||
show: true,
|
||||
width: 100
|
||||
width: 110,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('alert.summary'),
|
||||
prop: 'summary',
|
||||
show: true,
|
||||
width: 200
|
||||
minWidth: 200
|
||||
}, {
|
||||
label: this.$t('overall.remark'),
|
||||
prop: 'description',
|
||||
show: true,
|
||||
width: 200
|
||||
minWidth: 200
|
||||
}, {
|
||||
label: this.$t('alert.list.state'),
|
||||
prop: 'state',
|
||||
@@ -276,7 +270,13 @@ export default {
|
||||
label: this.$t('alert.startAt'),
|
||||
prop: 'startAt',
|
||||
show: true,
|
||||
width: 160
|
||||
width: 150,
|
||||
sortable: 'custom'
|
||||
}, {
|
||||
label: this.$t('config.terminallog.duration'),
|
||||
prop: 'duration',
|
||||
show: true,
|
||||
width: 150
|
||||
},{
|
||||
label: this.$t('alert.endAt'),
|
||||
prop: 'endAt',
|
||||
@@ -328,6 +328,14 @@ export default {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler (n, o) {
|
||||
if (n.id) {
|
||||
if (!n.param.state && n.param.state != Number) {
|
||||
n.param.state = "1"
|
||||
}
|
||||
if (n.param.severity && n.param.severity != Number) {
|
||||
n.param.severity = 1
|
||||
}
|
||||
}
|
||||
this.data = Object.assign({}, n)
|
||||
}
|
||||
},
|
||||
@@ -700,7 +708,7 @@ export default {
|
||||
this.getAlerScreetList()
|
||||
},
|
||||
promQueryParamConvert (obj) {
|
||||
let r = '(' + obj.alertRule.expr + ')'
|
||||
let r = '(' + obj.alertRule.expr.replace(/\"/g, '\'') + ')'
|
||||
let intoLabels = false
|
||||
obj.labels = JSON.parse(obj.labels)
|
||||
if (Object.keys(obj.labels).length > 0) {
|
||||
|
||||
@@ -130,6 +130,12 @@ export default {
|
||||
justify-content: space-between;
|
||||
width: calc(100% - 28px);
|
||||
}
|
||||
.tree--node span:nth-of-type(1) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
.tree--operation {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<i v-if="editAlertRule.severityId" :style="{color:severityData.find(severity => severity.id === editAlertRule.severityId).color,'font-size':'12px'}" class="nz-icon nz-icon-circle severity-circle"></i>
|
||||
<i v-if="editAlertRule.severityId" :style="{color:severityData.length > 0 && severityData.find(severity => severity.id === editAlertRule.severityId).color,'font-size':'12px'}" class="nz-icon nz-icon-circle severity-circle"></i>
|
||||
</el-form-item>
|
||||
<!--receiver-->
|
||||
<el-form-item :label="$t('config.user.receiver')" prop="receiver">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<i class="nz-icon nz-icon-circle severity-circle" v-if="parameters.level" :style="{color:alertPriority.find(severity => severity.id === parameters.level).color,'font-size':'12px'}"></i>
|
||||
<i class="nz-icon nz-icon-circle severity-circle" v-if="parameters.level" :style="{color: alertPriority.length > 0 && alertPriority.find(severity => severity.id === parameters.level).color,'font-size':'12px'}"></i>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('dashboard.panel.chartForm.alertParam.state')">
|
||||
<el-select class="form-item" size="small" popper-class="alert-form-pop no-style-class" v-model="parameters.state" clearable id="alert-param-state">
|
||||
|
||||
@@ -1761,7 +1761,13 @@ export default {
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
if (n.id) {
|
||||
this.isEdit = true
|
||||
this.isEdit = true;
|
||||
if (!n.param.state && n.param.state != Number) {
|
||||
n.param.state = "1"
|
||||
}
|
||||
if (n.param.severity && n.param.severity != Number) {
|
||||
n.param.severity = 1
|
||||
}
|
||||
}
|
||||
if ((n.param && n.param.valueMapping) && (n.type === 'singleStat' || n.type === 'table')) {
|
||||
n.param.valueMapping.mapping.forEach(item => {
|
||||
|
||||
Reference in New Issue
Block a user