|
@@ -1,7 +1,8 @@
|
|
|
<template>
|
|
<template>
|
|
|
<router-view />
|
|
<router-view />
|
|
|
<Notify v-model:show="notify.show" :title="notify.title" :content="notify.content" />
|
|
<Notify v-model:show="notify.show" :title="notify.title" :content="notify.content" />
|
|
|
- <Dialog class="g-dialog-message" v-model:show="message.show" theme="round-button" confirm-button-text="关闭">
|
|
|
|
|
|
|
+ <Dialog class="g-dialog-message" v-model:show="message.show" theme="round-button" confirm-button-text="关闭"
|
|
|
|
|
+ @closed="onClosed">
|
|
|
<template #title>
|
|
<template #title>
|
|
|
<div class="g-dialog-message__header">
|
|
<div class="g-dialog-message__header">
|
|
|
<h4>{{ currentMessage?.title }}</h4>
|
|
<h4>{{ currentMessage?.title }}</h4>
|
|
@@ -60,7 +61,7 @@ const message = reactive({
|
|
|
|
|
|
|
|
// 获取用户阅读状态
|
|
// 获取用户阅读状态
|
|
|
const getUserReadStatus = () => ({
|
|
const getUserReadStatus = () => ({
|
|
|
- key: 'user_' + loginStore.loginId,
|
|
|
|
|
|
|
+ key: 'read_' + loginStore.loginId,
|
|
|
value: formatDate(new Date().toISOString(), 'YYYY-MM-DD')
|
|
value: formatDate(new Date().toISOString(), 'YYYY-MM-DD')
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -81,10 +82,14 @@ const changeMessage = (value: number) => {
|
|
|
const i = message.index + value
|
|
const i = message.index + value
|
|
|
if (i > -1 && i < messageList.value.length) {
|
|
if (i > -1 && i < messageList.value.length) {
|
|
|
message.index = i
|
|
message.index = i
|
|
|
- noticeStore.updateNoticeReaded(currentMessage.value.autoid)
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 关闭消息弹窗
|
|
|
|
|
+const onClosed = () => {
|
|
|
|
|
+ messageList.value.forEach((e) => noticeStore.updateNoticeReaded(e.autoid))
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// 顶部通知
|
|
// 顶部通知
|
|
|
const notify = reactive({
|
|
const notify = reactive({
|
|
|
show: false,
|
|
show: false,
|
|
@@ -150,7 +155,6 @@ watch(() => noticeStore.isInitialized, () => {
|
|
|
localStorage.setItem(key, value) // 记录用户已读状态
|
|
localStorage.setItem(key, value) // 记录用户已读状态
|
|
|
message.index = 0
|
|
message.index = 0
|
|
|
message.show = true
|
|
message.show = true
|
|
|
- noticeStore.updateNoticeReaded(firstMessage.autoid)
|
|
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|