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
952dd869
authored
Aug 27, 2021
by
吴云建
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
接待时,自动跳转到我的接待
parent
e4d592fa
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
24 deletions
chat.vue
components/chat-container.vue
components/chat-list-model.vue
components/chat-title.vue
components/message-list.vue
store/index.ts
chat.vue
View file @
952dd869
<
template
>
<div
class=
"chat-con"
:class=
"
{ userMode, isSingle: isSingleChat }" v-if="chatId != null">
<ChatTitle
:close=
"hide"
class=
"chat-title"
/>
<ChatTitle
:close=
"hide"
class=
"chat-title"
@
updateActive=
"$emit('updateActive', $event)"
/>
<div
class=
"chat-area-con"
:class=
"
{isSingle: isSingleChat, needSearch: !modelName}">
<div
v-if=
"chatId != null"
class=
"h-100 chat-area"
>
<chat-room
/>
...
...
components/chat-container.vue
View file @
952dd869
...
...
@@ -16,7 +16,7 @@
<chat-list
v-if=
"!modelName"
ref=
"chatListComp"
@
list-count-update=
"$emit('list-count-update', $event)"
/>
<chat-list-model
v-if=
"modelName"
@
list-count-update=
"$emit('list-count-update', $event)"
ref=
"chatListModel"
:modelName=
"modelName"
:listName=
"listName"
/>
<div
class=
"chat-content-wrap"
v-if=
"chatVisible && onShow"
>
<chat
:modelName=
"modelName"
/>
<chat
:modelName=
"modelName"
@
updateActive=
"$emit('updateActive', $event)"
/>
</div>
</div>
</
template
>
...
...
@@ -27,7 +27,6 @@ import ChatList from "@/customer-service/components/chat-list.vue";
import
ChatListModel
from
"@/customer-service/components/chat-list-model.vue"
;
import
chat
from
"@/customer-service/chat.vue"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
import
buttonThrottle
from
"../utils/button-throttle"
;
@
Component
({
name
:
"ChatContainer"
,
...
...
@@ -41,6 +40,7 @@ export default class ChatContainer extends Vue {
@
Prop
(
Boolean
)
isInPage
:
boolean
;
@
Prop
(
String
)
modelName
:
string
;
@
Prop
(
String
)
listName
:
string
;
@
Prop
(
String
)
activeName
:
string
;
@
Prop
(
Boolean
)
isActive
:
boolean
;
private
onShow
=
false
;
...
...
@@ -62,7 +62,7 @@ export default class ChatContainer extends Vue {
@
Watch
(
"isActive"
,
{
immediate
:
true
})
isActiveUpdate
()
{
this
.
onShow
=
this
.
isActive
;
if
(
!
this
.
onShow
)
{
if
(
!
this
.
onShow
&&
this
.
activeName
!==
"my_receiving"
||
this
.
onShow
&&
this
.
listName
)
{
this
.
chatListModel
&&
this
.
chatListModel
.
clearActiveId
();
}
}
...
...
components/chat-list-model.vue
View file @
952dd869
...
...
@@ -52,7 +52,7 @@
:current-page
.
sync=
"currentPage"
@
current-change=
"getList"
:page-sizes=
"[10, 20, 50]"
:pager-count=
"
3
"
:pager-count=
"
5
"
layout=
"total, prev, pager, next"
></el-pagination>
</div>
...
...
@@ -84,35 +84,27 @@ export function parserMessage(type: string, rawMsg: string) {
@
Component
({
components
:
{}
})
export
default
class
ModelChatList
extends
Vue
{
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
)
private
readonly
chatId
!
:
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
;
@
chatStore
.
Action
(
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN
)
private
readonly
_createChat
!
:
ChatStore
.
ACTION_CREATE_NEW_CHAT_BY_SERVICE_MAN
;
private
chatList
:
ChatType
[]
=
[];
@
chatStore
.
Action
(
ChatStore
.
ACTION_SAVE_CURRENT_CHAT_ID_VERSION
)
private
readonly
saveChatId
!
:
ChatStore
.
ACTION_SAVE_CURRENT_CHAT_ID_VERSION
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SAVE_MYSELF_ID
)
private
readonly
saveMyId
!
:
ChatStore
.
MUTATION_SAVE_MYSELF_ID
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SET_CHAT_SOURCE
)
private
readonly
setSource
!
:
ChatStore
.
MUTATION_SET_CHAT_SOURCE
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SHOW_CHAT
)
private
readonly
showChat
:
ChatStore
.
MUTATION_SHOW_CHAT
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_HIDE_CHAT
)
private
readonly
hideChat
:
ChatStore
.
MUTATION_HIDE_CHAT
;
@
chatStore
.
State
(
ChatStore
.
STATE_CHAT_USERNAME
)
private
readonly
userNames
!
:
ChatStore
.
STATE_CHAT_USERNAME
;
@
chatStore
.
Mutation
(
ChatStore
.
MUTATION_SAVE_USERNAME
)
private
readonly
updateUserName
!
:
ChatStore
.
MUTATION_SAVE_USERNAME
;
@
chatStore
.
Action
(
ChatStore
.
ACTION_CLEAR_CURRENT_CHAT_DATA
)
private
readonly
clearChatId
!
:
ChatStore
.
ACTION_CLEAR_CURRENT_CHAT_DATA
;
@
Prop
({
type
:
Number
,
default
:
-
1
})
private
selected
!
:
number
;
...
...
@@ -137,7 +129,7 @@ export default class ModelChatList extends Vue {
}
public
clearActiveId
()
{
this
.
activeId
=
""
;
this
.
clearChatId
()
;
}
private
async
getList
()
{
...
...
components/chat-title.vue
View file @
952dd869
...
...
@@ -40,9 +40,6 @@
</template>
<
script
lang=
"ts"
>
import
{
Component
,
Prop
,
Vue
}
from
"vue-property-decorator"
;
import
buttonThrottle
from
"../utils/button-throttle"
;
import
ChatCreator
from
"@/customer-service/components/create-chat.vue"
;
import
{
ChatStore
,
chatStore
}
from
"@/customer-service/store/model"
;
...
...
@@ -132,6 +129,7 @@ export default class ChatTitle extends Vue {
private
async
startReception
()
{
try
{
await
this
.
_startReception
();
this
.
$emit
(
"updateActive"
,
"my_receiving"
)
}
catch
(
error
)
{
console
.
error
(
error
);
}
...
...
components/message-list.vue
View file @
952dd869
...
...
@@ -182,7 +182,7 @@ export default class MessageList extends Vue {
this
.
scollWrapper
&&
this
.
scollWrapper
.
removeEventListener
(
"scroll"
,
this
.
handleScroll
);
this
.
clearScrollToBottomFunc
();
this
.
clearChatId
();
//
this.clearChatId();
}
public
scroll2End
(
delay
?:
number
)
{
...
...
store/index.ts
View file @
952dd869
...
...
@@ -324,7 +324,7 @@ export default {
const
data
=
await
xim
.
fetchChatList
();
if
(
data
==
null
)
return
;
const
chatList
=
data
.
args
[
0
];
console
.
log
(
"
testing
"
,
chatList
);
console
.
log
(
"
chatList:
"
,
chatList
);
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
{
list
:
chatList
.
map
((
chat
:
any
)
=>
{
let
business_data
;
...
...
@@ -720,7 +720,6 @@ export default {
uids
:
Parameters
<
ChatStore
.
ACTION_CHAT_ADD_MEMBERS
>
[
0
]
)
{
const
currentChat
=
getters
[
ChatStore
.
GETTER_CURRENT_CURRENT_CHAT
];
console
.
log
(
currentChat
)
if
(
currentChat
==
null
)
return
;
const
{
model_name
,
obj_id
}
=
currentChat
.
business_data
;
if
(
model_name
==
null
)
return
;
...
...
@@ -754,7 +753,6 @@ export default {
uids
:
Parameters
<
ChatStore
.
ACTION_CHAT_ADD_CS
>
[
0
]
)
{
const
currentChat
=
getters
[
ChatStore
.
GETTER_CURRENT_CURRENT_CHAT
];
console
.
log
(
currentChat
)
if
(
currentChat
==
null
)
return
;
const
{
model_name
,
obj_id
}
=
currentChat
.
business_data
;
if
(
model_name
==
null
)
return
;
...
...
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