From 8ce2075eb181b62ea89460ab3f70da54c4eadeea Mon Sep 17 00:00:00 2001 From: zhangyu Date: Mon, 30 Aug 2021 15:02:44 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-947=20feat;alert=20rule=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20state=20=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/rightBox/alertRuleBox.vue | 10 +++++++++ .../common/table/alert/alertRuleTable.vue | 22 ++++++++++++++++--- .../src/components/page/alert/alertRule.vue | 13 +++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue index 63af3fe3d..f0f439dc3 100644 --- a/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue +++ b/nezha-fronted/src/components/common/rightBox/alertRuleBox.vue @@ -99,6 +99,16 @@ + + + + diff --git a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue index fa5b0bcc3..1a863e99c 100644 --- a/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertRuleTable.vue @@ -54,6 +54,16 @@ + {{scope.row[item.prop]}} @@ -70,9 +80,9 @@ - {{$t('overall.edit')}} - {{$t('overall.delete')}} - {{$t('overall.duplicate')}} + {{$t('overall.edit')}} + {{$t('overall.delete')}} + {{$t('overall.duplicate')}} {{$t('overall.silenceAlert')}} @@ -156,6 +166,12 @@ export default { prop: 'method', show: false, minWidth: 100 + }, { + label: this.$t('config.dc.state'), + prop: 'state', + show: true, + minWidth: 100, + sortable: 'custom' } ] } diff --git a/nezha-fronted/src/components/page/alert/alertRule.vue b/nezha-fronted/src/components/page/alert/alertRule.vue index b56826f70..983522962 100644 --- a/nezha-fronted/src/components/page/alert/alertRule.vue +++ b/nezha-fronted/src/components/page/alert/alertRule.vue @@ -49,6 +49,7 @@ @queryMessage="queryMessage" @reload="getTableData" @addSilence="addSilence" + @statusChange='statusChange' @selectionChange="selectionChange" @showBottomBox="(targetTab, object) => { $refs.dataList.showBottomBox(targetTab, object) }"> @@ -179,6 +180,18 @@ export default { } }) }, + statusChange (alertRule) { + const params = { ...alertRule, severity: null } + this.$put(this.url, params).then(response => { + if (response.code === 200) { + this.rightBox.show = false + this.$message({ duration: 1000, type: 'success', message: this.$t('tip.saveSuccess') }) + } else { + this.$message.error(response.msg) + } + this.getTableData() + }) + }, edit (u, copyFlag) { this.$get(`${this.url}/${u.id}`).then(response => { if (response.code === 200) {