|
|
@@ -81,7 +81,7 @@
|
|
|
:columns="columns"
|
|
|
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: handleSelectionChange }"
|
|
|
:pagination="false"
|
|
|
- rowKey="messageId"
|
|
|
+ rowKey="notificationId"
|
|
|
>
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.key === 'priority'">
|
|
|
@@ -199,6 +199,7 @@
|
|
|
|
|
|
<script setup name="MessageManagement">
|
|
|
import { SearchOutlined, ReloadOutlined, SendOutlined, DeleteOutlined, EyeOutlined } from '@ant-design/icons-vue'
|
|
|
+import { Modal } from 'ant-design-vue'
|
|
|
import { listNotification, getNotification, delNotification } from "@/api/system/message"
|
|
|
import SendMessageDialog from './components/SendMessageDialog.vue'
|
|
|
|
|
|
@@ -227,7 +228,7 @@ const sendDialogRef = ref(null)
|
|
|
const queryFormRef = ref(null)
|
|
|
|
|
|
const columns = [
|
|
|
- { title: '消息ID', dataIndex: 'messageId', key: 'messageId', width: 80, align: 'center' },
|
|
|
+ { title: '消息ID', dataIndex: 'notificationId', key: 'notificationId', width: 80, align: 'center' },
|
|
|
{ title: '优先级', key: 'priority', width: 80, align: 'center' },
|
|
|
{ title: '消息标题', dataIndex: 'title', key: 'title', ellipsis: true, minWidth: 200 },
|
|
|
{ title: '发送者', key: 'senderName', width: 120, align: 'center' },
|
|
|
@@ -280,7 +281,7 @@ function handleSendSuccess() {
|
|
|
/** 查看消息详情 */
|
|
|
function handleView(row) {
|
|
|
loading.value = true
|
|
|
- getNotification(row.messageId).then(response => {
|
|
|
+ getNotification(row.notificationId).then(response => {
|
|
|
form.value = response.data
|
|
|
receiverList.value = response.data.receivers || []
|
|
|
viewOpen.value = true
|
|
|
@@ -290,13 +291,26 @@ function handleView(row) {
|
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
function handleDelete(row) {
|
|
|
- const messageIds = row.messageId || ids.value
|
|
|
- proxy.$modal.confirm('是否确认删除消息ID为"' + messageIds + '"的数据项?').then(() => {
|
|
|
- return delNotification(messageIds)
|
|
|
- }).then(() => {
|
|
|
- getList()
|
|
|
- proxy.$modal.msgSuccess("删除成功")
|
|
|
- }).catch(() => {})
|
|
|
+ const notificationIds = row?.notificationId ? [row.notificationId] : ids.value
|
|
|
+
|
|
|
+ if (!notificationIds || notificationIds.length === 0) {
|
|
|
+ proxy.$modal.msgError("请选择要删除的数据")
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const notificationIdStr = notificationIds.join(',')
|
|
|
+ Modal.confirm({
|
|
|
+ title: '系统提示',
|
|
|
+ content: '是否确认删除消息ID为"' + notificationIdStr + '"的数据项?',
|
|
|
+ okText: '确定',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk: () => {
|
|
|
+ return delNotification(notificationIdStr).then(() => {
|
|
|
+ getList()
|
|
|
+ proxy.$modal.msgSuccess("删除成功")
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
getList()
|