Commit de2c2a87 by wuqian

异常消息删除

parent ab229e2e
......@@ -56,6 +56,14 @@
批量发送
</el-button>
</el-form-item>
<el-form-item>
<el-button
type="danger"
@click="deleteSection()"
icon="el-icon-delete">
批量删除
</el-button>
</el-form-item>
</el-form>
</div>
<div
......@@ -96,6 +104,7 @@ import {
} from '@/common/api/message'
import tableView from '@/common/components/base/tableView.vue'
import JsonViewer from 'vue-json-viewer' // 下载vue-json-viewer插件
import { get } from '@/common/api/axios'
export default {
name: 'exceptionMessage',
components: { tableView, JsonViewer },
......@@ -163,6 +172,12 @@ export default {
onClick={() => this.resendMsg(item)}>
<i class="el-icon-s-promotion"></i>
</span>
<span
class="icon-view icon-del-view"
title="删除"
onClick={() => this.deleteSection(item)}>
<i class="el-icon-delete"></i>
</span>
</div>
)
}
......@@ -173,6 +188,36 @@ export default {
this.getList()
},
methods: {
deleteSection(v) {
const arr = v ? [v] : this.selection
if (arr.length === 0) return this.$message('请勾选至少一条记录')
const ids = arr.map((item) => item.id).join()
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
const url = `sys/MqMessage/del?ids=${ids}`
get(url).then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功!'
})
this.getList()
this.selection = []
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true
})
}
})
})
.catch(() => {
this.selection = []
})
},
async resendMsg(row) {
const arr = row ? [row] : this.selection
if (arr.length === 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment