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

This commit is contained in:
likexuan
2022-05-07 11:16:17 +08:00
parent 1a7f68a174
commit c32683b173
4 changed files with 38 additions and 9 deletions

View File

@@ -33,6 +33,7 @@
:table-data="tableData" :table-data="tableData"
:alertMessageTabNew="true" :alertMessageTabNew="true"
@del="del" @del="del"
@acknowledge="acknowledge"
class="bottom-box__top" class="bottom-box__top"
@showText="showText" @showText="showText"
@edit="edit" @edit="edit"
@@ -230,6 +231,12 @@ export default {
type: 'input', type: 'input',
label: 'labels', label: 'labels',
disabled: false disabled: false
}, {
name: this.$t('overall.acknowledge'),
type: 'selectString',
label: 'ack',
readonly: true,
disabled: false
} }
] ]
}, },
@@ -311,6 +318,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)
}
})
})
},
getTableData (state) { getTableData (state) {
if (state) { if (state) {
this.state = state this.state = state

View File

@@ -921,8 +921,8 @@ export default {
objectInfo.operation = val.val objectInfo.operation = val.val
} else if (val.label === 'state') { } else if (val.label === 'state') {
objectInfo.state = val.val objectInfo.state = val.val
} else if (val.label === 'acknowledge') { } else if (val.label === 'ack') {
objectInfo.acknowledge = val.val objectInfo.ack = val.val
} }
} else { } else {
objectInfo[val.label] = val.val objectInfo[val.label] = val.val

View File

@@ -173,13 +173,13 @@ const searchSelectInfo = { // value: 传给后台的值label显示给用
label: i18n.t('overall.disabled') label: i18n.t('overall.disabled')
} }
], ],
acknowledge: [ ack: [
{ {
value: 'success', value: '1',
label: i18n.t('config.system.reset.yes') label: i18n.t('config.system.reset.yes')
}, },
{ {
value: 'fail', value: '0',
label: i18n.t('config.system.reset.no') label: i18n.t('config.system.reset.no')
} }
], ],

View File

@@ -277,7 +277,7 @@ export default {
}, { }, {
name: this.$t('overall.acknowledge'), name: this.$t('overall.acknowledge'),
type: 'selectString', type: 'selectString',
label: 'acknowledge', label: 'ack',
readonly: true, readonly: true,
disabled: false disabled: false
} }
@@ -539,10 +539,11 @@ export default {
}).then(() => { }).then(() => {
this.delFlag = true this.delFlag = true
const params = [] const params = []
const obj = {}
this.batchDeleteObjs.forEach(item => { this.batchDeleteObjs.forEach(item => {
obj.id = item.id const obj = {
obj.ack = 1 id: item.id,
ack: 1
}
params.push(obj) params.push(obj)
}) })
this.$put('alert/message/ack', params).then(response => { this.$put('alert/message/ack', params).then(response => {