Commit f4f3f12f by zhousil
parents 26880254 9cfd8764
...@@ -65,14 +65,14 @@ ...@@ -65,14 +65,14 @@
@Component({ components: { FileIcon } }) @Component({ components: { FileIcon } })
export default class Index extends BaseMessage { export default class Index extends BaseMessage {
private get getAttachment() { protected get getAttachment() {
if (this.messageBody) { if (this.messageBody) {
return this.messageBody.msg.name; return this.messageBody.msg.name;
} }
return "文件下载"; return "文件下载";
} }
private get fileIcon() { protected get fileIcon() {
if (this.value) { if (this.value) {
return getFileType(this.messageBody.msg.name); return getFileType(this.messageBody.msg.name);
} }
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
return FileType.Others; return FileType.Others;
} }
private format(v: number) { protected format(v: number) {
return formatSize(v); return formatSize(v);
} }
...@@ -97,6 +97,7 @@ ...@@ -97,6 +97,7 @@
border: 1px solid #c5d4e5; border: 1px solid #c5d4e5;
.file-message-name { .file-message-name {
max-width: 130px; max-width: 130px;
word-break: break-all;
} }
} }
</style> </style>
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<div <div
class="msg-detail image-message" class="msg-detail image-message"
:class="{ 'image-404': fileFailed2Load }" :class="{ 'image-404': fileFailed2Load }"
@dblclick="openFile" @dblclick="dbClick"
@click="open"
> >
<img <img
v-if="messageRealUrl" v-if="messageRealUrl"
...@@ -20,11 +21,16 @@ ...@@ -20,11 +21,16 @@
import { FileType } from "./file-controller"; import { FileType } from "./file-controller";
import BaseMessage from "./index"; import BaseMessage from "./index";
import FileIcon from "./file-icon.vue"; import FileIcon from "./file-icon.vue";
import { UserAgentHelper } from "@/customer-service/third-party/user-agent";
@Component({ components: { FileIcon } }) @Component({ components: { FileIcon } })
export default class Index extends BaseMessage { export default class Index extends BaseMessage {
private readonly image404 = FileType.Image_404; private readonly image404 = FileType.Image_404;
private readonly mobile = UserAgentHelper.isMobile(
window.navigator.userAgent
);
private onImageError() { private onImageError() {
this.fileFailed2Load = true; this.fileFailed2Load = true;
this.messageRealUrl = ""; this.messageRealUrl = "";
...@@ -33,6 +39,14 @@ ...@@ -33,6 +39,14 @@
mounted() { mounted() {
this.buildMessageUrl(); this.buildMessageUrl();
} }
private dbClick() {
!this.mobile && this.openFile();
}
private open() {
this.mobile && this.openFile();
}
} }
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment