Skip to content

Commit

Permalink
fix: refine chat document and image layout,and some translation issues (
Browse files Browse the repository at this point in the history
#2177)

* fix: Rrefine english words

* fix: refine chat document and image layout,and some translation issues

---------

Co-authored-by: wangdan-fit2cloud <dan.wang@fit2cloud.com>
  • Loading branch information
shaohuzhang1 and wangdan-fit2cloud authored Feb 9, 2025
1 parent 96c79f4 commit 761b686
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 43 deletions.
22 changes: 11 additions & 11 deletions ui/src/components/ai-chat/component/chat-input-operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
v-for="(item, index) in uploadDocumentList"
:key="index"
:xs="24"
:sm="12"
:md="12"
:lg="12"
:xl="12"
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
:md="props.type === 'debug-ai-chat' ? 24 : 12"
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
class="mb-8"
>
<el-card
Expand Down Expand Up @@ -54,10 +54,10 @@

<el-col
:xs="24"
:sm="12"
:md="12"
:lg="12"
:xl="12"
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
:md="props.type === 'debug-ai-chat' ? 24 : 12"
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
class="mb-8"
v-for="(item, index) in uploadAudioList"
:key="index"
Expand Down Expand Up @@ -85,10 +85,10 @@
</el-card>
</el-col>
</el-row>
<div class="flex">
<el-space wrap>
<template v-for="(item, index) in uploadImageList" :key="index">
<div
class="file cursor border border-r-4 mr-8"
class="file cursor border border-r-4"
v-if="item.url"
@mouseenter.stop="mouseenter(item)"
@mouseleave.stop="mouseleave()"
Expand All @@ -111,7 +111,7 @@
/>
</div>
</template>
</div>
</el-space>
</div>
</el-scrollbar>
<div class="flex">
Expand Down
35 changes: 13 additions & 22 deletions ui/src/components/ai-chat/component/question-content/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
v-for="(item, index) in document_list"
:key="index"
:xs="24"
:sm="12"
:md="12"
:lg="12"
:xl="12"
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
:md="props.type === 'debug-ai-chat' ? 24 : 12"
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
class="mb-8 w-full"
>
<el-card shadow="never" style="--el-card-padding: 8px" class="download-file cursor">
Expand All @@ -45,17 +45,8 @@
</el-row>
</div>
<div class="mb-8" v-if="image_list.length">
<el-row :gutter="10">
<el-col
v-for="(item, index) in image_list"
:key="index"
:xs="24"
:sm="12"
:md="12"
:lg="12"
:xl="12"
class="mb-8"
>
<el-space wrap>
<template v-for="(item, index) in image_list" :key="index">
<div class="file cursor border-r-4" v-if="item.url">
<el-image
:src="item.url"
Expand All @@ -70,19 +61,19 @@
class="border-r-4"
/>
</div>
</el-col>
</el-row>
</template>
</el-space>
</div>
<div class="mb-8" v-if="audio_list.length">
<el-row :gutter="10">
<el-col
v-for="(item, index) in audio_list"
:key="index"
:xs="24"
:sm="12"
:md="12"
:lg="12"
:xl="12"
:sm="props.type === 'debug-ai-chat' ? 24 : 12"
:md="props.type === 'debug-ai-chat' ? 24 : 12"
:lg="props.type === 'debug-ai-chat' ? 24 : 12"
:xl="props.type === 'debug-ai-chat' ? 24 : 12"
class="mb-8"
>
<div class="file cursor border-r-4" v-if="item.url">
Expand All @@ -109,6 +100,7 @@ import { onMounted, computed } from 'vue'
const props = defineProps<{
application: any
chatRecord: chatType
type: 'log' | 'ai-chat' | 'debug-ai-chat'
}>()
const document_list = computed(() => {
if (props.chatRecord?.upload_meta) {
Expand Down Expand Up @@ -163,7 +155,6 @@ onMounted(() => {})
}
}
.download-button {
display: none;
}
Expand Down
6 changes: 5 additions & 1 deletion ui/src/components/ai-chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@

<template v-for="(item, index) in chatList" :key="index">
<!-- 问题 -->
<QuestionContent :application="applicationDetails" :chat-record="item"></QuestionContent>
<QuestionContent
:type="type"
:application="applicationDetails"
:chat-record="item"
></QuestionContent>
<!-- 回答 -->
<AnswerContent
:application="applicationDetails"
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/login-layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const changeLang = (lang: string) => {
}
const currentLanguage = computed(() => {
return langList.value?.filter((v: any) => v.value === user.getLanguage())[0].label
return langList.value?.filter((v: any) => v.value === user.getLanguage())?.[0]?.label
})
const fileURL = computed(() => {
Expand Down
6 changes: 3 additions & 3 deletions ui/src/locales/lang/en-US/ai-chat.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
export default {
noHistory: 'No Chat History',
createChat: 'New Conversation',
createChat: 'New Chat',
history: 'Chat History',
only20history: 'Showing only the last 20 conversations',
only20history: 'Showing only the last 20 chats',
question_count: 'Questions',
exportRecords: 'Export Chat History',
chatId: 'Chat ID',
Expand Down Expand Up @@ -68,7 +68,7 @@ export default {
searchContent: 'Search Query',
searchResult: 'Search Results',
conditionResult: 'Condition Evaluation',
currentChat: 'Current Conversation',
currentChat: 'Current Chat',
answer: 'AI Response',
replyContent: 'Reply Content',
textContent: 'Text Content',
Expand Down
10 changes: 5 additions & 5 deletions ui/src/locales/lang/en-US/views/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ export default {
},

voiceInput: {
label: 'Voice input',
label: 'Voice Input',
placeholder: 'Please select a speech recognition model',
requiredMessage: 'Please select a speech input model',
autoSend: 'Automatic sending'
autoSend: 'Automatic Sending'
},
voicePlay: {
label: 'Voice playback',
label: 'Voice Playback',
placeholder: 'Please select a speech synthesis model',
requiredMessage: 'Please select a speech playback model',
autoPlay: 'Automatic playback',
browser: 'Browser playback (free)',
autoPlay: 'Automatic Playback',
browser: 'Browser Playback (free)',
tts: 'TTS Model',
listeningTest: 'Preview'
},
Expand Down

0 comments on commit 761b686

Please sign in to comment.