NEZ-1849 feat :alert message列表页面 增加 acknowledge 状态及按钮
This commit is contained in:
@@ -106,3 +106,7 @@
|
|||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: $--color-text-label;
|
color: $--color-text-label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.blues{
|
||||||
|
color: $--color-text-link;
|
||||||
|
}
|
||||||
|
|||||||
@@ -90,6 +90,7 @@
|
|||||||
{{$t(stateOptions.find(state=>state.value == scope.row['state']).label)}}
|
{{$t(stateOptions.find(state=>state.value == scope.row['state']).label)}}
|
||||||
</span>
|
</span>
|
||||||
</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>
|
<span v-else-if="scope.row[item.prop]">{{scope.row[item.prop]}}</span>
|
||||||
<template v-else>-</template>
|
<template v-else>-</template>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<el-dropdown-item>
|
<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>
|
<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>
|
<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>
|
<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>
|
</el-dropdown-item>
|
||||||
</div>
|
</div>
|
||||||
@@ -530,24 +530,29 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
batchAck () {
|
batchAck () {
|
||||||
const params = []
|
if (this.batchDeleteObjs.length < 1) return
|
||||||
const obj = {}
|
this.$confirm(this.$t('tip.confirmBatchAck', [this.batchDeleteObjs.length]), {
|
||||||
this.batchDeleteObjs.forEach(item => {
|
confirmButtonText: this.$t('tip.yes'),
|
||||||
obj.id = item.id
|
cancelButtonText: this.$t('tip.no'),
|
||||||
obj.ack = item.ack
|
type: 'warning'
|
||||||
params.push(obj)
|
}).then(() => {
|
||||||
})
|
this.delFlag = true
|
||||||
if (params.length === 0) {
|
const params = []
|
||||||
this.$message({ type: 'error', message: this.$t('tip.SelectAlertMessages') })
|
const obj = {}
|
||||||
} else {
|
this.batchDeleteObjs.forEach(item => {
|
||||||
|
obj.id = item.id
|
||||||
|
obj.ack = item.ack
|
||||||
|
params.push(obj)
|
||||||
|
})
|
||||||
this.$put('alert/message/ack', params).then(response => {
|
this.$put('alert/message/ack', params).then(response => {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.ackSuccess') })
|
this.$message({ duration: 1000, type: 'success', message: this.$t('tip.ackSuccess') })
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.msg)
|
this.$message.error(response.msg)
|
||||||
}
|
}
|
||||||
|
this.getTableData()
|
||||||
})
|
})
|
||||||
}
|
})
|
||||||
},
|
},
|
||||||
labelsSort (obj) {
|
labelsSort (obj) {
|
||||||
const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'project', 'datacenter', 'parent_asset', 'user']
|
const buildIn = ['asset', 'endpoint', 'module', 'cpu', 'project', 'datacenter', 'parent_asset', 'user']
|
||||||
|
|||||||
Reference in New Issue
Block a user