Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Y
yishuju-ui
Project
Project
Details
Activity
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
何远江
yishuju-ui
Commits
6f9fd479
Commit
6f9fd479
authored
Jan 21, 2025
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加收到新消息提示
parent
292e88dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
Message.vue
src/layouts/components/Header/components/Message.vue
+21
-1
No files found.
src/layouts/components/Header/components/Message.vue
View file @
6f9fd479
...
...
@@ -2,7 +2,7 @@
<div
class=
"message"
>
<el-popover
placement=
"bottom"
:width=
"310"
trigger=
"click"
>
<template
#
reference
>
<el-badge
:value=
"msgList.length"
class=
"item"
>
<el-badge
:value=
"msgList.length"
class=
"item"
@
click=
"clickMsg"
>
<i
:class=
"'iconfont icon-xiaoxi'"
class=
"toolBar-icon"
></i>
</el-badge>
</
template
>
...
...
@@ -39,6 +39,21 @@
</el-tab-pane>
</el-tabs> -->
</el-popover>
<el-popover
:visible=
"visible"
placement=
"bottom"
title=
"收到1条新消息"
:width=
"200"
>
<
template
#
reference
>
<el-badge
class=
"item"
>
<i
:class=
"'iconfont icon-xiaoxi'"
class=
"toolBar-icon"
style=
"display: none"
></i>
</el-badge>
</
template
>
<div>
{{socketStore.msg.title}}
</div>
</el-popover>
</div>
</template>
...
...
@@ -55,6 +70,7 @@
const
router
=
useRouter
();
const
activeName
=
ref
(
'first'
);
const
msgList
=
ref
([]);
const
visible
=
ref
(
false
)
const
socketStore
=
useSocketStore
();
console
.
log
(
'socketStore'
,
socketStore
)
const
query
=
()
=>
{
...
...
@@ -70,6 +86,7 @@
});
}
watch
(()
=>
socketStore
.
msg
,
(
newValue
,
oldValue
)
=>
{
visible
.
value
=
true
query
()
});
import
{
getAppEnvConfig
}
from
'@/utils/env'
;
...
...
@@ -83,6 +100,9 @@
if
(
socketStore
.
ws
){
socketStore
.
sendMsg
({
aa
:
44
});
}
const
clickMsg
=
()
=>
{
visible
.
value
=
false
}
const
clickMessage
=
(
item
)
=>
{
readMessage
({
msgId
:
item
.
id
...
...
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