From a6acd8fd548de12186e5b3f17698779e26a7deea Mon Sep 17 00:00:00 2001 From: Timothy Yin Date: Fri, 23 May 2025 20:43:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=A4=87=E8=AF=BE-=E6=95=99=E5=AD=A6?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1):=20=E6=95=99=E6=A1=88=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/aifn.ts | 45 ++- components/ai/Conversation.vue | 23 +- components/ai/GeneratedContent.vue | 9 +- components/ai/index.ts | 10 +- components/app/sidebar/nav/Main.vue | 11 +- components/course/Card.vue | 5 +- components/fn/teach/CaseGen.vue | 17 +- components/fn/teach/LessonPlan.vue | 281 +++++++++++++++--- components/ui/toggle-group/ToggleGroup.vue | 32 ++ .../ui/toggle-group/ToggleGroupItem.vue | 34 +++ components/ui/toggle-group/index.ts | 2 + components/ui/toggle/Toggle.vue | 33 ++ components/ui/toggle/index.ts | 27 ++ components/uni/file-selector/index.vue | 133 +++++++++ layouts/default.vue | 17 +- pages/course/[id].vue | 1 - pages/course/prep/deck.vue | 5 +- pages/course/prep/quiz.vue | 4 +- pages/course/prep/teach.vue | 19 +- 19 files changed, 625 insertions(+), 83 deletions(-) create mode 100644 components/ui/toggle-group/ToggleGroup.vue create mode 100644 components/ui/toggle-group/ToggleGroupItem.vue create mode 100644 components/ui/toggle-group/index.ts create mode 100644 components/ui/toggle/Toggle.vue create mode 100644 components/ui/toggle/index.ts create mode 100644 components/uni/file-selector/index.vue diff --git a/api/aifn.ts b/api/aifn.ts index a8bd944..ece273d 100644 --- a/api/aifn.ts +++ b/api/aifn.ts @@ -7,15 +7,56 @@ export type AIGeneratedContentResponse = IResponse<{ } }> -export const generateLessonPlan = async (params: { +export interface GenerateLessonPlanParams { query: string -}) => { + moduleName?: string + urls?: string[] + useTemplate?: boolean + templateId?: string +} + +export interface RegenerateLessonPlanSectionParams { + query: string + conversationId: string + urls?: string[] +} + +export interface LessonPlanTemplate { + createBy: number + createTime: string + docxUrl: string + id: number + imgUrl: string + isActive: boolean + moduleName: string + name: string + remark: string + updateBy: number + updateTime: string +} + +export const generateLessonPlan = async (params: GenerateLessonPlanParams) => { return await http(`/ai/lesson-plan-design/text-block`, { method: 'POST', body: params, }) } +export const regenerateLessonPlanSection = async (params: RegenerateLessonPlanSectionParams) => { + return await http(`/ai/lesson-plan-design/update-block`, { + method: 'POST', + body: params, + }) +} + +export const getLessonPlanTemplate = async () => { + return await http>(`/ai/lesson-plan-template/list`, { + method: 'GET', + }) +} + export const generateCase = async (params: { query: string }) => { diff --git a/components/ai/Conversation.vue b/components/ai/Conversation.vue index 5bca5f4..7b53a44 100644 --- a/components/ai/Conversation.vue +++ b/components/ai/Conversation.vue @@ -162,7 +162,9 @@ const onDeleteConversation = (conversationId: string) => {
{ 思考中
+
+ + + +
diff --git a/components/ai/GeneratedContent.vue b/components/ai/GeneratedContent.vue index 66eb8e3..29bd82a 100644 --- a/components/ai/GeneratedContent.vue +++ b/components/ai/GeneratedContent.vue @@ -6,7 +6,8 @@ defineProps<{ }>() defineEmits<{ - (e: 'regenerate' | 'delete', itemIndex: number): void + (e: 'delete', itemIndex: number): void + (e: 'regenerate', itemIndex: number, conversationId: string): void (e: 'regenerateAll' | 'download' | 'save'): void }>() @@ -66,15 +67,15 @@ defineEmits<{ {{ item.title }}
- +
- + +
课程智能体 @@ -71,19 +68,19 @@ const onGenerateClick = () => {
- 选择章节 + 选择智能体