文件上传的问题

This commit is contained in:
aixianling
2024-08-23 09:58:01 +08:00
parent 0ff3eaff97
commit 6ad47f207a
3 changed files with 33 additions and 7 deletions

View File

@@ -3,7 +3,10 @@
<div class="chat-wrapper" v-for="item in list" :key="item.id">
<div class="chat-text" :class="{right:item.userType == '0',system:item.userType == '2'}">
<img v-if="item.userType!=2" class="avatar" :src="avatar(item)" alt=""/>
<div class="content" v-html="markdown(item.content)"/>
<div style="max-width: max(calc(100% - 140px), 220px)">
<div class="content" v-html="markdown(item.content)"/>
<div class="attachments pointer el-icon-paperclip" v-if="item.fileName" v-text="item.fileName" @click="handleDownload(item)"/>
</div>
</div>
</div>
</el-scrollbar>
@@ -45,6 +48,9 @@ export default {
},
markdown(v) {
return this.md?.render(v) || v
},
handleDownload(item) {
window.open(item.sdkFileUrl)
}
},
mounted() {
@@ -100,7 +106,6 @@ export default {
.content {
position: relative;
max-width: max(calc(100% - 140px), 220px);
padding: 8px;
border-radius: 4px;
background: #F3F5F7;
@@ -151,6 +156,23 @@ export default {
}
}
}
.attachments {
font-size: 12px;
background: #F0F0F0;
border-radius: 4px;
color: #888;
padding: 3px 6px;
width: fit-content;
margin-top: 4px;
&:hover, &:active {
color: $primaryColor;
}
&:before{
margin-right: 2px;
}
}
}
.avatar {