From 6ba10f840a249c1f950a039e046c55a5d800c71f Mon Sep 17 00:00:00 2001 From: Germey Tsui Date: Mon, 8 Jan 2024 13:28:14 +0800 Subject: [PATCH] add nav --- src/components/common/Navigator.vue | 5 +- src/i18n/zh/chatdoc/index.ts | 3 +- src/i18n/zh/chatdoc/nav.ts | 5 ++ src/layouts/Chatdoc.vue | 111 ++++++++++++++++------------ src/pages/chatdoc/Chat.vue | 22 ++++++ src/pages/chatdoc/Index.vue | 4 +- src/pages/chatdoc/Knowledge.vue | 22 ++++++ src/pages/chatdoc/Setting.vue | 22 ++++++ src/router/chatdoc.ts | 17 ++++- src/router/constants.ts | 3 + 10 files changed, 163 insertions(+), 51 deletions(-) create mode 100644 src/i18n/zh/chatdoc/nav.ts create mode 100644 src/pages/chatdoc/Chat.vue create mode 100644 src/pages/chatdoc/Knowledge.vue create mode 100644 src/pages/chatdoc/Setting.vue diff --git a/src/components/common/Navigator.vue b/src/components/common/Navigator.vue index 7a14ce6..9435cef 100644 --- a/src/components/common/Navigator.vue +++ b/src/components/common/Navigator.vue @@ -77,6 +77,9 @@ import { ElButton, ElTooltip, ElMenu, ElMenuItem } from 'element-plus'; import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; import { ROUTE_CHATDOC_INDEX, + ROUTE_CHATDOC_CHAT, + ROUTE_CHATDOC_KNOWLEDGE, + ROUTE_CHATDOC_SETTING, ROUTE_CHAT_CONVERSATION, ROUTE_CHAT_CONVERSATION_NEW, ROUTE_CONSOLE_ROOT, @@ -128,7 +131,7 @@ export default defineComponent({ }, displayName: this.$t('common.nav.chatdoc'), icon: 'fa-solid fa-file-lines', - routes: [ROUTE_CHATDOC_INDEX] + routes: [ROUTE_CHATDOC_INDEX, ROUTE_CHATDOC_CHAT, ROUTE_CHATDOC_KNOWLEDGE, ROUTE_CHATDOC_SETTING] }); } diff --git a/src/i18n/zh/chatdoc/index.ts b/src/i18n/zh/chatdoc/index.ts index fdbfdca..e59502a 100644 --- a/src/i18n/zh/chatdoc/index.ts +++ b/src/i18n/zh/chatdoc/index.ts @@ -1,4 +1,5 @@ import message from './message'; import title from './title'; +import nav from './nav'; -export default { message, title }; +export default { message, title, nav }; diff --git a/src/i18n/zh/chatdoc/nav.ts b/src/i18n/zh/chatdoc/nav.ts new file mode 100644 index 0000000..641081b --- /dev/null +++ b/src/i18n/zh/chatdoc/nav.ts @@ -0,0 +1,5 @@ +export default { + chat: '对话', + setting: '设置', + knowledge: '知识库' +}; diff --git a/src/layouts/Chatdoc.vue b/src/layouts/Chatdoc.vue index ffa9703..e39f406 100644 --- a/src/layouts/Chatdoc.vue +++ b/src/layouts/Chatdoc.vue @@ -1,39 +1,72 @@ diff --git a/src/pages/chatdoc/Index.vue b/src/pages/chatdoc/Index.vue index b53f628..b95fd11 100644 --- a/src/pages/chatdoc/Index.vue +++ b/src/pages/chatdoc/Index.vue @@ -1,6 +1,6 @@ @@ -9,7 +9,7 @@ import { defineComponent } from 'vue'; import Layout from '@/layouts/Chatdoc.vue'; export default defineComponent({ - name: 'ChatdocIndex', + name: 'ChatdocKnowledge', components: { Layout }, diff --git a/src/pages/chatdoc/Knowledge.vue b/src/pages/chatdoc/Knowledge.vue new file mode 100644 index 0000000..023bc83 --- /dev/null +++ b/src/pages/chatdoc/Knowledge.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/pages/chatdoc/Setting.vue b/src/pages/chatdoc/Setting.vue new file mode 100644 index 0000000..c4cf7fe --- /dev/null +++ b/src/pages/chatdoc/Setting.vue @@ -0,0 +1,22 @@ + + + diff --git a/src/router/chatdoc.ts b/src/router/chatdoc.ts index 6c147ee..7ce8064 100644 --- a/src/router/chatdoc.ts +++ b/src/router/chatdoc.ts @@ -1,4 +1,4 @@ -import { ROUTE_CHATDOC_INDEX } from './constants'; +import { ROUTE_CHATDOC_CHAT, ROUTE_CHATDOC_INDEX, ROUTE_CHATDOC_KNOWLEDGE, ROUTE_CHATDOC_SETTING } from './constants'; export default { path: '/chatdoc', @@ -11,6 +11,21 @@ export default { path: '', name: ROUTE_CHATDOC_INDEX, component: () => import('@/pages/chatdoc/Index.vue') + }, + { + path: 'chat', + name: ROUTE_CHATDOC_CHAT, + component: () => import('@/pages/chatdoc/Chat.vue') + }, + { + path: 'knowledge', + name: ROUTE_CHATDOC_KNOWLEDGE, + component: () => import('@/pages/chatdoc/Knowledge.vue') + }, + { + path: 'setting', + name: ROUTE_CHATDOC_SETTING, + component: () => import('@/pages/chatdoc/Setting.vue') } ] }; diff --git a/src/router/constants.ts b/src/router/constants.ts index 6456486..c33ad12 100644 --- a/src/router/constants.ts +++ b/src/router/constants.ts @@ -10,6 +10,9 @@ export const ROUTE_MIDJOURNEY_INDEX = 'midjourney-index'; export const ROUTE_MIDJOURNEY_HISTORY = 'midjourney-history'; export const ROUTE_CHATDOC_INDEX = 'chatdoc-index'; +export const ROUTE_CHATDOC_CHAT = 'chatdoc-chat'; +export const ROUTE_CHATDOC_SETTING = 'chatdoc-setting'; +export const ROUTE_CHATDOC_KNOWLEDGE = 'chatdoc-knowledge'; export const ROUTE_CONSOLE_ROOT = 'console-root'; export const ROUTE_CONSOLE_ORDER_LIST = 'console-order-list';