diff --git a/src/router/config/home.ts b/src/router/config/home.ts index 6808c8b..30cc9da 100644 --- a/src/router/config/home.ts +++ b/src/router/config/home.ts @@ -345,6 +345,19 @@ export default [ asideMenu: 'drawer' // 左侧菜单抽屉模式 } }, + { + path: '/model-chat', + name: 'ModelChat', + component: () => import('@/views/Jyh/ModelChat/index.vue'), + meta: { + title: 'ModelChat', + reportTitle: 'ModelChat', + className: 'w-full min-w-full', + hiddenFooter: true, + hasMobile: true, + asideMenu: 'drawer' // 左侧菜单抽屉模式 + } + }, { path: '/LinePage', name: 'LinePage', diff --git a/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAsideNew.vue b/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAsideNew.vue index e43edcc..cf783ff 100644 --- a/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAsideNew.vue +++ b/src/views/Jyh/AI/Home/components/ViewHistoryAside/ViewHistoryAsideNew.vue @@ -131,6 +131,7 @@ import { fetchDeleteConversation, fetchToggleConversationCollect } from '@/api/jyh'; +import {useRouter} from "vue-router"; // --- Props & Emits --- const props = defineProps(['username', 'CONV_ID']); @@ -200,11 +201,19 @@ const handleSelect = (item) => { if (item.isEditing) return; // 编辑中不触发选中 emit('select-conv', item.conversationId); }; - -// 4. 菜单点击 +const router = useRouter(); +// 4. 菜单点击 - 修改为跳转逻辑 const handleMenuClick = (menu) => { console.log('点击菜单:', menu.title); - // 路由跳转或功能触发逻辑 + + // 使用 router.push 跳转,并通过 query 传递参数 + router.push({ + path: '/model-chat', // 对应路由中的 path + query: { + id: menu.id, + title: menu.title + } + }); }; // 5. 编辑/重命名逻辑 diff --git a/src/views/Jyh/ModelChat/index.vue b/src/views/Jyh/ModelChat/index.vue new file mode 100644 index 0000000..d268ba9 --- /dev/null +++ b/src/views/Jyh/ModelChat/index.vue @@ -0,0 +1,318 @@ + + + + + + + {{ currentTitle }} + 智能辅助模型 + + + + 清空 + + + + + + + 我是 {{ currentTitle }} 助手,请告诉我您的需求。 + + + + + + + + {{ msg.content }} + {{ msg.time }} + + + + + + + 正在思考... + + + + + + + + + + +
我是 {{ currentTitle }} 助手,请告诉我您的需求。