qsh 6 days ago
parent d1c4632f72
commit a8e41fe889
  1. 29
      src/api/system/notify/message/index.ts
  2. 22
      src/layout/components/Message/src/Message.vue
  3. 2
      src/store/modules/app.ts
  4. 2
      src/store/modules/user.ts
  5. 12
      src/views/Basic/Role/Comp/RoleEmployee.vue

@ -1,5 +1,4 @@
import request from '@/config/axios'
import qs from 'qs'
export interface NotifyMessageVO {
id: number
@ -16,35 +15,39 @@ export interface NotifyMessageVO {
}
// 查询站内信消息列表
export const getNotifyMessagePage = async (params: PageParam) => {
export const getNotifyMessagePage = async (params: any) => {
return await request.get({ url: '/admin-api/system/notify-message/page', params })
}
// 获得我的站内信分页
export const getMyNotifyMessagePage = async (params: PageParam) => {
export const getMyNotifyMessagePage = async (params: any) => {
return await request.get({ url: '/admin-api/system/notify-message/my-page', params })
}
// 批量标记已读
export const updateNotifyMessageRead = async (ids) => {
export const updateNotifyMessageRead = async (data: any) => {
return await request.put({
url:
'/admin-api/system/notify-message/update-read?' +
qs.stringify({ ids: ids }, { indices: false })
url: '/admin-api/system/notify-message/update-read?',
data
})
}
// 标记所有站内信为已读
export const updateAllNotifyMessageRead = async () => {
return await request.put({ url: '/admin-api/system/notify-message/update-all-read' })
export const updateAllNotifyMessageRead = async (data: any) => {
return await request.put({ url: '/admin-api/system/notify-message/update-all-read', data })
}
// 获取当前用户的最新站内信列表
export const getUnreadNotifyMessageList = async () => {
return await request.get({ url: '/admin-api/system/notify-message/get-unread-list' })
export const getUnreadNotifyMessageList = async (params: any) => {
return await request.get({ url: '/admin-api/system/notify-message/get-unread-list', params })
}
// 获得当前用户的未读站内信数量
export const getUnreadNotifyMessageCount = async () => {
return await request.get({ url: '/admin-api/system/notify-message/get-unread-count' })
export const getUnreadNotifyMessageCount = async (params: any) => {
return await request.get({ url: '/admin-api/system/notify-message/get-unread-count', params })
}
// 获取详情
export const getNotifyMessageDetail = async (id: number) => {
return await request.get({ url: '/admin-api/system/notify-message/get', params: { id } })
}

@ -1,7 +1,9 @@
<script lang="ts" name="Message" setup>
import { formatDate } from '@/utils/formatTime'
import * as NotifyMessageApi from '@/api/system/notify/message'
// import * as NotifyMessageApi from '@/api/system/notify/message'
// import { useUserStore } from '@/store/modules/user'
// const userStore = useUserStore()
const { push } = useRouter()
const activeName = ref('notice')
const unreadCount = ref(0) //
@ -9,17 +11,21 @@ const list = ref<any[]>([]) // 消息列表
//
const getList = async () => {
list.value = await NotifyMessageApi.getUnreadNotifyMessageList()
// list.value = await NotifyMessageApi.getUnreadNotifyMessageList({
// roleId: userStore.getUser?.currentRole
// })
// unreadCount 0
unreadCount.value = 0
}
//
const getUnreadCount = async () => {
NotifyMessageApi.getUnreadNotifyMessageCount().then((data) => {
unreadCount.value = data
})
}
// const getUnreadCount = async () => {
// NotifyMessageApi.getUnreadNotifyMessageCount({ roleId: userStore.getUser?.currentRole }).then(
// (data) => {
// unreadCount.value = data
// }
// )
// }
//
const goMyList = () => {
@ -32,7 +38,7 @@ const goMyList = () => {
const msgInterval = ref<any>(null)
onMounted(() => {
//
getUnreadCount()
// getUnreadCount()
//
// msgInterval.value = setInterval(() => {
// getUnreadCount()

@ -56,7 +56,7 @@ export const useAppStore = defineStore('app', {
screenfull: true, // 全屏图标
size: false, // 尺寸图标
locale: false, // 多语言图标
message: true, // 消息图标
message: false, // 消息图标
tagsView: true, // 标签页
tagsViewIcon: false, // 是否显示标签图标
logo: true, // logo

@ -50,7 +50,7 @@ export const useUserStore = defineStore('admin-user', {
return null
}
let userInfo = cache.local.get(CACHE_KEY.USER)
if (!userInfo) {
if (!userInfo || !userInfo?.menus || userInfo.menus.length == 0) {
userInfo = await getInfo({})
}
this.permissions = userInfo.permissions

@ -9,6 +9,18 @@
:label="col.label"
:width="col.width"
/>
<el-table-column label="状态" key="status">
<template #default="scope">
<el-switch
v-model="scope.row.status"
:active-value="0"
active-text="在职"
inactive-text="离职"
:inactive-value="1"
disabled
/>
</template>
</el-table-column>
</el-table>
<Pagination
v-model:limit="pageSize"

Loading…
Cancel
Save