From e76bb7463f886882b53f36b7e08cffbb5d37b3f7 Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 21 Jul 2022 18:57:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20alert=20rule=20trbShot=20?= =?UTF-8?q?=E6=9C=AA=E8=AE=BE=E7=BD=AE=E6=97=B6=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/panelChart.vue | 6 ++++-- .../src/components/common/alert/alertMessageInfoTab.vue | 4 ++-- .../src/components/common/rightBox/alertRuleBox.vue | 3 +++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index 94ed585d0..72380bf1c 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -554,9 +554,11 @@ export default { confirmReg.push(item) } }) - confirmReg = this.$loadsh.sortBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题 + confirmReg = this.$loadsh.orderBy(confirmReg, function (item) { // 根据 匹配的name的长度排序 避免匹配的 $a 没匹配 $asset的问题 + console.log(item.name.length) return item.name.length - }) + }, 'desc') + console.log(confirmReg) if (confirmReg.length) { confirmReg.forEach(item => { const reg = new RegExp('\\$' + item.name, 'g') // 后续需要考虑 item,name 使用特殊字符的问题 diff --git a/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue b/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue index a47d6b140..0b1ce75be 100644 --- a/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue +++ b/nezha-fronted/src/components/common/alert/alertMessageInfoTab.vue @@ -23,7 +23,7 @@ />
-
+
@@ -108,7 +108,7 @@ export default { this.cardNames.push(item) } }) - if (n.alertRule && n.alertRule.trbShot) { + if (n.alertRule && n.alertRule.trbShot && n.alertRule.trbShot != '


') { this.cardNames.push({ key: 'trbShot', label: this.$t('alert.config.trbShot') diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index b6fd00125..881fd55a1 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -507,6 +507,9 @@ export default { method: this.editAlertRule.method.join(','), type: this.editAlertRule.type } + if (this.editAlertRule.trbShot && this.editAlertRule.trbShot == '


') { + this.editAlertRule.trbShot = '' + } this.$refs.alertRuleForm.validate((valid) => { if (valid) { params.receiver = this.editAlertRule.receiverShow.join(',')