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
a24581f5
authored
Nov 10, 2021
by
zhousil
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
http://gitlab.corp.qinqinxiaobao.com:9880/uniplat/customer-service
parents
dde9832a
671d3551
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
components/controller/index.ts
store/index.ts
components/controller/index.ts
View file @
a24581f5
...
@@ -27,7 +27,7 @@ export function parserMessage(type: MessageType, rawMsg: string) {
...
@@ -27,7 +27,7 @@ export function parserMessage(type: MessageType, rawMsg: string) {
}
}
const
t
=
mapping
.
get
(
type
)
const
t
=
mapping
.
get
(
type
)
if
(
t
)
{
if
(
t
)
{
return
t
;
return
`[
${
t
}
]`
;
}
}
return
`[系统自动回复]`
;
return
`[系统自动回复]`
;
}
}
store/index.ts
View file @
a24581f5
...
@@ -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
);
});
});
}
}
...
@@ -334,7 +334,7 @@ export default {
...
@@ -334,7 +334,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
,
...
@@ -393,6 +393,8 @@ export default {
...
@@ -393,6 +393,8 @@ export default {
async
[
ChatStore
.
ACTION_GET_MY_CHAT_LIST
]({
commit
,
state
})
{
async
[
ChatStore
.
ACTION_GET_MY_CHAT_LIST
]({
commit
,
state
})
{
let
cache
=
await
dbController
.
getChatList
();
let
cache
=
await
dbController
.
getChatList
();
cache
.
sort
((
x
,
y
)
=>
(
x
.
last_msg_ts
<
y
.
last_msg_ts
?
1
:
-
1
));
for
(
const
item
of
cache
)
{
for
(
const
item
of
cache
)
{
if
(
item
.
business_data
&&
!
item
.
detail_name
)
{
if
(
item
.
business_data
&&
!
item
.
detail_name
)
{
const
d
=
JSON
.
parse
(
const
d
=
JSON
.
parse
(
...
@@ -836,7 +838,7 @@ export default {
...
@@ -836,7 +838,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
);
})
})
);
);
...
@@ -1054,16 +1056,25 @@ export default {
...
@@ -1054,16 +1056,25 @@ export default {
if
(
cache
[
id
])
{
if
(
cache
[
id
])
{
return
Promise
.
resolve
({
id
,
name
:
cache
[
id
]
});
return
Promise
.
resolve
({
id
,
name
:
cache
[
id
]
});
}
}
return
new
Promise
<
{
id
:
string
;
name
:
string
}
>
((
resolve
,
reject
)
=>
{
return
new
Promise
<
{
id
:
string
;
name
:
string
}
>
(
Chat
.
getSdk
().
model
(
"user"
)
(
resolve
,
reject
)
=>
{
Chat
.
getSdk
()
.
model
(
"user"
)
.
detail
(
id
)
.
detail
(
id
)
.
query
()
.
query
()
.
then
((
userInfo
:
any
)
=>
{
.
then
((
userInfo
:
any
)
=>
{
const
name
=
userInfo
.
row
.
first_name
.
display
as
string
;
const
name
=
userInfo
.
row
.
first_name
Vue
.
set
(
state
[
ChatStore
.
STATE_CHAT_USERNAME
],
id
,
name
);
.
display
as
string
;
Vue
.
set
(
state
[
ChatStore
.
STATE_CHAT_USERNAME
],
id
,
name
);
resolve
({
id
,
name
});
resolve
({
id
,
name
});
}).
catch
(
reject
);
})
});
.
catch
(
reject
);
}
);
},
},
},
},
getters
:
{
getters
:
{
...
...
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