diff --git a/components/MarkdownRenderer.vue b/components/MarkdownRenderer.vue
index ff4bc0c..ae7dcb9 100644
--- a/components/MarkdownRenderer.vue
+++ b/components/MarkdownRenderer.vue
@@ -44,6 +44,6 @@ defineProps({
diff --git a/components/ai/Conversation.vue b/components/ai/Conversation.vue
index 989daf1..a875c6a 100644
--- a/components/ai/Conversation.vue
+++ b/components/ai/Conversation.vue
@@ -10,7 +10,7 @@ const props = defineProps<{
form: FormContext
formFieldConfig?: {
[key: string]: {
- component: string
+ component?: string
props?: Record
[key: string]: any
}
@@ -20,6 +20,15 @@ const props = defineProps<{
disableUserInput?: boolean
}>()
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
+const currentConversation = computed(() => {
+ const { conversations, activeConversationId } = props
+ if (conversations && activeConversationId) {
+ return conversations.find((m) => m.id === activeConversationId)
+ }
+ return null
+})
+
const messages = computed(() => {
const { conversations, activeConversationId } = props
if (conversations && activeConversationId) {
@@ -115,7 +124,9 @@ const onDeleteConversation = (conversationId: string) => {
-
+
到底了
@@ -150,22 +161,33 @@ const onDeleteConversation = (conversationId: string) => {
:class="`${message.role == 'user' ? 'justify-end' : 'justify-start'}`"
>
@@ -202,7 +224,7 @@ const onDeleteConversation = (conversationId: string) => {
:form="form"
:field-config="formFieldConfig"
class="space-y-2"
- @submit="(values) => $emit('submit', values)"
+ @submit="(values: any) => $emit('submit', values)"
>
-
+
diff --git a/components/fn/teach/CourseChapter.vue b/components/fn/teach/CourseChapter.vue
new file mode 100644
index 0000000..bcf874b
--- /dev/null
+++ b/components/fn/teach/CourseChapter.vue
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
diff --git a/components/fn/teach/CourseOutline.vue b/components/fn/teach/CourseOutline.vue
new file mode 100644
index 0000000..779d20c
--- /dev/null
+++ b/components/fn/teach/CourseOutline.vue
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
diff --git a/components/fn/teach/KnowledgeDiagram.vue b/components/fn/teach/KnowledgeDiagram.vue
index 0f4a6af..697595c 100644
--- a/components/fn/teach/KnowledgeDiagram.vue
+++ b/components/fn/teach/KnowledgeDiagram.vue
@@ -1,16 +1,93 @@
@@ -18,6 +95,25 @@ const form = useForm({
diff --git a/components/fn/teach/Plan.vue b/components/fn/teach/Plan.vue
new file mode 100644
index 0000000..3c39245
--- /dev/null
+++ b/components/fn/teach/Plan.vue
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
diff --git a/components/fn/teach/PoliticalCase.vue b/components/fn/teach/PoliticalCase.vue
new file mode 100644
index 0000000..0559b5f
--- /dev/null
+++ b/components/fn/teach/PoliticalCase.vue
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
diff --git a/components/fn/teach/ResearchPlan.vue b/components/fn/teach/ResearchPlan.vue
new file mode 100644
index 0000000..92839f8
--- /dev/null
+++ b/components/fn/teach/ResearchPlan.vue
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+
diff --git a/components/fn/teach/StdDesign.vue b/components/fn/teach/StdDesign.vue
index df121f5..8894172 100644
--- a/components/fn/teach/StdDesign.vue
+++ b/components/fn/teach/StdDesign.vue
@@ -46,7 +46,7 @@ onMounted(() => {
})
const schema = z.object({
- query: z.string().describe('课程名称'),
+ query: z.string({ required_error: '请输入课程名称' }).describe('课程名称'),
})
const form = useForm({
@@ -54,11 +54,9 @@ const form = useForm({
})
const onSubmit = (values: z.infer) => {
- http_stream(
+ http_stream>(
'/ai/course-standard/stream',
- {
- query: values.query,
- },
+ values,
{
onStart(id, created_at) {
activeConversationId.value = id
@@ -96,6 +94,13 @@ const onSubmit = (values: z.infer) => {
+ disabled?: boolean
}
@@ -27,6 +28,7 @@ const isActiveItem = (idx: number) => {
}
const onClickItem = (idx: number) => {
+ if (props.navs[idx].disabled) return
emit('update:modelValue', idx)
}
@@ -37,7 +39,7 @@ const onClickItem = (idx: number) => {
v-for="(nav, i) in navs"
:key="i"
class="flex justify-center items-center gap-2 p-2.5 rounded-sm cursor-pointer select-none transition-colors duration-75"
- :class="`${isActiveItem(i) ? 'bg-primary text-primary-foreground' : 'bg-accent text-foreground'}`"
+ :class="`${isActiveItem(i) ? 'bg-primary text-primary-foreground' : 'bg-accent text-foreground'} ${nav.disabled ? 'cursor-not-allowed text-foreground/40' : ''}`"
@click="onClickItem(i)"
>
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 12920cb..2a70127 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -10,6 +10,7 @@ export default withNuxt(
'vue/singleline-html-element-content-newline': 'off',
'@stylistic/brace-style': 'off',
'@stylistic/arrow-parens': 'off',
+ '@stylistic/operator-linebreak': 'off',
},
plugins: {
prettier,
diff --git a/pages/course/prep/teach.vue b/pages/course/prep/teach.vue
index 2811474..2aea0f7 100644
--- a/pages/course/prep/teach.vue
+++ b/pages/course/prep/teach.vue
@@ -5,6 +5,11 @@ import {
FnTeachCaseGen,
FnTeachStdDesign,
FnTeachKnowledgeDiagram,
+ FnTeachCourseChapter,
+ FnTeachPoliticalCase,
+ FnTeachResearchPlan,
+ FnTeachPlan,
+ FnTeachCourseOutline,
} from '#components'
import type { NavTertiaryItem } from '~/components/nav/Tertiary.vue'
@@ -25,9 +30,12 @@ const tertiaryNavs: NavTertiaryItem[] = [
{ label: '教案设计', component: FnTeachLessonPlan },
{ label: '案例设计', component: FnTeachCaseGen },
{ label: '课程标准', component: FnTeachStdDesign },
- { label: '知识图谱', component: FnTeachKnowledgeDiagram },
- { label: '课程章节' },
- { label: '教研计划' },
+ { label: '知识图谱', component: FnTeachKnowledgeDiagram, disabled: true },
+ { label: '课程章节', component: FnTeachCourseChapter },
+ { label: '思政案例', component: FnTeachPoliticalCase },
+ { label: '教研计划', component: FnTeachResearchPlan },
+ { label: '教学计划', component: FnTeachPlan },
+ { label: '课程大纲', component: FnTeachCourseOutline },
]
const currentNav = ref(0)