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
0360c5dc
authored
Dec 08, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
control
parent
d7752716
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
44 deletions
components/chat-room.vue
components/chat-room.vue
View file @
0360c5dc
...
...
@@ -39,49 +39,31 @@
</
template
>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Provide
,
Ref
,
Vue
,
Watch
,
}
from
"vue-property-decorator"
;
import
{
Component
,
Provide
,
Ref
,
Vue
,
Watch
}
from
"vue-property-decorator"
;
import
MessageInput
from
"@/customer-service/components/message-input.vue"
;
import
messages
from
"@/customer-service/components/message-list.vue"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
Chat
from
"@/customer-service/xim"
;
type
RoomInfoTab
=
"customer"
|
"order"
;
@
Component
({
components
:
{
MessageInput
,
messages
}
})
export
default
class
ChatRoom
extends
Vue
{
@
Ref
(
"chatBox"
)
chatBox
!
:
Element
;
@
Ref
(
"top"
)
refTop
!
:
Element
;
@
Ref
(
"bottom"
)
refBottom
!
:
Element
;
@
Ref
(
"resize"
)
refResize
!
:
Element
;
@
Ref
(
"chatBox"
)
private
readonly
chatBox
!
:
Element
;
@
Ref
(
"top"
)
private
readonly
refTop
!
:
Element
;
@
Ref
(
"bottom"
)
private
readonly
refBottom
!
:
Element
;
@
Ref
(
"resize"
)
private
readonly
refResize
!
:
Element
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
@
chatStore
.
Getter
(
ChatStore
.
GETTER_CURRENT_CHAT_PRESENT_MEMBERS
)
private
readonly
chatMembers
!
:
ChatStore
.
GETTER_CURRENT_CHAT_PRESENT_MEMBERS
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_CLEAR_CURRENT_CHAT_MEMBERS
)
private
readonly
clearChatMembers
!
:
ChatStore
.
MUTATION_CLEAR_CURRENT_CHAT_MEMBERS
;
@
chatStore
.
State
(
ChatStore
.
STATE_CURRENT_CHAT_TITLE
)
private
readonly
chatTitle
!
:
ChatStore
.
STATE_CURRENT_CHAT_TITLE
;
@
chatStore
.
State
(
ChatStore
.
STATE_CURRENT_CHAT_INPUTING
)
private
readonly
currentInputPeople
!
:
ChatStore
.
STATE_CURRENT_CHAT_INPUTING
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_UNIPLAT_ID
)
private
readonly
currentChatUniplatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_UNIPLAT_ID
;
@
chatStore
.
State
(
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
)
private
readonly
myChatList
!
:
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_IS_CHAT_MEMBER
)
private
readonly
isChatMember
!
:
ChatStore
.
STATE_CHAT_CURRENT_IS_CHAT_MEMBER
;
...
...
@@ -92,11 +74,6 @@
return
this
.
isChatMember
&&
this
.
chatError
!==
this
.
chatId
;
}
private
allChatList
=
{
list
:
[]
};
@
Prop
({
type
:
Function
})
private
close
?:
()
=>
void
;
@
Provide
()
showReadSummary
=
true
;
@
Watch
(
"currentChatUniplatId"
)
...
...
@@ -105,28 +82,12 @@
this
.
clearChatMembers
();
}
private
activeTab
:
RoomInfoTab
=
"customer"
;
private
get
getCurrentInputingPeople
()
{
return
this
.
currentInputPeople
.
map
(()
=>
""
/* this.userInfo[k].name */
)
.
join
(
"、"
);
}
private
get
currentChat
()
{
const
chatId
=
this
.
chatId
;
const
result
=
this
.
myChatList
.
find
((
k
)
=>
k
.
chat_id
===
chatId
);
return
result
??
{};
}
private
get
customerInfoTabShow
()
{
return
this
.
activeTab
===
"customer"
;
}
private
get
orderInfoTabShow
()
{
return
this
.
activeTab
===
"order"
;
}
private
onError
(
msg
:
string
)
{
Chat
.
error
(
msg
);
}
...
...
@@ -190,6 +151,10 @@
}
}
.chat-room-con
{
min-width
:
400px
;
}
.chat-panel
{
height
:
100%
;
.chat-area,
...
...
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