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
f4f3f12f
authored
Nov 04, 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
26880254
9cfd8764
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
4 deletions
components/message-item/file-message.vue
components/message-item/image-message.vue
components/message-item/file-message.vue
View file @
f4f3f12f
...
...
@@ -65,14 +65,14 @@
@
Component
({
components
:
{
FileIcon
}
})
export
default
class
Index
extends
BaseMessage
{
pr
ivate
get
getAttachment
()
{
pr
otected
get
getAttachment
()
{
if
(
this
.
messageBody
)
{
return
this
.
messageBody
.
msg
.
name
;
}
return
"文件下载"
;
}
pr
ivate
get
fileIcon
()
{
pr
otected
get
fileIcon
()
{
if
(
this
.
value
)
{
return
getFileType
(
this
.
messageBody
.
msg
.
name
);
}
...
...
@@ -80,7 +80,7 @@
return
FileType
.
Others
;
}
pr
ivate
format
(
v
:
number
)
{
pr
otected
format
(
v
:
number
)
{
return
formatSize
(
v
);
}
...
...
@@ -97,6 +97,7 @@
border
:
1px
solid
#c5d4e5
;
.file-message-name
{
max-width
:
130px
;
word-break
:
break-all
;
}
}
</
style
>
components/message-item/image-message.vue
View file @
f4f3f12f
...
...
@@ -2,7 +2,8 @@
<div
class=
"msg-detail image-message"
:class=
"
{ 'image-404': fileFailed2Load }"
@dblclick="openFile"
@dblclick="dbClick"
@click="open"
>
<img
v-if=
"messageRealUrl"
...
...
@@ -20,11 +21,16 @@
import
{
FileType
}
from
"./file-controller"
;
import
BaseMessage
from
"./index"
;
import
FileIcon
from
"./file-icon.vue"
;
import
{
UserAgentHelper
}
from
"@/customer-service/third-party/user-agent"
;
@
Component
({
components
:
{
FileIcon
}
})
export
default
class
Index
extends
BaseMessage
{
private
readonly
image404
=
FileType
.
Image_404
;
private
readonly
mobile
=
UserAgentHelper
.
isMobile
(
window
.
navigator
.
userAgent
);
private
onImageError
()
{
this
.
fileFailed2Load
=
true
;
this
.
messageRealUrl
=
""
;
...
...
@@ -33,6 +39,14 @@
mounted
()
{
this
.
buildMessageUrl
();
}
private
dbClick
()
{
!
this
.
mobile
&&
this
.
openFile
();
}
private
open
()
{
this
.
mobile
&&
this
.
openFile
();
}
}
</
script
>
...
...
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