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
39bbc202
authored
Oct 21, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
cs
parent
474ad190
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
components/chat-list.vue
components/controller/chat-list.ts
components/message-list.vue
service/upload.ts
components/chat-list.vue
View file @
39bbc202
This diff is collapsed.
Click to expand it.
components/controller/chat-list.ts
View file @
39bbc202
...
...
@@ -3,6 +3,7 @@ import { parserMessage } from ".";
import
{
chatStore
,
ChatStore
}
from
"@/customer-service/store/model"
;
import
{
formatTime
,
TimeFormatRule
}
from
"@/customer-service/utils/time"
;
import
{
Chat
as
ChatItem
}
from
"@/customer-service/xim/models/chat"
;
import
Xim
from
"@/customer-service/xim"
;
@
Component
({
components
:
{}
})
export
default
class
ChatList
extends
Vue
{
...
...
@@ -48,11 +49,13 @@ export default class ChatList extends Vue {
@
chatStore
.
Action
(
ChatStore
.
ACTION_CLEAR_CURRENT_CHAT_DATA
)
protected
readonly
reset
!
:
ChatStore
.
ACTION_CLEAR_CURRENT_CHAT_DATA
;
private
readonly
invoker
=
Xim
.
getSdk
();
protected
parseMesage
(
data
:
ChatItem
)
{
if
(
data
.
last_msg_sender
&&
data
.
last_msg_sender
!==
"0"
)
{
if
(
!
this
.
userNames
[
data
.
last_msg_sender
])
{
this
.
updateUserName
({
id
:
data
.
last_msg_sender
,
name
:
""
});
this
.
sdk
this
.
invoker
.
model
(
"user"
)
.
detail
(
data
.
last_msg_sender
)
.
query
()
...
...
@@ -62,7 +65,7 @@ export default class ChatList extends Vue {
name
:
userInfo
.
row
.
first_name
.
display
as
string
,
});
})
.
catch
(()
=>
{});
.
catch
(()
=>
{
});
}
}
if
(
data
.
last_msg_content
===
""
)
{
...
...
components/message-list.vue
View file @
39bbc202
This diff is collapsed.
Click to expand it.
service/upload.ts
View file @
39bbc202
import
Vue
from
"vue"
;
import
{
UniplatSdk
}
from
"uniplat-sdk"
const
orgId
=
()
=>
Vue
.
prototype
.
global
.
org
?.
id
??
"0"
;
import
Chat
from
"@/customer-service/xim"
;
export
async
function
uploadFile
(
file
:
File
)
{
let
{
url
}
=
await
(
Vue
.
prototype
.
sdk
as
UniplatSdk
).
uploadFileV2
(
file
)
const
realUrl
=
`
${
Vue
.
prototype
.
sdk
.
global
.
baseUrl
}${
url
}
`
;
return
realUrl
;
const
sdk
=
Chat
.
getSdk
();
let
{
url
}
=
await
sdk
.
uploadFileV2
(
file
)
return
`
${
sdk
.
global
.
baseUrl
}${
url
}
`
;
}
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