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 = () => {
- 选择章节 + 选择智能体