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
bfc192a3
authored
Nov 23, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
2f3001c9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
20 deletions
components/chat-room.vue
store/index.ts
store/model.ts
components/chat-room.vue
View file @
bfc192a3
...
...
@@ -112,8 +112,7 @@
private
get
currentChat
()
{
const
chatId
=
this
.
chatId
;
if
(
this
.
myChatList
==
null
)
return
;
const
result
=
this
.
myChatList
.
list
.
find
((
k
)
=>
k
.
chat_id
===
chatId
);
const
result
=
this
.
myChatList
.
find
((
k
)
=>
k
.
chat_id
===
chatId
);
return
result
??
{};
}
...
...
store/index.ts
View file @
bfc192a3
...
...
@@ -136,7 +136,7 @@ export default {
[
ChatStore
.
STATE_CHAT_CURRENT_USER_UID
]:
null
,
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]:
null
,
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]:
[],
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
]:
null
,
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
]:
[]
,
[
ChatStore
.
STATE_SINGLE_CHAT
]:
null
,
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_VERSION
]:
null
,
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
]:
null
,
...
...
@@ -429,10 +429,7 @@ export default {
};
if
(
cache
&&
cache
.
length
)
{
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
{
list
:
cache
,
total
:
9999
,
});
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
cache
);
const
ts
=
cache
.
map
((
i
)
=>
Math
.
max
(
i
.
last_msg_ts
,
i
.
update_time
))
.
sort
();
...
...
@@ -473,10 +470,7 @@ export default {
buildChatItem
(
chat
)
);
dbController
.
saveChatList
(
items
);
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
{
list
:
items
,
total
:
9999
,
});
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
items
);
resolve
(
buildUnreadMessage
(
items
));
});
});
...
...
@@ -739,8 +733,9 @@ export default {
if
(
!
chatId
)
{
return
;
}
const
chatList
=
state
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
]?.
list
??
[];
const
chatList
=
state
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
]
as
ChatType
[];
let
wantedChatRoom
=
chatList
.
find
((
k
)
=>
k
.
chat_id
===
chatId
);
if
(
!
wantedChatRoom
)
{
...
...
@@ -864,7 +859,7 @@ export default {
})
.
execute
();
await
dispatch
(
ChatStore
.
ACTION_GET_MY_CHAT_LIST
);
const
firstChat
=
state
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
]
?.
list
[
0
];
const
firstChat
=
state
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
][
0
];
if
(
firstChat
==
null
)
return
;
await
getChatModelInfo
(
firstChat
.
model_name
,
...
...
@@ -1103,8 +1098,7 @@ export default {
if
(
singleChat
&&
singleChat
.
chat_id
===
chatId
)
{
return
singleChat
;
}
const
chatList
=
state
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
]?.
list
??
[];
const
chatList
=
state
[
ChatStore
.
STATE_MY_CHAT_ROOM_LIST
];
return
chatList
.
find
((
chat
)
=>
chat
.
chat_id
===
chatId
);
},
},
...
...
store/model.ts
View file @
bfc192a3
...
...
@@ -20,10 +20,7 @@ export namespace ChatStore {
export
const
STATE_CHAT_DIALOG_IS_SINGLE
=
"会话模块是否是单个弹窗"
;
export
type
STATE_CHAT_DIALOG_IS_SINGLE
=
boolean
;
export
const
STATE_MY_CHAT_ROOM_LIST
=
"我的会话列表"
;
export
type
STATE_MY_CHAT_ROOM_LIST
=
{
list
:
ChatType
[];
total
:
number
;
}
|
null
;
export
type
STATE_MY_CHAT_ROOM_LIST
=
ChatType
[];
export
const
STATE_SINGLE_CHAT
=
"单独的会话"
;
export
type
STATE_SINGLE_CHAT
=
ChatType
|
null
;
export
const
STATE_CHAT_MSG_HISTORY
=
"某个会话聊天记录"
;
...
...
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