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
83194f84
authored
Sep 29, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
多用户联动撤回
parent
d58cd01c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletions
components/message-list.vue
components/message-list.vue
View file @
83194f84
...
...
@@ -45,7 +45,7 @@
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Ref
,
Vue
,
Watch
}
from
"vue-property-decorator"
;
import
{
Message
}
from
"../model"
;
import
{
Message
,
MessageType
}
from
"../model"
;
import
{
throttle
}
from
"../utils"
;
import
{
formatTime
}
from
"../utils/time"
;
...
...
@@ -54,6 +54,7 @@ import message from "./message.vue";
import
VideoPreview
from
"./video-preview.vue"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
{
dbController
}
from
"../database"
;
@
Component
({
components
:
{
message
,
ImagePreview
,
VideoPreview
}
})
export
default
class
MessageList
extends
Vue
{
...
...
@@ -84,6 +85,15 @@ export default class MessageList extends Vue {
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_CLEAR_FUNC_SCROLL_TO_BOTTOM
)
private
readonly
clearScrollToBottomFunc
!
:
ChatStore
.
MUTATION_CLEAR_FUNC_SCROLL_TO_BOTTOM
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SAVE_FUNC_ON_NEW_MSG
)
private
readonly
onNewMessage
:
ChatStore
.
MUTATION_SAVE_FUNC_ON_NEW_MSG
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_CLEAR_FUNC_ON_NEW_MSG
)
private
readonly
clearNewMessage
:
ChatStore
.
MUTATION_CLEAR_FUNC_ON_NEW_MSG
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_WITHDRAW
)
private
readonly
executeWithDraw
:
ChatStore
.
MUTATION_WITHDRAW
;
@
Prop
({
default
:
"circle"
})
private
shape
!
:
string
;
...
...
@@ -177,6 +187,14 @@ export default class MessageList extends Vue {
public
created
()
{
this
.
handleScrollWrapper
();
this
.
onNewMessage
((
e
)
=>
{
if
(
e
.
type
===
MessageType
.
Withdraw
)
{
this
.
executeWithDraw
(
e
.
ref_id
);
dbController
.
removeMessage
(
e
.
chat_id
,
e
.
ref_id
)
.
finally
(()
=>
this
.
refresh
());
}
});
}
public
mounted
()
{
...
...
@@ -190,6 +208,7 @@ export default class MessageList extends Vue {
this
.
scollWrapper
&&
this
.
scollWrapper
.
removeEventListener
(
"scroll"
,
this
.
handleScroll
);
this
.
clearScrollToBottomFunc
();
this
.
clearNewMessage
();
// this.clearChatId();
}
...
...
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