NEZ-1849 feat :alert message列表页面 增加 acknowledge 状态及按钮
This commit is contained in:
@@ -106,3 +106,7 @@
|
||||
border-radius: 4px;
|
||||
color: $--color-text-label;
|
||||
}
|
||||
|
||||
.blues{
|
||||
color: $--color-text-link;
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@
|
||||
{{$t(stateOptions.find(state=>state.value == scope.row['state']).label)}}
|
||||
</span>
|
||||
</span>
|
||||
<span v-else-if="item.prop === 'id'"><i :style="{'font-size':'12px','margin-right':'5px'}" class="nz-icon nz-icon-circle" :class="scope.row.ack == 1 ? 'blues' : 'gray'"></i>{{scope.row[item.prop]}}</span>
|
||||
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
|
||||
<template v-else>-</template>
|
||||
</template>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<el-dropdown-item>
|
||||
<delete-button id="alert-msg-batch-delete" v-has="'alertMessage_expired'" :api="url" :clickFunction="batchDel" :delete-objs="batchDeleteObjs" @after="getTableData" @before="delFlag=true" :title="$t('overall.batchDel')" :type="'link'"></delete-button>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<el-dropdown-item :disabled="batchDeleteObjs.length==0">
|
||||
<div id="alert-msg-batch-ack" v-has="'alertMessage_expired'" @click="batchAck"><i class="nz-icon nz-icon-queren"></i>{{$t('overall.batchAck')}}</div>
|
||||
</el-dropdown-item>
|
||||
</div>
|
||||
@@ -530,6 +530,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
batchAck () {
|
||||
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 => {
|
||||
@@ -537,17 +544,15 @@ export default {
|
||||
obj.ack = item.ack
|
||||
params.push(obj)
|
||||
})
|
||||
if (params.length === 0) {
|
||||
this.$message({ type: 'error', message: this.$t('tip.SelectAlertMessages') })
|
||||
} else {
|
||||
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']
|
||||
|
||||
Reference in New Issue
Block a user