From 051f0a776c7083548851c323893ce7c3ad2c820e Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 11 Apr 2022 11:09:15 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1783=20fix=EF=BC=9Aalert=20rule=20=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=9B=BE=E6=A0=87=E9=A2=9C=E8=89=B2=E4=B8=8D=E6=AD=A3?= =?UTF-8?q?=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/common/alert/alertRuleInfo.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue index e0d49a170..87b16ff8d 100644 --- a/nezha-fronted/src/components/common/alert/alertRuleInfo.vue +++ b/nezha-fronted/src/components/common/alert/alertRuleInfo.vue @@ -142,13 +142,17 @@ export default { this.$emit('showText') }, severityDataColor () { - this.severityData.map(item => { - this.severityColor = item.color + this.severityData.forEach(item => { + if (this.alertRuleData.severityId === item.id) { + this.severityColor = item.color + } }) }, returnColor (obj) { - let color = '#23bf9a' + console.log(obj, this.severityDataWeight) + let color = '' if (!obj) { + color = '#23bf9a' return color } else { this.severityDataWeight.forEach(severity => { @@ -168,8 +172,8 @@ export default { this.$get('/alert/rule/' + this.id).then((res) => { if (res.msg === 'success') { this.loading = false - this.severityDataColor() this.alertRuleData = res.data + this.severityDataColor() this.alertColor = this.returnColor(res.data.alert) const weekDays = this.getWeeksTime() if (this.trendTimer) {