Skip to content

Commit bc85b91

Browse files
style: chat style
1 parent 41131d5 commit bc85b91

File tree

15 files changed

+392
-386
lines changed

15 files changed

+392
-386
lines changed

ui/src/layout/layout-header/avatar/ResetPassword.vue

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<el-dialog
33
v-model="resetPasswordDialog"
44
:title="$t('views.login.resetPassword')"
5+
destroy-on-close
6+
append-to-body
7+
align-center
58
:close-on-click-modal="false"
69
:close-on-press-escape="false"
710
>
@@ -53,12 +56,12 @@ import { useRouter } from 'vue-router'
5356
import { t } from '@/locales'
5457
5558
const props = defineProps<{
56-
emitConfirm?: boolean; // 在父级调接口
59+
emitConfirm?: boolean // 在父级调接口
5760
}>()
5861
5962
const emit = defineEmits<{
60-
(e: 'confirm', value: ResetCurrentUserPasswordRequest): void;
61-
}>();
63+
(e: 'confirm', value: ResetCurrentUserPasswordRequest): void
64+
}>()
6265
6366
const router = useRouter()
6467
const { login } = useStore()
@@ -141,13 +144,13 @@ const open = () => {
141144
}
142145
const resetPassword = () => {
143146
resetPasswordFormRef1.value?.validate().then(() => {
144-
if(props.emitConfirm) {
147+
if (props.emitConfirm) {
145148
emit('confirm', resetPasswordForm.value)
146149
} else {
147150
return UserApi.resetCurrentPassword(resetPasswordForm.value).then(() => {
148-
login.logout()
149-
router.push({ name: 'login' })
150-
})
151+
login.logout()
152+
router.push({ name: 'login' })
153+
})
151154
}
152155
})
153156
}

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default {
44
confirmModification: 'Confirm modification',
55
noHistory: 'No Chat History',
66
createChat: 'New Chat',
7+
clearChat: 'Clear Chat',
78
history: 'Chat History',
89
only20history: 'Showing only the last 20 chats',
910
question_count: 'Questions',
@@ -15,7 +16,7 @@ export default {
1516
passwordValidator: {
1617
title: 'Enter Password to Access',
1718
errorMessage1: 'Password cannot be empty',
18-
errorMessage2: 'Incorrect password'
19+
errorMessage2: 'Incorrect password',
1920
},
2021
operation: {
2122
play: 'Play',
@@ -32,8 +33,10 @@ export default {
3233
tip: {
3334
error500Message: 'Sorry, the service is currently under maintenance. Please try again later!',
3435
errorIdentifyMessage: 'Unable to verify user identity',
35-
errorLimitMessage: 'Sorry, you have reached the maximum number of questions. Please try again tomorrow!',
36-
answerMessage: 'Sorry, no relevant content found. Please rephrase your question or provide more details.',
36+
errorLimitMessage:
37+
'Sorry, you have reached the maximum number of questions. Please try again tomorrow!',
38+
answerMessage:
39+
'Sorry, no relevant content found. Please rephrase your question or provide more details.',
3740
stopAnswer: 'Response Stopped',
3841
answerLoading: 'Generating Response...',
3942
recorderTip: `<p>This feature requires microphone access. Browsers block recording on insecure pages. Solutions:<br/>
@@ -46,12 +49,12 @@ export default {
4649
requiredMessage: 'Please fill in all required fields',
4750
inputParamMessage1: 'Please specify a parameter in the URL',
4851
inputParamMessage2: 'value',
49-
prologueMessage: 'Sorry, the service is currently under maintenance. Please try again later!'
52+
prologueMessage: 'Sorry, the service is currently under maintenance. Please try again later!',
5053
},
5154
inputPlaceholder: {
5255
speaking: 'Speaking...',
5356
recorderLoading: 'Transcribing...',
54-
default: 'Type your question'
57+
default: 'Type your question',
5558
},
5659
uploadFile: {
5760
label: 'Upload File',
@@ -63,7 +66,7 @@ export default {
6366
limitMessage2: 'files',
6467
sizeLimit: 'Each file must not exceed',
6568
imageMessage: 'Please process the image content',
66-
errorMessage: 'Upload Failed'
69+
errorMessage: 'Upload Failed',
6770
},
6871
executionDetails: {
6972
title: 'Execution Details',
@@ -82,18 +85,18 @@ export default {
8285
rerankerResult: 'Re-ranking Results',
8386
paragraph: 'Segment',
8487
noSubmit: 'No submission from user',
85-
errMessage: 'Error Log'
88+
errMessage: 'Error Log',
8689
},
8790
KnowledgeSource: {
8891
title: 'Knowledge Source',
8992
referenceParagraph: 'Cited Segment',
9093
consume: 'Tokens',
91-
consumeTime: 'Runtime'
94+
consumeTime: 'Runtime',
9295
},
9396
paragraphSource: {
9497
title: 'Knowledge Quote',
9598
question: 'User Question',
96-
optimizationQuestion: 'Optimized Question'
99+
optimizationQuestion: 'Optimized Question',
97100
},
98101
editTitle: 'Edit Title',
99102
}

ui/src/locales/lang/zh-CN/ai-chat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default {
44
confirmModification: '确认修改',
55
noHistory: '暂无历史记录',
66
createChat: '新建对话',
7+
clearChat: '清空对话',
78
history: '历史记录',
89
only20history: '仅显示最近 20 条对话',
910
question_count: '条提问',

ui/src/locales/lang/zh-Hant/ai-chat.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default {
44
confirmModification: '確認修改',
55
noHistory: '暫無歷史記錄',
66
createChat: '新建對話',
7+
clearChat: '清空對話',
78
history: '歷史記錄',
89
only20history: '僅顯示最近 20 條對話',
910
question_count: '條提問',
@@ -15,7 +16,7 @@ export default {
1516
passwordValidator: {
1617
title: '請輸入密碼打開連結',
1718
errorMessage1: '密碼不能為空',
18-
errorMessage2: '密碼錯誤'
19+
errorMessage2: '密碼錯誤',
1920
},
2021
operation: {
2122
play: '點擊播放',
@@ -46,12 +47,12 @@ export default {
4647
requiredMessage: '請填寫所有必填欄位',
4748
inputParamMessage1: '請在 URL 中填寫參數',
4849
inputParamMessage2: '的值',
49-
prologueMessage: '抱歉,當前正在維護,無法提供服務,請稍後再試!'
50+
prologueMessage: '抱歉,當前正在維護,無法提供服務,請稍後再試!',
5051
},
5152
inputPlaceholder: {
5253
speaking: '說話中',
5354
recorderLoading: '轉文字中',
54-
default: '請輸入問題'
55+
default: '請輸入問題',
5556
},
5657
uploadFile: {
5758
label: '上傳文件',
@@ -63,7 +64,7 @@ export default {
6364
limitMessage2: '個文件',
6465
sizeLimit: '單個文件大小不能超過',
6566
imageMessage: '請解析圖片內容',
66-
errorMessage: '上傳失敗'
67+
errorMessage: '上傳失敗',
6768
},
6869
executionDetails: {
6970
title: '執行詳細',
@@ -82,18 +83,18 @@ export default {
8283
rerankerResult: '重排結果',
8384
paragraph: '段落',
8485
noSubmit: '用戶未提交',
85-
errMessage: '錯誤日誌'
86+
errMessage: '錯誤日誌',
8687
},
8788
KnowledgeSource: {
8889
title: '知識來源',
8990
referenceParagraph: '引用段落',
9091
consume: '消耗tokens',
91-
consumeTime: '耗時'
92+
consumeTime: '耗時',
9293
},
9394
paragraphSource: {
9495
title: '知識庫引用',
9596
question: '用戶問題',
96-
optimizationQuestion: '優化後問題'
97+
optimizationQuestion: '優化後問題',
9798
},
9899
editTitle: '編輯標題',
99100
}

ui/src/stores/modules/chat-log.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -36,42 +36,6 @@ const useChatLogStore = defineStore('chatLog',{
3636
})
3737
})
3838
},
39-
async asyncGetChatLogClient(id: string, page: pageRequest, loading?: Ref<boolean>) {
40-
return new Promise((resolve, reject) => {
41-
// chatLogApi
42-
// .getChatLogClient(id, page, loading)
43-
// .then((data) => {
44-
// resolve(data)
45-
// })
46-
// .catch((error) => {
47-
// reject(error)
48-
// })
49-
})
50-
},
51-
async asyncDelChatClientLog(id: string, chatId: string, loading?: Ref<boolean>) {
52-
return new Promise((resolve, reject) => {
53-
// chatLogApi
54-
// .delChatClientLog(id, chatId, loading)
55-
// .then((data) => {
56-
// resolve(data)
57-
// })
58-
// .catch((error) => {
59-
// reject(error)
60-
// })
61-
})
62-
},
63-
async asyncPutChatClientLog(id: string, chatId: string, data: any, loading?: Ref<boolean>) {
64-
return new Promise((resolve, reject) => {
65-
// chatLogApi
66-
// .putChatClientLog(id, chatId, data, loading)
67-
// .then((data) => {
68-
// resolve(data)
69-
// })
70-
// .catch((error) => {
71-
// reject(error)
72-
// })
73-
})
74-
}
7539
}
7640
})
7741

File renamed without changes.

ui/src/views/chat/history-component/index.vue renamed to ui/src/views/chat/component/HistoryPanel.vue

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@
3434
</el-button>
3535
<div v-show="!isPcCollapse" class="flex-between p-8 pb-0 color-secondary mt-8">
3636
<span>{{ $t('chat.history') }}</span>
37-
<el-button text>
38-
<el-icon>
39-
<Delete />
40-
</el-icon>
41-
</el-button>
37+
<el-tooltip effect="dark" :content="$t('chat.clearChat')" placement="right">
38+
<!-- // TODO: 清空 -->
39+
<el-button text>
40+
<el-icon>
41+
<Delete />
42+
</el-icon>
43+
</el-button>
44+
</el-tooltip>
4245
</div>
4346
</div>
4447
<div v-show="!isPcCollapse" class="left-height">
@@ -55,7 +58,7 @@
5558
>
5659
<template #default="{ row }">
5760
<div class="flex-between">
58-
<span :title="row.abstract">
61+
<span :title="row.abstract" class="ellipsis" style="max-width: 180px">
5962
{{ row.abstract }}
6063
</span>
6164
<div @click.stop v-show="mouseId === row.id && row.id !== 'new'">
@@ -97,27 +100,40 @@
97100
<AppIcon iconName="app-create-chat"></AppIcon>
98101
<template #title>{{ $t('chat.createChat') }}</template>
99102
</el-menu-item>
103+
100104
<el-sub-menu v-show="isPcCollapse" index="2">
101105
<template #title>
102106
<AppIcon iconName="app-history-outlined" />
103107
</template>
104108
<el-menu-item-group v-loading="leftLoading">
105-
<template #title
106-
><span>{{ $t('chat.history') }}</span></template
107-
>
109+
<template #title>
110+
<div class="flex-between w-full">
111+
<span>{{ $t('chat.history') }}</span>
112+
<el-tooltip effect="dark" :content="$t('chat.clearChat')" placement="right">
113+
<!-- // TODO: 清空 -->
114+
<el-button text>
115+
<el-icon>
116+
<Delete />
117+
</el-icon>
118+
</el-button>
119+
</el-tooltip>
120+
</div>
121+
</template>
108122
<el-menu-item
109123
v-for="row in chatLogData"
110124
:index="row.id"
111125
:key="row.id"
112126
@click="handleClickList(row)"
127+
@mouseenter="mouseenter(row)"
128+
@mouseleave="mouseId = ''"
113129
>
114130
<div class="flex-between w-full lighter">
115-
<span :title="row.abstract">
131+
<span :title="row.abstract" class="ellipsis">
116132
{{ row.abstract }}
117133
</span>
118134
<div @click.stop class="flex" v-show="mouseId === row.id && row.id !== 'new'">
119135
<el-dropdown trigger="click" :teleported="false">
120-
<el-icon class="rotate-90 mt-4">
136+
<el-icon class="mt-4 lighter">
121137
<MoreFilled />
122138
</el-icon>
123139
<template #dropdown>
@@ -161,7 +177,7 @@ const props = defineProps<{
161177
chatLogData: any[]
162178
leftLoading: boolean
163179
currentChatId: string
164-
isPcCollapse: boolean
180+
isPcCollapse?: boolean
165181
}>()
166182
const emit = defineEmits(['newChat', 'clickLog', 'deleteLog', 'refreshFieldTitle'])
167183
@@ -188,8 +204,8 @@ function editLogTitle(row: any) {
188204
EditTitleDialogRef.value.open(row, props.applicationDetail.id)
189205
}
190206
191-
function refreshFieldTitle() {
192-
emit('refreshFieldTitle')
207+
function refreshFieldTitle(chatId: string, abstract: string) {
208+
emit('refreshFieldTitle', chatId, abstract)
193209
}
194210
</script>
195211
<style lang="scss" scoped>
@@ -200,12 +216,17 @@ function refreshFieldTitle() {
200216
background:
201217
linear-gradient(187.61deg, rgba(235, 241, 255, 0.5) 39.6%, rgba(231, 249, 255, 0.5) 94.3%),
202218
#eef1f4;
203-
.el-menu {
219+
:deep(.el-menu) {
204220
background: none;
205221
border: none;
206222
&:not(.el-menu--collapse) {
207223
width: 280px;
208224
}
225+
&.el-menu--collapse {
226+
.el-sub-menu.is-active .el-sub-menu__title {
227+
color: var(--el-text-color-primary) !important;
228+
}
229+
}
209230
}
210231
211232
.left-height {
@@ -237,7 +258,7 @@ function refreshFieldTitle() {
237258
background: transparent;
238259
}
239260
.el-menu-item-group__title {
240-
padding-bottom: 16px;
261+
padding: 8px 8px 8px 16px;
241262
font-weight: 500;
242263
color: var(--app-text-color-secondary);
243264
}
@@ -248,15 +269,14 @@ function refreshFieldTitle() {
248269
padding-left: 8px;
249270
padding-right: 8px;
250271
&:hover {
251-
background-color: #1f23291a;
272+
background-color: rgba(31, 35, 41, 0.1);
252273
}
253274
&.is-active {
254275
background-color: #ffffff;
255-
256276
color: var(--el-text-color-primary);
257-
& > div {
258-
font-weight: 500;
259-
}
277+
// & > div {
278+
// font-weight: 500;
279+
// }
260280
}
261281
}
262282
}

0 commit comments

Comments
 (0)