Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d58cd01c
authored
Sep 29, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
消息撤回机制修正
parent
8d03d0e7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
8 deletions
components/controller/index.ts
components/message-list.vue
components/message.vue
database/index.ts
components/controller/index.ts
View file @
d58cd01c
...
...
@@ -11,7 +11,7 @@ export function parserMessage(type: string, rawMsg: string) {
}
else
if
(
type
===
MessageType
.
File
)
{
return
`[文件]`
;
}
else
if
(
type
===
MessageType
.
Withdraw
)
{
return
`[
您
撤回了一条消息]`
;
return
`[撤回了一条消息]`
;
}
else
{
return
`[系统自动回复]`
;
}
...
...
components/message-list.vue
View file @
d58cd01c
...
...
@@ -355,7 +355,7 @@ export default class MessageList extends Vue {
return
v
;
}
private
refresh
(
msg
:
number
)
{
private
refresh
()
{
this
.
fetchNewMsg
();
}
}
...
...
components/message.vue
View file @
d58cd01c
...
...
@@ -93,7 +93,7 @@
class=
"msg-detail withdraw-message"
v-else-if=
"messageType === 'withdraw'"
>
您
撤回了一条消息
{{
userName
}}
撤回了一条消息
</div>
<!-- Text -->
<div
...
...
@@ -482,9 +482,7 @@ export default class Message extends Mixins(Filters) {
<
style
lang=
"less"
scoped
>
.message-con
{
margin
:
20px
0
;
padding-bottom
:
20px
;
margin-bottom
:
0
;
margin-right
:
15px
;
position
:
relative
;
...
...
database/index.ts
View file @
d58cd01c
...
...
@@ -141,7 +141,7 @@ class ChatCacheDatabaseController {
this
.
setupChatMessageDatabase
(
chat
).
finally
(()
=>
{
const
store
=
this
.
buildChatMessageStore
(
chat
);
for
(
const
item
of
items
)
{
store
.
add
(
item
,
item
.
id
);
store
.
add
(
item
);
}
});
}
...
...
@@ -170,17 +170,21 @@ class ChatCacheDatabaseController {
}
const
store
=
this
.
buildChatMessageStore
(
chat
);
for
(
const
item
of
items
)
{
store
.
add
(
item
,
item
.
id
);
store
.
add
(
item
);
}
});
}
public
removeMessage
(
chat
:
number
,
msg
:
number
)
{
return
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
if
(
this
.
db
)
{
const
store
=
this
.
buildChatMessageStore
(
chat
);
const
d
=
store
.
delete
(
msg
);
d
.
onsuccess
=
()
=>
resolve
(
);
d
.
onsuccess
=
()
=>
setTimeout
(()
=>
resolve
(),
100
);
d
.
onerror
=
()
=>
reject
();
}
else
{
resolve
();
}
});
}
...
...
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