2020-04-02 06:58:38 +00:00
|
|
|
<template>
|
|
|
|
<div class="file message-text__wrap" @click="openLink">
|
|
|
|
<div class="icon-wrap">
|
|
|
|
<i class="ion-document-text"></i>
|
|
|
|
</div>
|
|
|
|
<div class="meta">
|
|
|
|
<h5 class="text-block-title">
|
|
|
|
{{ decodeURI(fileName) }}
|
|
|
|
</h5>
|
|
|
|
<a
|
|
|
|
class="download clear button small"
|
|
|
|
rel="noreferrer noopener nofollow"
|
|
|
|
target="_blank"
|
|
|
|
:href="url"
|
|
|
|
>
|
|
|
|
{{ $t('CONVERSATION.DOWNLOAD') }}
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2020-08-01 15:26:47 +00:00
|
|
|
props: {
|
|
|
|
url: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
2020-04-02 06:58:38 +00:00
|
|
|
computed: {
|
|
|
|
fileName() {
|
|
|
|
const filename = this.url.substring(this.url.lastIndexOf('/') + 1);
|
|
|
|
return filename;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
openLink() {
|
2020-08-01 15:26:47 +00:00
|
|
|
const win = window.open(this.url, '_blank', 'noopener');
|
2020-04-02 06:58:38 +00:00
|
|
|
win.focus();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '~dashboard/assets/scss/variables';
|
|
|
|
|
|
|
|
.file {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
2020-05-02 04:17:36 +00:00
|
|
|
padding: $space-smaller 0;
|
2020-04-02 06:58:38 +00:00
|
|
|
cursor: pointer;
|
|
|
|
|
|
|
|
.icon-wrap {
|
|
|
|
font-size: $font-size-giga;
|
2020-05-02 04:17:36 +00:00
|
|
|
color: $color-white;
|
2020-04-02 06:58:38 +00:00
|
|
|
line-height: 1;
|
|
|
|
margin-left: $space-smaller;
|
|
|
|
margin-right: $space-slab;
|
|
|
|
}
|
|
|
|
|
|
|
|
.text-block-title {
|
|
|
|
margin: 0;
|
2020-05-02 04:17:36 +00:00
|
|
|
color: $color-white;
|
|
|
|
font-weight: $font-weight-bold;
|
2020-10-05 07:53:38 +00:00
|
|
|
word-break: break-word;
|
2020-04-02 06:58:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.button {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
2020-05-02 04:17:36 +00:00
|
|
|
color: $color-primary-light;
|
2020-04-02 06:58:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.meta {
|
|
|
|
padding-right: $space-two;
|
|
|
|
}
|
2020-05-02 04:17:36 +00:00
|
|
|
|
|
|
|
.time {
|
|
|
|
min-width: $space-larger;
|
|
|
|
}
|
2020-04-02 06:58:38 +00:00
|
|
|
}
|
|
|
|
</style>
|