From 7e6cf25295263c87820c24bf86c721a791ac73aa Mon Sep 17 00:00:00 2001 From: huangpeng <1764183241@qq.com> Date: Wed, 17 Sep 2025 21:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9AI=E9=9D=A2=E8=AF=95=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.js | 2 +- src/api/question-category.js | 62 +- src/api/question.js | 4 + src/components/ChatWindow.vue | 502 +++++++++++ src/components/QuestionBankSection.vue | 440 ++++++++++ src/layout/Layout.vue | 2 +- src/router/index.js | 27 +- src/views/InterviewView.vue | 408 --------- src/views/QuestionBank.vue | 280 ------- .../index.vue} | 11 +- src/views/chat/index.vue | 83 ++ .../{Dashboard.vue => dashboard/index.vue} | 298 +++---- .../index.vue} | 300 +++---- .../index.vue} | 350 ++++---- src/views/interview/chat.vue | 53 ++ src/views/interview/home.vue | 122 +++ src/views/interview/index.vue | 318 +++++++ .../components/CategoryForm.vue | 121 --- .../components/CategoryTable.vue | 115 --- .../question-category/components/Create.vue | 99 --- .../question-category/components/Edit.vue | 110 --- .../components/SearchBar.vue | 80 -- .../question-category/components/add.vue | 227 +++++ .../question-category/components/edit.vue | 336 ++++++++ src/views/question-category/index.vue | 324 ++++---- src/views/question/index.vue | 784 ++++++++++++++++++ vite.config.js | 1 + 27 files changed, 3601 insertions(+), 1858 deletions(-) create mode 100644 src/components/ChatWindow.vue create mode 100644 src/components/QuestionBankSection.vue delete mode 100644 src/views/InterviewView.vue delete mode 100644 src/views/QuestionBank.vue rename src/views/{AnswerRecord.vue => answer-record/index.vue} (92%) create mode 100644 src/views/chat/index.vue rename src/views/{Dashboard.vue => dashboard/index.vue} (95%) rename src/views/{InterviewHistory.vue => interview-history/index.vue} (95%) rename src/views/{InterviewReport.vue => interview-report/index.vue} (96%) create mode 100644 src/views/interview/chat.vue create mode 100644 src/views/interview/home.vue create mode 100644 src/views/interview/index.vue delete mode 100644 src/views/question-category/components/CategoryForm.vue delete mode 100644 src/views/question-category/components/CategoryTable.vue delete mode 100644 src/views/question-category/components/Create.vue delete mode 100644 src/views/question-category/components/Edit.vue delete mode 100644 src/views/question-category/components/SearchBar.vue create mode 100644 src/views/question-category/components/add.vue create mode 100644 src/views/question-category/components/edit.vue create mode 100644 src/views/question/index.vue diff --git a/src/api/index.js b/src/api/index.js index 463daba..7e37eb0 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus'; // Create an Axios instance with a base configuration const apiClient = axios.create({ - baseURL: '/api/v1', + baseURL: '/api', timeout: 600000, // 10 min timeout }); diff --git a/src/api/question-category.js b/src/api/question-category.js index 55dd478..fff32d2 100644 --- a/src/api/question-category.js +++ b/src/api/question-category.js @@ -1,24 +1,52 @@ -import apiClient from './index'; +import apiClient from "@/api/index.js"; -export const questionCategoryApi = { - // 获取分类树列表 - getTreeList: () => apiClient.get('/question-category/tree-list'), +// 获取分类树形列表 +export function getCategoryTree(params) { + return apiClient({ + url: '/question-category/tree-list', + method: 'get', + params + }) +} - // 获取分类详情 - getDetail: (id) => apiClient.get(`/question-category/${id}`), +// 获取分类详情 +export function getCategoryDetail(id) { + return apiClient({ + url: `/question-category/${id}`, + method: 'get' + }) +} - // 创建分类 - create: (data) => apiClient.post('/question-category', data), +// 添加分类 +export function addCategory(data) { + return apiClient({ + url: '/question-category', + method: 'post', + data + }) +} - // 更新分类 - update: (id, data) => apiClient.put(`/question-category/${id}`, data), +// 修改分类 +export function updateCategory(data) { + return apiClient({ + url: '/question-category/update', + method: 'post', + data + }) +} - // 删除分类 - delete: (id) => apiClient.delete(`/question-category/${id}`), +// 删除分类 +export function deleteCategory(id) { + return apiClient({ + url: `/question-category/${id}`, + method: 'delete' + }) +} - // 更新状态 - updateState: (id, state) => apiClient.patch(`/question-category/${id}/state`, { state }), - - // 获取分类选项(用于下拉选择) - getOptions: () => apiClient.get('/question-category/options') +// 获取所有父级分类(用于选择父级) +export function getParentOptions() { + return apiClient({ + url: '/question-category/parentOptions', + method: 'get' + }) } \ No newline at end of file diff --git a/src/api/question.js b/src/api/question.js index cdb573f..b3d8eaa 100644 --- a/src/api/question.js +++ b/src/api/question.js @@ -51,3 +51,7 @@ export const importQuestionsByAi = (formData) => { export const checkQuestionData = () => { return apiClient.post('/question/check-question-data'); } + +export const getTreeListByCategory = (data) => { + return apiClient.post('/question/tree-list-category', data); +} diff --git a/src/components/ChatWindow.vue b/src/components/ChatWindow.vue new file mode 100644 index 0000000..f3c2568 --- /dev/null +++ b/src/components/ChatWindow.vue @@ -0,0 +1,502 @@ + + + + + \ No newline at end of file diff --git a/src/components/QuestionBankSection.vue b/src/components/QuestionBankSection.vue new file mode 100644 index 0000000..00ad1fa --- /dev/null +++ b/src/components/QuestionBankSection.vue @@ -0,0 +1,440 @@ + + + + + \ No newline at end of file diff --git a/src/layout/Layout.vue b/src/layout/Layout.vue index e91d207..8325faa 100644 --- a/src/layout/Layout.vue +++ b/src/layout/Layout.vue @@ -25,7 +25,7 @@ 仪表盘 - + 模拟面试 diff --git a/src/router/index.js b/src/router/index.js index 8666baf..3dadb3a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,33 +9,48 @@ const routes = [ { path: '', name: 'Dashboard', - component: () => import('../views/Dashboard.vue'), + component: () => import('@/views/dashboard/index.vue'), + }, + { + path: 'chat', + name: 'Chat', + component: () => import('@/views/chat/index.vue'), + }, + { + path: 'home', + name: 'InterviewHome', + component: () => import('@/views/interview/home.vue'), }, { path: 'interview', name: 'Interview', - component: () => import('../views/InterviewView.vue'), + component: () => import('@/views/interview/index.vue'), + }, + { + path: 'interview-chat', + name: 'InterviewChat', + component: () => import('@/views/interview/chat.vue'), }, { path: 'question-bank', name: 'QuestionBank', - component: () => import('../views/QuestionBank.vue'), + component: () => import('@/views/question/index.vue'), }, { path: 'history', name: 'InterviewHistory', - component: () => import('../views/InterviewHistory.vue'), + component: () => import('@/views/interview-history/index.vue'), }, { path: 'report/:sessionId', name: 'InterviewReport', - component: () => import('../views/InterviewReport.vue'), + component: () => import('@/views/interview-report/index.vue'), props: true, // 将路由参数作为props传递给组件 }, { path: 'answer-record', name: 'AnswerRecord', - component: () => import('../views/AnswerRecord.vue'), + component: () => import('@/views/answer-record/index.vue'), }, { path: 'question-category', diff --git a/src/views/InterviewView.vue b/src/views/InterviewView.vue deleted file mode 100644 index 6202397..0000000 --- a/src/views/InterviewView.vue +++ /dev/null @@ -1,408 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/QuestionBank.vue b/src/views/QuestionBank.vue deleted file mode 100644 index 220fc4e..0000000 --- a/src/views/QuestionBank.vue +++ /dev/null @@ -1,280 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/AnswerRecord.vue b/src/views/answer-record/index.vue similarity index 92% rename from src/views/AnswerRecord.vue rename to src/views/answer-record/index.vue index 50d7083..2087382 100644 --- a/src/views/AnswerRecord.vue +++ b/src/views/answer-record/index.vue @@ -1,21 +1,20 @@ - + + \ No newline at end of file diff --git a/src/views/Dashboard.vue b/src/views/dashboard/index.vue similarity index 95% rename from src/views/Dashboard.vue rename to src/views/dashboard/index.vue index de84ebb..64b9814 100644 --- a/src/views/Dashboard.vue +++ b/src/views/dashboard/index.vue @@ -1,150 +1,150 @@ - - - - - \ No newline at end of file diff --git a/src/views/InterviewHistory.vue b/src/views/interview-history/index.vue similarity index 95% rename from src/views/InterviewHistory.vue rename to src/views/interview-history/index.vue index ea6e0d0..e681688 100644 --- a/src/views/InterviewHistory.vue +++ b/src/views/interview-history/index.vue @@ -1,151 +1,151 @@ - - - - - \ No newline at end of file diff --git a/src/views/InterviewReport.vue b/src/views/interview-report/index.vue similarity index 96% rename from src/views/InterviewReport.vue rename to src/views/interview-report/index.vue index 80cc12c..d42d005 100644 --- a/src/views/InterviewReport.vue +++ b/src/views/interview-report/index.vue @@ -1,176 +1,176 @@ - - - - - \ No newline at end of file diff --git a/src/views/interview/chat.vue b/src/views/interview/chat.vue new file mode 100644 index 0000000..e4db5ca --- /dev/null +++ b/src/views/interview/chat.vue @@ -0,0 +1,53 @@ + + + + + \ No newline at end of file diff --git a/src/views/interview/home.vue b/src/views/interview/home.vue new file mode 100644 index 0000000..4262836 --- /dev/null +++ b/src/views/interview/home.vue @@ -0,0 +1,122 @@ + + + + + \ No newline at end of file diff --git a/src/views/interview/index.vue b/src/views/interview/index.vue new file mode 100644 index 0000000..2091aa9 --- /dev/null +++ b/src/views/interview/index.vue @@ -0,0 +1,318 @@ + + + + + \ No newline at end of file diff --git a/src/views/question-category/components/CategoryForm.vue b/src/views/question-category/components/CategoryForm.vue deleted file mode 100644 index e5e427a..0000000 --- a/src/views/question-category/components/CategoryForm.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/question-category/components/CategoryTable.vue b/src/views/question-category/components/CategoryTable.vue deleted file mode 100644 index f2c1f6f..0000000 --- a/src/views/question-category/components/CategoryTable.vue +++ /dev/null @@ -1,115 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/question-category/components/Create.vue b/src/views/question-category/components/Create.vue deleted file mode 100644 index e49d054..0000000 --- a/src/views/question-category/components/Create.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/question-category/components/Edit.vue b/src/views/question-category/components/Edit.vue deleted file mode 100644 index 4edb76d..0000000 --- a/src/views/question-category/components/Edit.vue +++ /dev/null @@ -1,110 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/question-category/components/SearchBar.vue b/src/views/question-category/components/SearchBar.vue deleted file mode 100644 index 64956d8..0000000 --- a/src/views/question-category/components/SearchBar.vue +++ /dev/null @@ -1,80 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/question-category/components/add.vue b/src/views/question-category/components/add.vue new file mode 100644 index 0000000..05f057f --- /dev/null +++ b/src/views/question-category/components/add.vue @@ -0,0 +1,227 @@ + + + + + \ No newline at end of file diff --git a/src/views/question-category/components/edit.vue b/src/views/question-category/components/edit.vue new file mode 100644 index 0000000..7a60898 --- /dev/null +++ b/src/views/question-category/components/edit.vue @@ -0,0 +1,336 @@ + + + + + \ No newline at end of file diff --git a/src/views/question-category/index.vue b/src/views/question-category/index.vue index d0ee8c8..04cd535 100644 --- a/src/views/question-category/index.vue +++ b/src/views/question-category/index.vue @@ -1,159 +1,203 @@ - \ No newline at end of file diff --git a/src/views/question/index.vue b/src/views/question/index.vue new file mode 100644 index 0000000..9974669 --- /dev/null +++ b/src/views/question/index.vue @@ -0,0 +1,784 @@ + + + + + \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 14c4010..8a0fc1e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -19,6 +19,7 @@ export default defineConfig({ target: 'http://localhost:8080', changeOrigin: true, // Needed for virtual hosted sites secure: false, // Optional: if you are using https + rewrite: (path) => path.replace(/^\/api/, ''), }, }, },