Skip to content

Commit a9797ca

Browse files
perf: upload file count(#2029)
1 parent 47bcb7f commit a9797ca

File tree

2 files changed

+84
-31
lines changed

2 files changed

+84
-31
lines changed

ui/src/components/ai-chat/component/chat-input-operate/index.vue

+44-14
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,22 @@
1414
uploadVideoList.length
1515
"
1616
>
17-
<el-space wrap>
18-
<template v-for="(item, index) in uploadDocumentList" :key="index">
19-
<el-card shadow="never" style="--el-card-padding: 8px" class="file cursor">
17+
<el-row :gutter="10">
18+
<el-col
19+
v-for="(item, index) in uploadDocumentList"
20+
:key="index"
21+
:xs="24"
22+
:sm="12"
23+
:md="12"
24+
:lg="12"
25+
:xl="12"
26+
class="mb-8"
27+
>
28+
<el-card
29+
shadow="never"
30+
style="--el-card-padding: 8px; max-width: 100%"
31+
class="file cursor"
32+
>
2033
<div
2134
class="flex align-center"
2235
@mouseenter.stop="mouseenter(item)"
@@ -32,13 +45,22 @@
3245
</el-icon>
3346
</div>
3447
<img :src="getImgUrl(item && item?.name)" alt="" width="24" />
35-
<div class="ml-4 ellipsis" style="max-width: 160px" :title="item && item?.name">
48+
<div class="ml-4 ellipsis-1" :title="item && item?.name">
3649
{{ item && item?.name }}
3750
</div>
3851
</div>
3952
</el-card>
40-
</template>
41-
<template v-for="(item, index) in uploadImageList" :key="index">
53+
</el-col>
54+
<el-col
55+
:xs="24"
56+
:sm="12"
57+
:md="12"
58+
:lg="12"
59+
:xl="12"
60+
class="mb-8"
61+
v-for="(item, index) in uploadImageList"
62+
:key="index"
63+
>
4264
<div
4365
class="file cursor border border-r-4"
4466
v-if="item.url"
@@ -62,8 +84,17 @@
6284
class="border-r-4"
6385
/>
6486
</div>
65-
</template>
66-
<template v-for="(item, index) in uploadAudioList" :key="index">
87+
</el-col>
88+
<el-col
89+
:xs="24"
90+
:sm="12"
91+
:md="12"
92+
:lg="12"
93+
:xl="12"
94+
class="mb-8"
95+
v-for="(item, index) in uploadAudioList"
96+
:key="index"
97+
>
6798
<el-card shadow="never" style="--el-card-padding: 8px" class="file cursor">
6899
<div
69100
class="flex align-center"
@@ -80,13 +111,13 @@
80111
</el-icon>
81112
</div>
82113
<img :src="getImgUrl(item && item?.name)" alt="" width="24" />
83-
<div class="ml-4 ellipsis" style="max-width: 160px" :title="item && item?.name">
114+
<div class="ml-4 ellipsis-1" :title="item && item?.name">
84115
{{ item && item?.name }}
85116
</div>
86117
</div>
87118
</el-card>
88-
</template>
89-
</el-space>
119+
</el-col>
120+
</el-row>
90121
</div>
91122
</el-scrollbar>
92123
<div class="flex">
@@ -119,8 +150,7 @@
119150
<el-tooltip effect="dark" placement="top" popper-class="upload-tooltip-width">
120151
<template #content>
121152
<div class="break-all pre-wrap">
122-
{{ $t('chat.uploadFile.label') }}:{{
123-
$t('chat.uploadFile.most')
153+
{{ $t('chat.uploadFile.label') }}:{{ $t('chat.uploadFile.most')
124154
}}{{ props.applicationDetails.file_upload_setting.maxFiles
125155
}}{{ $t('chat.uploadFile.limit') }}
126156
{{ props.applicationDetails.file_upload_setting.fileLimit }}MB<br />{{
@@ -191,7 +221,7 @@ import { t } from '@/locales'
191221
const router = useRouter()
192222
const route = useRoute()
193223
const {
194-
query: { mode, question },
224+
query: { mode, question }
195225
} = route as any
196226
const quickInputRef = ref()
197227
const props = withDefaults(

ui/src/components/ai-chat/component/question-content/index.vue

+40-17
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,17 @@
1616
<div class="content">
1717
<div class="text break-all pre-wrap">
1818
<div class="mb-8" v-if="document_list.length">
19-
<el-space wrap>
20-
<template v-for="(item, index) in document_list" :key="index">
19+
<el-row :gutter="10">
20+
<el-col
21+
v-for="(item, index) in document_list"
22+
:key="index"
23+
:xs="24"
24+
:sm="12"
25+
:md="12"
26+
:lg="12"
27+
:xl="12"
28+
class="mb-8 w-full"
29+
>
2130
<el-card shadow="never" style="--el-card-padding: 8px" class="download-file cursor">
2231
<div class="download-button flex align-center" @click="downloadFile(item)">
2332
<el-icon class="mr-4">
@@ -27,17 +36,26 @@
2736
</div>
2837
<div class="show flex align-center">
2938
<img :src="getImgUrl(item && item?.name)" alt="" width="24" />
30-
<div class="ml-4 ellipsis" style="max-width: 150px" :title="item && item?.name">
39+
<div class="ml-4 ellipsis-1" :title="item && item?.name">
3140
{{ item && item?.name }}
3241
</div>
3342
</div>
3443
</el-card>
35-
</template>
36-
</el-space>
44+
</el-col>
45+
</el-row>
3746
</div>
3847
<div class="mb-8" v-if="image_list.length">
39-
<el-space wrap>
40-
<template v-for="(item, index) in image_list" :key="index">
48+
<el-row :gutter="10">
49+
<el-col
50+
v-for="(item, index) in image_list"
51+
:key="index"
52+
:xs="24"
53+
:sm="12"
54+
:md="12"
55+
:lg="12"
56+
:xl="12"
57+
class="mb-8"
58+
>
4159
<div class="file cursor border-r-4" v-if="item.url">
4260
<el-image
4361
:src="item.url"
@@ -52,12 +70,21 @@
5270
class="border-r-4"
5371
/>
5472
</div>
55-
</template>
56-
</el-space>
73+
</el-col>
74+
</el-row>
5775
</div>
5876
<div class="mb-8" v-if="audio_list.length">
59-
<el-space wrap>
60-
<template v-for="(item, index) in audio_list" :key="index">
77+
<el-row :gutter="10">
78+
<el-col
79+
v-for="(item, index) in audio_list"
80+
:key="index"
81+
:xs="24"
82+
:sm="12"
83+
:md="12"
84+
:lg="12"
85+
:xl="12"
86+
class="mb-8"
87+
>
6188
<div class="file cursor border-r-4" v-if="item.url">
6289
<audio
6390
:src="item.url"
@@ -66,8 +93,8 @@
6693
class="border-r-4"
6794
/>
6895
</div>
69-
</template>
70-
</el-space>
96+
</el-col>
97+
</el-row>
7198
</div>
7299
{{ chatRecord.problem_text }}
73100
</div>
@@ -119,7 +146,6 @@ onMounted(() => {})
119146
</script>
120147
<style lang="scss" scoped>
121148
.download-file {
122-
width: 200px;
123149
height: 43px;
124150
125151
&:hover {
@@ -137,9 +163,6 @@ onMounted(() => {})
137163
}
138164
}
139165
140-
.show {
141-
display: block;
142-
}
143166
144167
.download-button {
145168
display: none;

0 commit comments

Comments
 (0)