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
005ff905
authored
Nov 01, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
member
parent
f1cbe413
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
model/index.ts
store/index.ts
store/model.ts
model/index.ts
View file @
005ff905
...
@@ -191,7 +191,7 @@ export interface ChatMember {
...
@@ -191,7 +191,7 @@ export interface ChatMember {
oid
:
string
;
oid
:
string
;
eid
:
string
;
eid
:
string
;
chat_id
:
number
;
chat_id
:
number
;
type
:
number
;
type
:
ChatRole
;
join_msg_id
:
number
;
join_msg_id
:
number
;
exit_msg_id
:
number
;
exit_msg_id
:
number
;
is_exited
:
boolean
;
is_exited
:
boolean
;
...
...
store/index.ts
View file @
005ff905
...
@@ -31,7 +31,7 @@ function uniqueMessages(
...
@@ -31,7 +31,7 @@ function uniqueMessages(
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
)
{
)
{
const
arr
=
[...
messages
];
const
arr
=
[...
messages
];
return
unique
(
arr
,
function
(
item
,
all
)
{
return
unique
(
arr
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
});
});
}
}
...
@@ -327,7 +327,7 @@ export default {
...
@@ -327,7 +327,7 @@ export default {
state
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]
=
[...
current
];
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
}
=
{};
const
setTimeoutId
:
{
[
key
:
string
]:
number
}
=
{};
return
(
return
(
state
:
ChatStoreState
,
state
:
ChatStoreState
,
...
@@ -734,7 +734,7 @@ export default {
...
@@ -734,7 +734,7 @@ export default {
}
}
commit
(
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
unique
(
newChatMembers
,
function
(
item
,
all
)
{
unique
(
newChatMembers
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
})
})
);
);
...
@@ -838,7 +838,7 @@ export default {
...
@@ -838,7 +838,7 @@ export default {
return
await
Chat
.
getSdk
()
return
await
Chat
.
getSdk
()
.
model
(
currentChat
.
model_name
)
.
model
(
currentChat
.
model_name
)
.
chat
(
currentChat
.
obj_id
,
orgId
())
.
chat
(
currentChat
.
obj_id
,
orgId
())
.
addMember
(
uids
.
map
((
id
)
=>
Number
(
id
)
))
.
addMember
(
uids
.
map
((
id
)
=>
+
id
))
.
finally
(()
=>
dispatch
(
ChatStore
.
ACTION_GET_CHAT_MEMBERS
));
.
finally
(()
=>
dispatch
(
ChatStore
.
ACTION_GET_CHAT_MEMBERS
));
},
},
async
[
ChatStore
.
ACTION_CHAT_REMOVE_MEMBER
](
async
[
ChatStore
.
ACTION_CHAT_REMOVE_MEMBER
](
...
@@ -856,7 +856,7 @@ export default {
...
@@ -856,7 +856,7 @@ export default {
return
await
Chat
.
getSdk
()
return
await
Chat
.
getSdk
()
.
model
(
currentChat
.
model_name
)
.
model
(
currentChat
.
model_name
)
.
chat
(
currentChat
.
obj_id
,
orgId
())
.
chat
(
currentChat
.
obj_id
,
orgId
())
.
removeMember
(
uids
.
map
((
id
)
=>
Number
(
id
)
))
.
removeMember
(
uids
.
map
((
id
)
=>
+
id
))
.
finally
(()
=>
dispatch
(
ChatStore
.
ACTION_GET_CHAT_MEMBERS
));
.
finally
(()
=>
dispatch
(
ChatStore
.
ACTION_GET_CHAT_MEMBERS
));
},
},
async
[
ChatStore
.
ACTION_CHAT_ADD_CS
](
async
[
ChatStore
.
ACTION_CHAT_ADD_CS
](
...
...
store/model.ts
View file @
005ff905
...
@@ -320,9 +320,9 @@ export namespace ChatStore {
...
@@ -320,9 +320,9 @@ export namespace ChatStore {
export
const
ACTION_TERINATE_CHAT
=
"结束会话"
;
export
const
ACTION_TERINATE_CHAT
=
"结束会话"
;
export
type
ACTION_TERINATE_CHAT
=
()
=>
Promise
<
void
>
;
export
type
ACTION_TERINATE_CHAT
=
()
=>
Promise
<
void
>
;
export
const
ACTION_CHAT_ADD_MEMBERS
=
"添加成员"
;
export
const
ACTION_CHAT_ADD_MEMBERS
=
"添加成员"
;
export
type
ACTION_CHAT_ADD_MEMBERS
=
(
uids
:
string
[])
=>
Promise
<
void
>
;
export
type
ACTION_CHAT_ADD_MEMBERS
=
(
uids
:
(
string
|
number
)
[])
=>
Promise
<
void
>
;
export
const
ACTION_CHAT_REMOVE_MEMBER
=
"移除成员"
;
export
const
ACTION_CHAT_REMOVE_MEMBER
=
"移除成员"
;
export
type
ACTION_CHAT_REMOVE_MEMBER
=
(
uids
:
string
[])
=>
Promise
<
void
>
;
export
type
ACTION_CHAT_REMOVE_MEMBER
=
(
uids
:
(
string
|
number
)
[])
=>
Promise
<
void
>
;
export
const
ACTION_CHAT_ADD_CS
=
"添加客服"
;
export
const
ACTION_CHAT_ADD_CS
=
"添加客服"
;
export
type
ACTION_CHAT_ADD_CS
=
(
uids
:
string
[])
=>
Promise
<
void
>
;
export
type
ACTION_CHAT_ADD_CS
=
(
uids
:
string
[])
=>
Promise
<
void
>
;
...
...
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