明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_front
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
jt_front
Commits
9bb75707
Commit
9bb75707
authored
May 18, 2026
by
zhanghan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息模块完成
parent
d2c0f73b
Pipeline
#111532
passed with stage
in 20 seconds
Changes
4
Pipelines
1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
787 additions
and
9 deletions
+787
-9
MainLayout.vue
src/layouts/MainLayout.vue
+5
-8
routes.js
src/router/routes.js
+1
-1
message.js
src/stores/message.js
+19
-0
newMessage.vue
src/views/systemManage/newMessage.vue
+762
-0
No files found.
src/layouts/MainLayout.vue
View file @
9bb75707
...
...
@@ -82,12 +82,14 @@
import
{
computed
,
ref
,
onMounted
,
getCurrentInstance
,
watch
}
from
"vue"
;
import
{
useRouter
,
useRoute
}
from
"vue-router"
;
import
{
useUserStore
}
from
"@/stores/user.js"
;
import
{
useMessageStore
}
from
"@/stores/message.js"
;
import
windowConfig
from
"@/window"
;
import
LeftMenu
from
"./leftMenu.vue"
;
import
axios
from
"axios"
;
import
{
Bell
,
Avatar
,
ArrowUp
,
ArrowDown
}
from
"@element-plus/icons-vue"
;
// 补充导入图标
import
{
Bell
,
Avatar
,
ArrowUp
,
ArrowDown
}
from
"@element-plus/icons-vue"
;
const
userStore
=
useUserStore
();
const
messageStore
=
useMessageStore
();
const
proxyRef
=
ref
(
null
);
const
{
proxy
}
=
getCurrentInstance
();
const
excludeTabs
=
[
"/homePage"
];
...
...
@@ -223,14 +225,9 @@ const getResourceData = () => {
};
// 获取未读消息数量
let
messageCount
=
ref
(
0
);
const
messageCount
=
computed
(()
=>
messageStore
.
messageCount
);
const
getMessageCount
=
()
=>
{
axios
.
post
(
windowConfig
.
baseUrl
+
"/api/message/getMesCount"
,
{})
.
then
((
res
)
=>
{
messageCount
.
value
=
res
.
data
.
count
||
0
;
// 增加默认值
})
.
catch
((
err
)
=>
console
.
error
(
"获取消息数量失败:"
,
err
));
// 增加错误处理
messageStore
.
fetchMessageCount
();
};
// 跳转消息列表页
...
...
src/router/routes.js
View file @
9bb75707
...
...
@@ -26,7 +26,7 @@ const routes = [
name
:
"message"
,
title
:
"消息中心"
,
meta
:
{
title
:
"消息中心"
},
component
:
()
=>
import
(
"@/views/systemManage/
m
essage.vue"
),
component
:
()
=>
import
(
"@/views/systemManage/
newM
essage.vue"
),
},
{
path
:
"/homePage"
,
...
...
src/stores/message.js
0 → 100644
View file @
9bb75707
import
{
defineStore
}
from
"pinia"
;
import
axios
from
"axios"
;
import
windowConfig
from
"@/window"
;
export
const
useMessageStore
=
defineStore
(
"message"
,
{
state
:
()
=>
({
messageCount
:
0
,
}),
actions
:
{
fetchMessageCount
()
{
axios
.
post
(
windowConfig
.
baseUrl
+
"/api/message/getMesCount"
,
{})
.
then
((
res
)
=>
{
this
.
messageCount
=
res
.
data
.
count
||
0
;
})
.
catch
(()
=>
{});
},
},
});
src/views/systemManage/newMessage.vue
0 → 100644
View file @
9bb75707
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment