Commit 1513ed5a by Sixong.Zhu

u

parent 85680f91
<template> <template>
<div class="msg-detail file-message d-flex" @dblclick="openFile"> <div
class="msg-detail file-message d-flex"
@dblclick="openFile"
@click="download"
>
<div <div
class="file-message-info" class="file-message-info"
:class="{ 'd-flex align-items-center': !messageBody.msg.size }" :class="{ 'd-flex align-items-center': !messageBody.msg.size }"
...@@ -15,21 +19,8 @@ ...@@ -15,21 +19,8 @@
{{ format(messageBody.msg.size) }} {{ format(messageBody.msg.size) }}
</div> </div>
</div> </div>
<file-icon :value="fileIcon"></file-icon>
<a <file-icon :value="fileIcon"></file-icon>
class="
d-flex
align-items-center
justify-content-center
download-icon
"
:href="messageRealUrl"
:download="getAttachment"
title="下载文件"
>
<img src="~@/customer-service/imgs/download.png" alt="Download" />
</a>
</div> </div>
</template> </template>
...@@ -65,13 +56,6 @@ ...@@ -65,13 +56,6 @@
@Component({ components: { FileIcon } }) @Component({ components: { FileIcon } })
export default class Index extends BaseMessage { export default class Index extends BaseMessage {
protected get getAttachment() {
if (this.messageBody) {
return this.messageBody.msg.name;
}
return "文件下载";
}
protected get fileIcon() { protected get fileIcon() {
if (this.value) { if (this.value) {
return getFileType(this.messageBody.msg.name); return getFileType(this.messageBody.msg.name);
...@@ -80,6 +64,10 @@ ...@@ -80,6 +64,10 @@
return FileType.Others; return FileType.Others;
} }
private download() {
window.open(this.messageRealUrl);
}
protected format(v: number) { protected format(v: number) {
return formatSize(v); return formatSize(v);
} }
...@@ -92,9 +80,10 @@ ...@@ -92,9 +80,10 @@
<style lang="less" scoped> <style lang="less" scoped>
.file-message { .file-message {
background-color: transparent !important; background-color: #eee !important;
border-radius: 4px !important; border-radius: 6px !important;
border: 1px solid #c5d4e5; cursor: pointer;
.file-message-name { .file-message-name {
max-width: 130px; max-width: 130px;
word-break: break-all; word-break: break-all;
......
...@@ -52,9 +52,6 @@ ...@@ -52,9 +52,6 @@
<style lang="less" scoped> <style lang="less" scoped>
.image-message { .image-message {
background-color: transparent !important;
border-radius: 4px !important;
border: 1px solid #c5d4e5;
line-height: 1; line-height: 1;
max-width: 300px; max-width: 300px;
box-sizing: content-box; box-sizing: content-box;
...@@ -76,11 +73,4 @@ ...@@ -76,11 +73,4 @@
margin-left: 0; margin-left: 0;
} }
} }
.my-message {
&.image-message:not(.image-404) {
background-color: transparent !important;
border-radius: 4px !important;
border: 1px solid #c5d4e5;
}
}
</style> </style>
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