From 8676ce648bc52dacfe0412c9f9f51e26d2d35e92 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Thu, 20 May 2021 09:18:05 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-641=20fix:=20alert-msg=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bottomBox/tabs/alertMessageTabNew.vue | 18 ++++++++++++++++++ .../src/components/page/alert/alertMessage.vue | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue index a11a6f90c..a40307952 100644 --- a/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue +++ b/nezha-fronted/src/components/common/bottomBox/tabs/alertMessageTabNew.vue @@ -285,6 +285,24 @@ export default { }) } }, + del (row) { + const self = this + this.$confirm(this.$t('tip.confirmDelete'), { + confirmButtonText: this.$t('tip.yes'), + cancelButtonText: this.$t('tip.no'), + type: 'warning' + }).then(() => { + this.$delete(this.url + '?ids=' + row.id + '&state=3').then(response => { + if (response.code === 200) { + self.delFlag = true + this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') }) + self.getTableData() + } else { + this.$message.error(response.msg) + } + }) + }) + }, getTableData (state) { if (state) { this.state = state diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index 4dce6eb2a..ed3bbaecc 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -227,6 +227,24 @@ export default { this.queryChartDate() }) }, + del (row) { + const self = this + this.$confirm(this.$t('tip.confirmDelete'), { + confirmButtonText: this.$t('tip.yes'), + cancelButtonText: this.$t('tip.no'), + type: 'warning' + }).then(() => { + this.$delete(this.url + '?ids=' + row.id + '&state=3').then(response => { + if (response.code === 200) { + self.delFlag = true + this.$message({ duration: 2000, type: 'success', message: this.$t('tip.deleteSuccess') }) + self.getTableData() + } else { + this.$message.error(response.msg) + } + }) + }) + }, messageDetail (row) { this.$get('/alert/rule/' + row.alertRule.id).then(res => { this.currentMsg = { ...row, alertRule: { ...res.data } }