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
362709e0
authored
Nov 05, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update detail name
parent
1f004f4f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
model/index.ts
store/index.ts
xim/models/chat.ts
model/index.ts
View file @
362709e0
...
...
@@ -91,7 +91,7 @@ export const enum MessageType {
Voice
=
"voice"
,
GeneralOrderMsg
=
"general_order_msg"
,
Withdraw
=
"withdraw"
,
Action
=
"action"
Action
=
"action"
,
}
export
const
enum
MessageHandled
{
...
...
@@ -129,6 +129,7 @@ export type MessageRequestResult = readonly Message[];
export
interface
BaseChatItemBusinessData
{
model_name
:
string
;
obj_id
:
string
;
detail_name
?:
string
;
}
export
interface
BaseChatItem
extends
BaseChatItemBusinessData
{
...
...
store/index.ts
View file @
362709e0
...
...
@@ -31,7 +31,7 @@ function uniqueMessages(
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
)
{
const
arr
=
[...
messages
];
return
unique
(
arr
,
function
(
item
,
all
)
{
return
unique
(
arr
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
});
}
...
...
@@ -327,7 +327,7 @@ export default {
state
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]
=
[...
current
];
}
},
[
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_INPUTING
]:
(
function
()
{
[
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_INPUTING
]:
(
function
()
{
const
setTimeoutId
:
{
[
key
:
string
]:
number
}
=
{};
return
(
state
:
ChatStoreState
,
...
...
@@ -386,6 +386,25 @@ export default {
async
[
ChatStore
.
ACTION_GET_MY_CHAT_LIST
]({
commit
,
state
})
{
let
cache
=
await
dbController
.
getChatList
();
for
(
const
item
of
cache
)
{
if
(
item
.
business_data
&&
!
item
.
detail_name
)
{
const
d
=
JSON
.
parse
(
item
.
business_data
)
as
BaseChatItemBusinessData
;
if
(
d
)
{
if
(
d
.
detail_name
)
{
item
.
detail_name
=
d
.
detail_name
;
}
if
(
!
item
.
obj_id
&&
d
.
obj_id
)
{
item
.
obj_id
=
d
.
obj_id
;
}
if
(
!
item
.
model_name
&&
d
.
model_name
)
{
item
.
model_name
=
d
.
model_name
;
}
}
}
}
const
buildUnreadMessage
=
(
items
:
ChatType
[])
=>
{
let
sum
=
0
;
items
.
forEach
((
i
)
=>
(
sum
+=
i
.
unread_msg_count
));
...
...
@@ -760,7 +779,7 @@ export default {
}
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
unique
(
newChatMembers
,
function
(
item
,
all
)
{
unique
(
newChatMembers
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
})
);
...
...
xim/models/chat.ts
View file @
362709e0
...
...
@@ -47,6 +47,8 @@ export interface Chat {
chat_id
:
number
;
catalog
:
string
;
biz_type_id
:
number
;
business_data
?:
string
;
detail_name
?:
string
;
}
export
interface
Message
{
...
...
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