From 1799d2120c5289d5bd09fef76e423a37bd65d28f Mon Sep 17 00:00:00 2001 From: likexuan Date: Fri, 6 May 2022 14:17:03 +0800 Subject: [PATCH] =?UTF-8?q?NEZ-1849=20feat=20=EF=BC=9Aalert=20message?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=20=E5=A2=9E=E5=8A=A0=20ack?= =?UTF-8?q?nowledge=20=E7=8A=B6=E6=80=81=E5=8F=8A=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/table/alert/alertMessageTable.scss | 4 +++ .../common/table/alert/alertMessageTable.vue | 1 + .../components/page/alert/alertMessage.vue | 29 +++++++++++-------- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss b/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss index bf2876791..1e28f7097 100644 --- a/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss +++ b/nezha-fronted/src/assets/css/components/common/table/alert/alertMessageTable.scss @@ -106,3 +106,7 @@ border-radius: 4px; color: $--color-text-label; } + +.blues{ + color: $--color-text-link; +} diff --git a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue index 116c39c99..c6f3459bd 100644 --- a/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue +++ b/nezha-fronted/src/components/common/table/alert/alertMessageTable.vue @@ -90,6 +90,7 @@ {{$t(stateOptions.find(state=>state.value == scope.row['state']).label)}} + {{scope.row[item.prop]}} {{scope.row[item.prop]}} diff --git a/nezha-fronted/src/components/page/alert/alertMessage.vue b/nezha-fronted/src/components/page/alert/alertMessage.vue index df73b3740..7deac5193 100644 --- a/nezha-fronted/src/components/page/alert/alertMessage.vue +++ b/nezha-fronted/src/components/page/alert/alertMessage.vue @@ -38,7 +38,7 @@ - +
{{$t('overall.batchAck')}}
@@ -530,24 +530,29 @@ export default { }, methods: { batchAck () { - const params = [] - const obj = {} - this.batchDeleteObjs.forEach(item => { - obj.id = item.id - obj.ack = item.ack - params.push(obj) - }) - if (params.length === 0) { - this.$message({ type: 'error', message: this.$t('tip.SelectAlertMessages') }) - } else { + if (this.batchDeleteObjs.length < 1) return + this.$confirm(this.$t('tip.confirmBatchAck', [this.batchDeleteObjs.length]), { + confirmButtonText: this.$t('tip.yes'), + cancelButtonText: this.$t('tip.no'), + type: 'warning' + }).then(() => { + this.delFlag = true + const params = [] + const obj = {} + this.batchDeleteObjs.forEach(item => { + obj.id = item.id + obj.ack = item.ack + params.push(obj) + }) this.$put('alert/message/ack', params).then(response => { if (response.code == 200) { this.$message({ duration: 1000, type: 'success', message: this.$t('tip.ackSuccess') }) } else { this.$message.error(response.msg) } + this.getTableData() }) - } + }) }, labelsSort (obj) { const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'project', 'datacenter', 'parent_asset', 'user']