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
4fd2e1d8
authored
Aug 12, 2021
by
吴云建
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
会话调整
parent
10cc168f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
components/chat-container.vue
components/chat-list.vue
components/chat-container.vue
View file @
4fd2e1d8
...
...
@@ -3,7 +3,7 @@
<div
class=
"search-wrap"
v-if=
"!modelName"
>
<el-input
class=
"keyword-input"
placeholder=
"
昵称、手机、Email、备注
"
placeholder=
"
会话标题
"
prefix-icon=
"el-icon-search"
v-model=
"searchKeyword"
v-on:keyup
.
enter
.
native=
"search"
...
...
@@ -12,7 +12,7 @@
></el-input>
<i
v-if=
"!isInPage"
class=
"close-btn el-icon-close"
@
click=
"$emit('close')"
></i>
</div>
<chat-list
v-if=
"!modelName"
:searchKeyword=
"searchKeyword"
ref=
"chatListComp"
/>
<chat-list
v-if=
"!modelName"
ref=
"chatListComp"
/>
<chat-list-model
v-if=
"modelName"
@
update-page-info=
"$emit('update-page-info', $event)"
ref=
"chatListModel"
/>
<div
class=
"chat-content-wrap"
v-if=
"chatVisible && onShow"
>
<chat
:modelName=
"modelName"
/>
...
...
@@ -54,9 +54,8 @@ export default class ChatContainer extends Vue {
@
Ref
(
"chatListModel"
)
chatListModel
:
ChatListModel
;
@
buttonThrottle
()
private
search
()
{
this
.
chatListComp
.
search
()
this
.
chatListComp
.
search
(
this
.
searchKeyword
)
}
@
Watch
(
"$route"
)
routeUpdate
()
{
...
...
components/chat-list.vue
View file @
4fd2e1d8
...
...
@@ -75,7 +75,7 @@ export function parserMessage(type: string, rawMsg: string) {
@
Component
({
components
:
{
avatar
}
})
export
default
class
ChatList
extends
Vue
{
@
Prop
(
String
)
searchKeyword
;
private
searchKeyword
=
""
;
@
chatStore
.
Action
(
ChatStore
.
ACTION_GET_MY_CHAT_LIST
)
private
readonly
getMyChatList
!
:
ChatStore
.
ACTION_GET_MY_CHAT_LIST
;
...
...
@@ -110,8 +110,10 @@ export default class ChatList extends Vue {
@
Ref
(
"scrollbar"
)
private
scrollbar
:
Vue
&
{
update
:
()
=>
void
};
private
sseTs
=
0
;
private
get
chatRooms
()
{
return
this
.
chatList
?.
list
||
[];
return
this
.
chatList
?.
list
.
filter
(
chat
=>
chat
.
title
.
indexOf
(
this
.
searchKeyword
)
>
-
1
)
||
[];
}
private
isSelected
(
item
:
ChatType
)
{
...
...
@@ -137,8 +139,12 @@ export default class ChatList extends Vue {
}
onTransportMessage
()
{
this
.
getMyChatList
()
// this.hideChat()
const
ts
=
new
Date
().
getTime
();
if
(
ts
-
this
.
sseTs
>
100
)
{
this
.
getMyChatList
()
// this.hideChat()
this
.
sseTs
=
ts
;
}
}
private
goToOnlyRoom
()
{
...
...
@@ -155,13 +161,8 @@ export default class ChatList extends Vue {
this
.
saveChatId
(
chat_id
);
}
public
async
search
()
{
let
searchKeyword
=
this
.
searchKeyword
.
trim
();
if
(
!
searchKeyword
)
{
await
this
.
getMyChatList
();
}
else
{
await
this
.
getMyChatList
(
searchKeyword
);
}
public
async
search
(
searchKeyword
:
string
)
{
this
.
searchKeyword
=
searchKeyword
.
trim
();
}
private
async
goToChatRoom
(
data
:
ChatType
)
{
...
...
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