Commit 4a34607d authored by shirlyn.guo's avatar shirlyn.guo 🤡

chore: 多语言&命名规范

parent 6e48b547
......@@ -72,6 +72,7 @@ common_module:
close: '关'
delete_tip_title: '删除提示'
wipe_data: '清空数据'
delete_all_tip_title: '清空数据提示'
dialogue_module:
continue_question_message: '你可以继续提问'
......@@ -253,6 +254,7 @@ personal_space_module:
memory_fragment_content: '记录聊天对话中所有关于用户信息、用户偏好、用户计划的记忆片段。'
memory_variable_delete_tip_content: '删除后不可撤销。如应用已发布,更新发布后该应用的用户无法使用该记忆变量,是否继续?'
memory_fragment_delete_all_tip_content: '数据清空后不可撤销,确定要全部清空吗?'
memory_fragment_delete_row_tip_content: '数据删除后不可撤销,确定要删除吗?'
memory_variable_modal:
edit_memory_variable: '编辑记忆变量'
......
......@@ -72,6 +72,7 @@ common_module:
close: '關'
delete_tip_title: '删除提示'
wipe_data: '清空數據'
delete_all_tip_title: '清空數據提示'
dialogue_module:
continue_question_message: '你可以繼續提問'
......@@ -253,6 +254,7 @@ personal_space_module:
memory_fragment_content: '記錄聊天對話中所有關於用戶資訊、用戶偏好、用戶計畫的記憶片段。'
memory_variable_delete_tip_content: '删除後不可撤銷。 如應用已發佈,更新發佈後該應用的用戶無法使用該記憶變數,是否繼續?'
memory_fragment_delete_all_tip_content: '數據清空後不可撤銷,確定要全部清空嗎?'
memory_fragment_delete_row_tip_content: '數據删除後不可撤銷,確定要删除嗎?'
memory_variable_modal:
edit_memory_variable: '編輯記憶變數'
......
......@@ -117,7 +117,7 @@ function handleOpenMemoryPreviewModal(MemoryTabName: string) {
>
<n-popover placement="bottom" trigger="hover" class="p-[4px]!" :show-arrow="false">
<template #trigger>
<div class="flex items-center justify-center px-5 text-[14px]">
<div class="flex items-center justify-center pl-5 text-[14px]">
<Brain theme="outline" size="16" fill="#333" />
<div class="mx-[4px]">
{{ t('personal_space_module.agent_module.agent_setting_module.agent_config_module.memory') }}
......
......@@ -619,7 +619,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
theme="outline"
size="15"
fill="#333"
:stroke-width="2"
:stroke-width="3"
class="ml-1 cursor-pointer text-base text-[#999] outline-none"
/>
</template>
......@@ -668,7 +668,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
theme="outline"
size="15"
fill="#333"
:stroke-width="2"
:stroke-width="3"
class="ml-1 cursor-pointer text-base text-[#999] outline-none"
/>
</template>
......@@ -719,7 +719,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
theme="outline"
size="15"
fill="#333"
:stroke-width="2"
:stroke-width="3"
class="ml-1 cursor-pointer text-base text-[#999] outline-none"
/>
</template>
......@@ -871,7 +871,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
theme="outline"
size="15"
fill="#333"
:stroke-width="2"
:stroke-width="3"
class="ml-1 cursor-pointer text-base text-[#999] outline-none"
/>
</template>
......@@ -1010,7 +1010,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
}}</span>
<n-popover trigger="hover" placement="top-start" class="p-[12px]! left-[-120px]!" :show-arrow="false">
<template #trigger>
<Help theme="outline" size="15" fill="#333" :stroke-width="2" class="mt-[2px]" />
<Help theme="outline" size="15" fill="#333" :stroke-width="3" class="mt-[2px]" />
</template>
<div class="w-[650px] text-[14px]">
<div class="m-w-[100%] mb-[16px] mt-[0px] leading-[22px]">
......@@ -1032,7 +1032,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
<Plus
theme="outline"
size="22"
:stroke-width="2"
:stroke-width="3"
class="text-theme-color cursor-pointer"
@click="handleAddMemoryVariable"
/>
......@@ -1071,14 +1071,14 @@ function handleChangeMemoryFragmentState(value: boolean) {
<n-popover placement="bottom" trigger="hover" :show-arrow="false" class="p-[4px]!">
<template #trigger>
<MoreOne theme="outline" size="14" fill="#333" :stroke-width="2" class="mr-[4px] mt-[2px]" />
<MoreOne theme="outline" size="14" fill="#333" :stroke-width="3" class="mr-[4px] mt-[2px]" />
</template>
<div class="text-[12px]">
<div
class="flex h-[30px] w-[90px] cursor-pointer items-center justify-start px-[8px] py-[5px] hover:rounded-[4px] hover:bg-[#f2f5f9]"
@click="handleShowMemoryVariableModal"
>
<Edit theme="outline" size="16" fill="#333" :stroke-width="2" /><span class="ml-[4px]">
<Edit theme="outline" size="16" fill="#333" :stroke-width="3" /><span class="ml-[4px]">
{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_action_edit',
......@@ -1090,7 +1090,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
class="flex h-[30px] w-[90px] cursor-pointer items-center justify-start px-[8px] py-[5px] hover:rounded-[4px] hover:bg-[#f2f5f9]"
@click="handleCopyMemoryVariableName(memoryVariableItem)"
>
<Copy theme="outline" size="16" fill="#333" :stroke-width="2" />
<Copy theme="outline" size="16" fill="#333" :stroke-width="3" />
<span class="ml-[4px]">
{{
t(
......@@ -1104,7 +1104,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
class="flex h-[30px] w-[90px] cursor-pointer items-center justify-start px-[8px] py-[5px] hover:rounded-[4px] hover:bg-[#f2f5f9]"
@click="handleDeleteMemoryVariableItem(memoryVariableItem)"
>
<ReduceOne theme="outline" size="16" fill="#333" :stroke-width="2" /><span class="ml-[4px]">
<ReduceOne theme="outline" size="16" fill="#333" :stroke-width="3" /><span class="ml-[4px]">
{{ t('common_module.delete') }}
</span>
</div>
......@@ -1125,7 +1125,7 @@ function handleChangeMemoryFragmentState(value: boolean) {
</span>
<n-popover trigger="hover" placement="top-start" class="p-[12px]! left-[-120px]!" :show-arrow="false">
<template #trigger>
<Help theme="outline" size="15" fill="#333" :stroke-width="2" class="mt-[2px]" />
<Help theme="outline" size="15" fill="#333" :stroke-width="3" class="mt-[2px]" />
</template>
<div class="w-[650px] text-[14px]">
<div class="m-w-[100%] mb-[16px] mt-[0px] leading-[22px]">
......
......@@ -110,7 +110,7 @@ function handleDeleteLongMemoryRow(time: string, date: string) {
window.$message
.ctWarning(
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_fragment_delete_all_tip_content',
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_fragment_delete_row_tip_content',
),
t('common_module.delete_tip_title'),
)
......@@ -131,11 +131,18 @@ function handleDeleteLongMemoryRow(time: string, date: string) {
function handleDeleteAllLongMemory() {
const agentId = personalAppConfigStore.baseInfo.agentId
window.$message.ctWarning('数据清空后不可撤销,确定要全部清空吗?', '清空数据提示').then(() => {
fetchDeleteAllLongMemory(agentId).then(() => {
window.$message.success('清空成功')
window.$message
.ctWarning(
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_fragment_delete_all_tip_content',
),
t('common_module.delete_tip_title'),
)
.then(() => {
fetchDeleteAllLongMemory(agentId).then(() => {
window.$message.success(t('common_module.clear_success_message'))
})
})
})
}
function handleGetLongMemoryList() {
......@@ -144,8 +151,7 @@ function handleGetLongMemoryList() {
const updateDate = res.data as LongMemoryItem[]
const groupedData: { [key: string]: LongMemory } = updateDate.reduce(
(acc, item: LongMemoryItem) => {
const date = item.timestamp.split(' ')[0]
const time = item.timestamp.split(' ')[1]
const [date, time] = item.timestamp.split(' ')
const content = item.content
if (!acc[date]) {
acc[date] = { date: date, longMemoryContent: [] }
......@@ -218,20 +224,20 @@ function handleModalOpenAfter() {
<div
v-for="(longMemoryContent, longMemoryContentIndex) in longMemory.longMemoryContent"
:key="longMemoryContentIndex"
class="memoryFragmentContent mb-[16px] flex justify-between"
class="long-memory-content mb-[16px] flex justify-between"
>
<div class="flex items-center">
<div class="w-[80px] text-[#84868c]">{{ longMemoryContent.time }}</div>
<div>{{ longMemoryContent.content }}</div>
</div>
<div class="DeleteBtn mr-[20px] pt-[3px] opacity-0 transition-opacity duration-200">
<div class="delete-button mr-[20px] pt-[3px] opacity-0 transition-opacity duration-200">
<n-tooltip trigger="hover">
<template #trigger>
<Delete
theme="outline"
size="15"
fill="#333"
:stroke-width="2"
:stroke-width="3"
class="cursor-pointer"
@click="handleDeleteLongMemoryRow(longMemoryContent.time, longMemory.date)"
/>
......@@ -277,8 +283,8 @@ function handleModalOpenAfter() {
}
}
.memoryFragmentContent {
&:hover .DeleteBtn {
.long-memory-content {
&:hover .delete-button {
opacity: 1;
}
}
......
......@@ -124,9 +124,9 @@ function handleAddMemoryVariableItem() {
nextTick(() => {
const newIndex = memoryVariableTable.value.length - 1
const input = memoryVariableInputRefs.value[newIndex]
if (input) {
input.focus()
const inputEl = memoryVariableInputRefs.value[newIndex]
if (inputEl) {
inputEl.focus()
}
})
}
......@@ -176,7 +176,7 @@ defineExpose({
theme="multi-color"
size="14"
:fill="['#ff9326', '#ff9326', '#FFF', '#43CCF8']"
:stroke-width="2"
:stroke-width="3"
/>
</div>
<div class="text-[14px] text-[#151B26]">
......@@ -216,7 +216,7 @@ defineExpose({
</div>
<n-popover trigger="hover" class="p-[12px]!">
<template #trigger>
<Help theme="outline" size="15" fill="#333" :stroke-width="2" class="mt-[2px]" />
<Help theme="outline" size="15" fill="#333" :stroke-width="3" class="mt-[2px]" />
</template>
<div class="mb-[8px] w-[226px]">
{{
......@@ -316,7 +316,7 @@ defineExpose({
theme="outline"
size="15"
fill="#333"
:stroke-width="2"
:stroke-width="3"
class="mt-[2px] cursor-pointer"
@click="handleDeleteMemoryVariableRow(item)"
/>
......@@ -349,7 +349,7 @@ defineExpose({
class="text-theme-color mt-[6px] flex w-[78px] cursor-pointer"
@click="handleAddMemoryVariableItem"
>
<Plus theme="outline" size="22" :stroke-width="2" class="text-theme-color" />
<Plus theme="outline" size="22" :stroke-width="3" class="text-theme-color" />
<span>{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_modal.memory_variable_add_now',
......@@ -368,7 +368,7 @@ defineExpose({
class="text-theme-color mt-[16px] flex w-[78px] cursor-pointer"
@click="handleAddMemoryVariableItem"
>
<Plus theme="outline" size="22" :stroke-width="2" class="text-theme-color" />
<Plus theme="outline" size="22" :stroke-width="3" class="text-theme-color" />
<span>{{
t(
'personal_space_module.agent_module.agent_setting_module.agent_config_module.memory_variable_modal.add_variable',
......
......@@ -73,6 +73,7 @@ declare namespace I18n {
close: string
delete_tip_title: string
wipe_data: string
delete_all_tip_title: string
dialogue_module: {
continue_question_message: string
......@@ -253,6 +254,7 @@ declare namespace I18n {
memory_fragment_content: string
memory_variable_delete_tip_content: string
memory_fragment_delete_all_tip_content: string
memory_fragment_delete_row_tip_content: string
memory_variable_modal: {
edit_memory_variable: string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment