NEZ-1849 feat :alert message列表页面 增加 acknowledge 状态及按钮

This commit is contained in:
likexuan
2022-05-06 17:31:02 +08:00
parent 1799d2120c
commit 1a7f68a174
3 changed files with 29 additions and 3 deletions

View File

@@ -37,6 +37,10 @@ export default {
this.$emit('del', row)
break
}
case 'ack': {
this.$emit('acknowledge', row)
break
}
case 'recordTab': {
this.$emit('showBottomBox', 'recordTab', row)
break

View File

@@ -111,7 +111,7 @@
<!-- <el-dropdown-item :command="['showText', scope.row]"><i class="nz-icon nz-icon-guzhangshuju"></i><span class="operation-dropdown-text">{{$t('alert.config.trbShot')}}</span></el-dropdown-item>-->
<el-dropdown-item v-has="'alertMessage_view'" :command="['delete', scope.row]"><i class="nz-icon nz-icon-delete"></i><span class="operation-dropdown-text">{{$t('overall.delete')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'alertSilence_add'" :command="['fastSilence', scope.row, 'alertMessage']"><i class="nz-icon nz-icon-fast-silence"></i><span class="operation-dropdown-text">{{$t('overall.silenceAlert')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'alertMessage_expired'" :disabled="scope.row.ack === 1"><i class="nz-icon nz-icon-queren"></i><span class="operation-dropdown-text">{{$t('overall.acknowledge')}}</span></el-dropdown-item>
<el-dropdown-item v-has="'alertMessage_expired'" :disabled="scope.row.ack === 1" :command="['ack', scope.row]"><i class="nz-icon nz-icon-queren"></i><span class="operation-dropdown-text">{{$t('overall.acknowledge')}}</span></el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
@@ -186,7 +186,7 @@ export default {
label: 'ID',
prop: 'id',
show: true,
width: 160,
width: 180,
sortable: 'custom'
}, {
label: this.$t('alert.rule'),

View File

@@ -60,6 +60,7 @@
:table-data="tableData"
:loading="tools.loading"
@del="del"
@acknowledge="acknowledge"
@edit="edit"
@showText="showText"
@orderBy="tableDataSort"
@@ -541,7 +542,7 @@ export default {
const obj = {}
this.batchDeleteObjs.forEach(item => {
obj.id = item.id
obj.ack = item.ack
obj.ack = 1
params.push(obj)
})
this.$put('alert/message/ack', params).then(response => {
@@ -632,6 +633,27 @@ export default {
})
})
},
acknowledge (row) {
this.$confirm(this.$t('tip.confirmAck'), {
confirmButtonText: this.$t('tip.yes'),
cancelButtonText: this.$t('tip.no'),
type: 'warning'
}).then(() => {
const params = []
const obj = {}
obj.id = row.id
obj.ack = 1
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') })
this.getTableData()
} else {
this.$message.error(response.msg)
}
})
})
},
messageDetail (row) {
// this.sign = Number(row.alertRule.id)
this.$get('/alert/rule/' + row.alertRule.id).then(res => {