feat: chat with file function is ready

This commit is contained in:
RockYang
2024-06-27 18:01:49 +08:00
parent 9343c73e0f
commit 6998dd7af4
14 changed files with 329 additions and 75 deletions

View File

@@ -16,7 +16,9 @@
<el-image :src="GetFileIcon(file.ext)" fit="cover" />
</div>
<div class="body">
<div class="title">{{file.name}}</div>
<div class="title">
<el-link :href="file.url" target="_blank" style="--el-font-weight-primary:bold">{{file.name}}</el-link>
</div>
<div class="info">
<span>{{GetFileType(file.ext)}}</span>
<span>{{FormatFileSize(file.size)}}</span>
@@ -121,6 +123,7 @@ onMounted(() => {
</script>
<style lang="stylus">
@import '@/assets/css/markdown/vue.css';
.chat-line-prompt {
background-color #ffffff;
justify-content: center;
@@ -214,11 +217,6 @@ onMounted(() => {
margin 10px 0
}
a {
color #20a0ff
}
p {
line-height 1.5
}

View File

@@ -97,6 +97,7 @@ const reGenerate = (prompt) => {
</script>
<style lang="stylus">
@import '@/assets/css/markdown/vue.css';
.common-layout {
.chat-line-reply {
justify-content: center;
@@ -132,18 +133,12 @@ const reGenerate = (prompt) => {
.content {
min-height 20px;
word-break break-word;
padding: 6px 10px;
padding: 0 10px;
color #374151;
font-size: var(--content-font-size);
border-radius: 5px;
overflow auto;
a {
color #20a0ff
}
// control the image size in content
img {
max-width: 600px;
border-radius: 10px;
@@ -170,10 +165,11 @@ const reGenerate = (prompt) => {
.code-container {
position relative
display flex
.hljs {
border-radius 10px
line-height 1.5
width 100%
}
.copy-code-btn {
@@ -194,7 +190,7 @@ const reGenerate = (prompt) => {
.lang-name {
position absolute;
right 10px
bottom 50px
bottom 20px
padding 2px 6px 4px 6px
background-color #444444
border-radius 10px

View File

@@ -20,6 +20,7 @@
:auto-upload="true"
:show-file-list="false"
:http-request="afterRead"
accept=".doc,.docx,.jpg,.png,.jpeg,.xls,.xlsx,.ppt,.pptx,.pdf"
>
<el-icon class="avatar-uploader-icon">
<Plus/>