diff --git a/src/components/common/Setting/General.vue b/src/components/common/Setting/General.vue index d37ed7e..4152b4a 100644 --- a/src/components/common/Setting/General.vue +++ b/src/components/common/Setting/General.vue @@ -1,18 +1,13 @@ @@ -102,25 +146,49 @@ function handleReset() { {{ $t('common.save') }} +
- {{ $t('setting.resetUserInfo') }} - - {{ $t('common.reset') }} + {{ $t('setting.chatHistory') }} + + + + {{ $t('common.export') }} + + + + + + {{ $t('common.import') }} + + + + {{ $t('chat.clearHistoryConfirm') }} +
{{ $t('setting.theme') }}
@@ -128,18 +196,21 @@ function handleReset() { {{ $t('setting.language') }}
+
+ {{ $t('setting.resetUserInfo') }} + + {{ $t('common.reset') }} + +
diff --git a/src/components/common/Setting/index.vue b/src/components/common/Setting/index.vue index dcb1d08..3b27464 100644 --- a/src/components/common/Setting/index.vue +++ b/src/components/common/Setting/index.vue @@ -19,8 +19,6 @@ interface Emit { const active = ref('General') -const reload = ref(false) - const show = computed({ get() { return props.visible @@ -29,13 +27,6 @@ const show = computed({ emit('update:visible', visible) }, }) - -function handleReload() { - reload.value = true - setTimeout(() => { - reload.value = false - }, 0) -}
- +
diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index b832a08..0766d75 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -3,6 +3,9 @@ export default { delete: 'Delete', save: 'Save', reset: 'Reset', + export: 'Export', + import: 'Import', + clear: 'Clear', yes: 'Yes', no: 'No', noData: 'No Data', @@ -21,6 +24,7 @@ export default { deleteMessage: 'Delete Message', deleteMessageConfirm: 'Are you sure to delete this message?', deleteHistoryConfirm: 'Are you sure to clear this history?', + clearHistoryConfirm: 'Are you sure to clear chat history?', }, setting: { setting: 'Setting', @@ -30,6 +34,7 @@ export default { name: 'Name', description: 'Description', resetUserInfo: 'Reset UserInfo', + chatHistory: 'ChatHistory', theme: 'Theme', language: 'Language', api: 'API', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index d3dc6ea..a500727 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -3,6 +3,9 @@ export default { delete: '删除', save: '保存', reset: '重置', + export: '导出', + import: '导入', + clear: '清空', yes: '是', no: '否', noData: '暂无数据', @@ -21,6 +24,7 @@ export default { deleteMessage: '删除消息', deleteMessageConfirm: '是否删除此消息?', deleteHistoryConfirm: '确定删除此记录?', + clearHistoryConfirm: '确定清空聊天记录?', }, setting: { setting: '设置', @@ -30,6 +34,7 @@ export default { name: '名称', description: '描述', resetUserInfo: '重置用户信息', + chatHistory: '聊天记录', theme: '主题', language: '语言', api: 'API', diff --git a/src/utils/functions/index.ts b/src/utils/functions/index.ts new file mode 100644 index 0000000..debb005 --- /dev/null +++ b/src/utils/functions/index.ts @@ -0,0 +1,7 @@ +export function getCurrentDate() { + const date = new Date() + const day = date.getDate() + const month = date.getMonth() + 1 + const year = date.getFullYear() + return `${year}-${month}-${day}` +}