杂务:新增声明级注释覆盖率
This commit is contained in:
@@ -44,18 +44,38 @@
|
||||
import { computed, onMounted, ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { message } from 'ant-design-vue'
|
||||
/**
|
||||
* Purpose: SystemMessageVO supports NotificationsView.vue by holding or executing the system message vo page or API role.
|
||||
* Usage: import, call, read, or update this type from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
import { userApi, type SystemMessageVO } from '@/api/user'
|
||||
|
||||
/**
|
||||
* Purpose: router supports NotificationsView.vue by holding or executing the router page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const router = useRouter()
|
||||
/** loading is a reactive state variable used by the template and event handlers. */
|
||||
const loading = ref(false)
|
||||
/**
|
||||
* Purpose: messages supports NotificationsView.vue by holding or executing the messages page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const messages = ref<SystemMessageVO[]>([])
|
||||
/** detailVisible is a reactive state variable used by the template and event handlers. */
|
||||
const detailVisible = ref(false)
|
||||
/**
|
||||
* Purpose: currentMessage supports NotificationsView.vue by holding or executing the current message page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const currentMessage = ref<SystemMessageVO | null>(null)
|
||||
/** unreadCount is a reactive state variable used by the template and event handlers. */
|
||||
const unreadCount = computed(() => messages.value.filter(item => item.readStatus !== 1).length)
|
||||
|
||||
/**
|
||||
* Purpose: resolveSystemMessageActionPath supports NotificationsView.vue by holding or executing the resolve system message action path page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const resolveSystemMessageActionPath = (item: SystemMessageVO) => {
|
||||
const actionPath = String(item.actionPath || '').trim()
|
||||
if (!actionPath || !actionPath.startsWith('/') || actionPath.startsWith('//')) {
|
||||
@@ -64,6 +84,10 @@ const resolveSystemMessageActionPath = (item: SystemMessageVO) => {
|
||||
return actionPath
|
||||
}
|
||||
|
||||
/**
|
||||
* Purpose: markMessageReadIfNeeded supports NotificationsView.vue by holding or executing the mark message read if needed page or API role.
|
||||
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
|
||||
*/
|
||||
const markMessageReadIfNeeded = async (item: SystemMessageVO) => {
|
||||
if (item.readStatus === 1) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user