Commit 4a34607d authored by shirlyn.guo's avatar shirlyn.guo 👌🏻

chore: 多语言&命名规范

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