From 60099d66ac0196b5ebf390dc96f1c2cd3e09d74e Mon Sep 17 00:00:00 2001 From: "@changcode" Date: Thu, 9 Sep 2021 11:04:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20type=20=3D=20=203?= =?UTF-8?q?=20=E6=97=B6=20OID=E4=BF=9D=E5=AD=98=E8=A2=AB=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/rightBox/alertRuleBox.vue | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index afc8e6ee8..d992e3da5 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -348,7 +348,7 @@ export default { mixins: [editRigthBox], data () { const nzOid = (rule, value, callback) => { - if (this.MetricsType === 3) { + if (this.editAlertRule.type === 3) { const Oid = /^(\d{1,9}\.){0,}[\d]+$/ if (Oid.test(value)) { callback() @@ -474,7 +474,7 @@ export default { save () { if (this.prevent_opt.save) { return } ; this.prevent_opt.save = true - if (this.MetricsType !== 3) { + if (this.editAlertRule.type !== 3) { this.editAlertRule.expr = this.expressions[0] } const params = { @@ -581,18 +581,15 @@ export default { }, selectAlertRuleMetric (val) { if (val === 1) { - this.showMetrics = true this.showSnmpTrap = true // showSnmpTrap 为 true 时显示 expr,threshold,unit this.$refs.alertRuleForm.clearValidate('expr') // 移除from表单的 expr 验证 } else if (val === 2) { this.showMetrics = false // showMetrics 为 false 时,展示 Logs label this.showSnmpTrap = true // showSnmpTrap 为 true 时显示 expr,threshold,unit - // this.editAlertRule.type = 2 this.$refs.alertRuleForm.clearValidate('expr') // 移除from表单的 expr 验证 } else if (val === 3) { this.showSnmpTrap = false // showSnmpTrap 为 false 时,展示 OID this.editAlertRule.inr = '' - this.MetricsType = 3 // type = 3 } }, afterInitRich () { @@ -621,7 +618,6 @@ export default { this.editAlertRule.type = 2 } else if (n.type === 3) { this.showSnmpTrap = false // showSnmpTrap 为 false 时,展示 OID - this.MetricsType = 3 // 默认保存 type this.editAlertRule.inr = '' this.editAlertRule.type = 3 return