mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-11 06:57:10 +08:00
fix: 修复消息中心已读计数更新问题
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<GiTable
|
<GiTable
|
||||||
v-model:selectedKeys="selectedKeys"
|
v-model:selected-keys="selectedKeys"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
:data="dataList"
|
:data="dataList"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
@@ -62,6 +62,7 @@ import { Message, Modal } from '@arco-design/web-vue'
|
|||||||
import { type MessageQuery, deleteMessage, listMessage, readAllMessage, readMessage } from '@/apis'
|
import { type MessageQuery, deleteMessage, listMessage, readAllMessage, readMessage } from '@/apis'
|
||||||
import { useTable } from '@/hooks'
|
import { useTable } from '@/hooks'
|
||||||
import { useDict } from '@/hooks/app'
|
import { useDict } from '@/hooks/app'
|
||||||
|
import mittBus from '@/utils/mitt'
|
||||||
|
|
||||||
defineOptions({ name: 'SystemMessage' })
|
defineOptions({ name: 'SystemMessage' })
|
||||||
|
|
||||||
@@ -70,7 +71,10 @@ const { message_type } = useDict('message_type')
|
|||||||
const queryForm = reactive<MessageQuery>({
|
const queryForm = reactive<MessageQuery>({
|
||||||
sort: ['createTime,desc'],
|
sort: ['createTime,desc'],
|
||||||
})
|
})
|
||||||
|
// 表格更新回调
|
||||||
|
const onSuccess = () => {
|
||||||
|
mittBus.emit('count-refresh')
|
||||||
|
}
|
||||||
const {
|
const {
|
||||||
tableData: dataList,
|
tableData: dataList,
|
||||||
loading,
|
loading,
|
||||||
@@ -80,7 +84,7 @@ const {
|
|||||||
selectAll,
|
selectAll,
|
||||||
search,
|
search,
|
||||||
handleDelete,
|
handleDelete,
|
||||||
} = useTable((page) => listMessage({ ...queryForm, ...page }), { immediate: true })
|
} = useTable((page) => listMessage({ ...queryForm, ...page }), { immediate: true, onSuccess })
|
||||||
|
|
||||||
const columns: TableInstance['columns'] = [
|
const columns: TableInstance['columns'] = [
|
||||||
{
|
{
|
||||||
|
@@ -30,6 +30,7 @@ import MyMessage from './components/MyMessage.vue'
|
|||||||
import MyNotice from './components/MyNotice.vue'
|
import MyNotice from './components/MyNotice.vue'
|
||||||
import { useDevice } from '@/hooks'
|
import { useDevice } from '@/hooks'
|
||||||
import { type MessageResp, type NoticeResp, listMessage, listNotice } from '@/apis'
|
import { type MessageResp, type NoticeResp, listMessage, listNotice } from '@/apis'
|
||||||
|
import mittBus from '@/utils/mitt'
|
||||||
|
|
||||||
defineOptions({ name: 'UserMessage' })
|
defineOptions({ name: 'UserMessage' })
|
||||||
|
|
||||||
@@ -84,6 +85,9 @@ const getNoticeData = async () => {
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getMessageData()
|
getMessageData()
|
||||||
getNoticeData()
|
getNoticeData()
|
||||||
|
mittBus.on('count-refresh', () => {
|
||||||
|
getMessageData()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const menuList = [
|
const menuList = [
|
||||||
|
Reference in New Issue
Block a user