Skip to content

Commit 761b686

Browse files
fix: refine chat document and image layout,and some translation issues (#2177)
* fix: Rrefine english words * fix: refine chat document and image layout,and some translation issues --------- Co-authored-by: wangdan-fit2cloud <[email protected]>
1 parent 96c79f4 commit 761b686

File tree

6 files changed

+38
-43
lines changed

6 files changed

+38
-43
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
v-for="(item, index) in uploadDocumentList"
2020
:key="index"
2121
:xs="24"
22-
:sm="12"
23-
:md="12"
24-
:lg="12"
25-
:xl="12"
22+
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
23+
:md="props.type === 'debug-ai-chat' ? 24 : 12"
24+
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
25+
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
2626
class="mb-8"
2727
>
2828
<el-card
@@ -54,10 +54,10 @@
5454

5555
<el-col
5656
:xs="24"
57-
:sm="12"
58-
:md="12"
59-
:lg="12"
60-
:xl="12"
57+
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
58+
:md="props.type === 'debug-ai-chat' ? 24 : 12"
59+
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
60+
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
6161
class="mb-8"
6262
v-for="(item, index) in uploadAudioList"
6363
:key="index"
@@ -85,10 +85,10 @@
8585
</el-card>
8686
</el-col>
8787
</el-row>
88-
<div class="flex">
88+
<el-space wrap>
8989
<template v-for="(item, index) in uploadImageList" :key="index">
9090
<div
91-
class="file cursor border border-r-4 mr-8"
91+
class="file cursor border border-r-4"
9292
v-if="item.url"
9393
@mouseenter.stop="mouseenter(item)"
9494
@mouseleave.stop="mouseleave()"
@@ -111,7 +111,7 @@
111111
/>
112112
</div>
113113
</template>
114-
</div>
114+
</el-space>
115115
</div>
116116
</el-scrollbar>
117117
<div class="flex">

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

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
v-for="(item, index) in document_list"
2222
:key="index"
2323
:xs="24"
24-
:sm="12"
25-
:md="12"
26-
:lg="12"
27-
:xl="12"
24+
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
25+
:md="props.type === 'debug-ai-chat' ? 24 : 12"
26+
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
27+
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
2828
class="mb-8 w-full"
2929
>
3030
<el-card shadow="never" style="--el-card-padding: 8px" class="download-file cursor">
@@ -45,17 +45,8 @@
4545
</el-row>
4646
</div>
4747
<div class="mb-8" v-if="image_list.length">
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-
>
48+
<el-space wrap>
49+
<template v-for="(item, index) in image_list" :key="index">
5950
<div class="file cursor border-r-4" v-if="item.url">
6051
<el-image
6152
:src="item.url"
@@ -70,19 +61,19 @@
7061
class="border-r-4"
7162
/>
7263
</div>
73-
</el-col>
74-
</el-row>
64+
</template>
65+
</el-space>
7566
</div>
7667
<div class="mb-8" v-if="audio_list.length">
7768
<el-row :gutter="10">
7869
<el-col
7970
v-for="(item, index) in audio_list"
8071
:key="index"
8172
:xs="24"
82-
:sm="12"
83-
:md="12"
84-
:lg="12"
85-
:xl="12"
73+
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
74+
:md="props.type === 'debug-ai-chat' ? 24 : 12"
75+
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
76+
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
8677
class="mb-8"
8778
>
8879
<div class="file cursor border-r-4" v-if="item.url">
@@ -109,6 +100,7 @@ import { onMounted, computed } from 'vue'
109100
const props = defineProps<{
110101
application: any
111102
chatRecord: chatType
103+
type: 'log' | 'ai-chat' | 'debug-ai-chat'
112104
}>()
113105
const document_list = computed(() => {
114106
if (props.chatRecord?.upload_meta) {
@@ -163,7 +155,6 @@ onMounted(() => {})
163155
}
164156
}
165157
166-
167158
.download-button {
168159
display: none;
169160
}

ui/src/components/ai-chat/index.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818

1919
<template v-for="(item, index) in chatList" :key="index">
2020
<!-- 问题 -->
21-
<QuestionContent :application="applicationDetails" :chat-record="item"></QuestionContent>
21+
<QuestionContent
22+
:type="type"
23+
:application="applicationDetails"
24+
:chat-record="item"
25+
></QuestionContent>
2226
<!-- 回答 -->
2327
<AnswerContent
2428
:application="applicationDetails"

ui/src/components/login-layout/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const changeLang = (lang: string) => {
5454
}
5555
5656
const currentLanguage = computed(() => {
57-
return langList.value?.filter((v: any) => v.value === user.getLanguage())[0].label
57+
return langList.value?.filter((v: any) => v.value === user.getLanguage())?.[0]?.label
5858
})
5959
6060
const fileURL = computed(() => {

ui/src/locales/lang/en-US/ai-chat.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export default {
22
noHistory: 'No Chat History',
3-
createChat: 'New Conversation',
3+
createChat: 'New Chat',
44
history: 'Chat History',
5-
only20history: 'Showing only the last 20 conversations',
5+
only20history: 'Showing only the last 20 chats',
66
question_count: 'Questions',
77
exportRecords: 'Export Chat History',
88
chatId: 'Chat ID',
@@ -68,7 +68,7 @@ export default {
6868
searchContent: 'Search Query',
6969
searchResult: 'Search Results',
7070
conditionResult: 'Condition Evaluation',
71-
currentChat: 'Current Conversation',
71+
currentChat: 'Current Chat',
7272
answer: 'AI Response',
7373
replyContent: 'Reply Content',
7474
textContent: 'Text Content',

ui/src/locales/lang/en-US/views/application.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,17 @@ export default {
9393
},
9494

9595
voiceInput: {
96-
label: 'Voice input',
96+
label: 'Voice Input',
9797
placeholder: 'Please select a speech recognition model',
9898
requiredMessage: 'Please select a speech input model',
99-
autoSend: 'Automatic sending'
99+
autoSend: 'Automatic Sending'
100100
},
101101
voicePlay: {
102-
label: 'Voice playback',
102+
label: 'Voice Playback',
103103
placeholder: 'Please select a speech synthesis model',
104104
requiredMessage: 'Please select a speech playback model',
105-
autoPlay: 'Automatic playback',
106-
browser: 'Browser playback (free)',
105+
autoPlay: 'Automatic Playback',
106+
browser: 'Browser Playback (free)',
107107
tts: 'TTS Model',
108108
listeningTest: 'Preview'
109109
},

0 commit comments

Comments
 (0)