Skip to content

Commit

Permalink
Fix upload issue for chat (#23)
Browse files Browse the repository at this point in the history
Co-authored-by: Germey <[email protected]>
  • Loading branch information
Germey and Germey authored Apr 6, 2024
1 parent 89ad558 commit e031760
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 31 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix upload issue",
"packageName": "@acedatacloud/hub",
"email": "[email protected]",
"dependentChangeType": "patch"
}
60 changes: 31 additions & 29 deletions src/components/chat/InputBox.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<template>
<el-upload
v-if="canUpload"
v-model:file-list="fileList"
:class="{
upload: true
}"
:disabled="!canUpload"
name="file"
:show-file-list="true"
:limit="1"
:multiple="false"
:action="uploadUrl"
:on-exceed="onExceed"
:on-error="onError"
:headers="headers"
>
<el-tooltip class="box-item" effect="dark" :content="$t('chat.message.uploadFile')" placement="top">
<span class="btn btn-upload">
<font-awesome-icon icon="fa-solid fa-paperclip" class="icon icon-attachment" />
</span>
</el-tooltip>
</el-upload>
<div class="input-box">
<el-upload
v-model:file-list="fileList"
:class="{
upload: true,
disabled: !canUpload
}"
:disabled="!canUpload"
name="file"
:show-file-list="true"
:limit="1"
:multiple="false"
:action="uploadUrl"
:on-exceed="onExceed"
:on-error="onError"
:headers="headers"
>
<el-tooltip class="box-item" effect="dark" :content="$t('chat.message.uploadFile')" placement="top">
<span class="btn btn-upload">
<font-awesome-icon icon="fa-solid fa-paperclip" class="icon icon-attachment" />
</span>
</el-tooltip>
</el-upload>
<span
:class="{
btn: true,
Expand Down Expand Up @@ -138,6 +138,14 @@ export default defineComponent({
</script>

<style lang="scss">
.upload {
display: flex;
height: 40px;
.el-upload-list {
flex: 1;
}
}
.input-box {
position: relative;
.input {
Expand All @@ -151,11 +159,6 @@ export default defineComponent({
line-height: 30px;
}
}
.el-upload-list {
position: absolute;
width: 400px;
bottom: 45px;
}
.el-textarea.is-disabled .el-textarea__inner {
background-color: initial;
Expand All @@ -171,7 +174,7 @@ export default defineComponent({
background: none;
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
.upload {
display: inline-block;
display: block;
&.disabled {
.btn-upload {
cursor: not-allowed;
Expand All @@ -184,7 +187,6 @@ export default defineComponent({
.input {
border: none;
width: calc(100% - 80px);
margin-left: 30px;
}
.btn {
display: block;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/chat/Conversation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export default defineComponent({
.dialogue {
flex: 1;
overflow-y: scroll;
padding: 20px 0;
margin: 15px 0;
position: relative;
.messages {
padding-top: 30px;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/chatdoc/Conversation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default defineComponent({
.dialogue {
flex: 1;
overflow-y: scroll;
padding: 20px 0;
margin: 15px 0;
position: relative;
.messages {
.message {
Expand Down

0 comments on commit e031760

Please sign in to comment.