|
|
@@ -0,0 +1,114 @@
|
|
|
+<!--
|
|
|
+ Description: 教师批改界面。改写于EditPage
|
|
|
+ Author: XiaoYu
|
|
|
+ Created Date: 2024-7-24
|
|
|
+-->
|
|
|
+<template>
|
|
|
+
|
|
|
+ <div class="my-correct">
|
|
|
+ <!-- 写作题目 及 作文内容 -->
|
|
|
+ <div class="my-correct-header">
|
|
|
+ <StudentWritingRequirements />
|
|
|
+ <!-- TODO:怎么这么难写!!! -->
|
|
|
+ <StudentEssay :studentId = "studentId" :assignmentId="assignmentId"/>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="right-side">
|
|
|
+ <!-- TODO:AI评分及写作过程记录:框架已完成,内容调取待完成 -->
|
|
|
+ <div class="my-correct-item">
|
|
|
+ <h2>历史记录</h2><br>
|
|
|
+ <ContentSelector/>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 教师评分、修改意见及评价 -->
|
|
|
+ <!--新修改:评分小组件放入Remark组件中了 -->
|
|
|
+ <div class="my-correct-item">
|
|
|
+
|
|
|
+ <Remark :studentId = "studentId" :assignmentId="assignmentId"/>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+<script setup lang="ts">
|
|
|
+import AIChatter from "@/components/AIChatter/AIChatter.vue";
|
|
|
+import Dictionaries from "@/views/Home/component/Dictionaries/index.vue";
|
|
|
+import useApis from "@/apis";
|
|
|
+import {useStore} from "@/store";
|
|
|
+import router from "@/router"
|
|
|
+import {onMounted, reactive, ref, watchEffect} from "vue";
|
|
|
+import type {engagementVO} from "@/types/vo";
|
|
|
+import type {IDialogue} from "@/types/dialogue.ts";
|
|
|
+import Edit from "@/views/Home/component/Edit/index.vue";
|
|
|
+import Slider from '@/views/Home/component/Silder/index.vue'
|
|
|
+import "./index.scss"
|
|
|
+import {useRoute} from 'vue-router'
|
|
|
+import StudentEssay from "../Home/component/StudentEssay/StudentEssay.vue";
|
|
|
+import ContentSelector from "../Home/component/ContentSelector/ContentSelector.vue";
|
|
|
+import StudentWritingRequirements from "../Home/component/StudentEssay/StudentWritingRequirements.vue";
|
|
|
+import Remark from "../Home/component/Remark/Remark.vue";
|
|
|
+
|
|
|
+
|
|
|
+// 获得路由中的assignmentId
|
|
|
+const route = useRoute()
|
|
|
+const assignmentId = Number(route.params.assignmentId)
|
|
|
+const studentId = Number(route.query.studentId)
|
|
|
+
|
|
|
+const apis = useApis()
|
|
|
+const store = useStore()
|
|
|
+
|
|
|
+//直接搬的EditPage,不知是否需要修改
|
|
|
+const dataForm = reactive<{
|
|
|
+ messages: IDialogue[],
|
|
|
+ dialogueId: string;
|
|
|
+ engagement: engagementVO
|
|
|
+}>({
|
|
|
+ messages: [],
|
|
|
+ dialogueId: '',
|
|
|
+ engagement: {} as engagementVO
|
|
|
+})
|
|
|
+
|
|
|
+// 获取数据
|
|
|
+async function fetchData(){
|
|
|
+ await apis.getAIDialogues(assignmentId,studentId )
|
|
|
+ .then((_res:any) => {
|
|
|
+ const data = _res.data.data
|
|
|
+ console.log(data)
|
|
|
+ Object.assign(dataForm, {
|
|
|
+ dialogueId: data?.dialogueId,
|
|
|
+ messages: data?.messages.content,
|
|
|
+ engagement: dataForm.engagement
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ await apis.getEngagement(studentId, assignmentId)
|
|
|
+ .then((_res:any) => {
|
|
|
+ console.log(_res)
|
|
|
+ Object.assign(dataForm, {
|
|
|
+ dialogueId: dataForm.dialogueId,
|
|
|
+ messages: dataForm.messages,
|
|
|
+ engagement: _res.data.data
|
|
|
+ })
|
|
|
+ }).catch((_err:any) => {
|
|
|
+ console.log(_err)
|
|
|
+ router.push("/login")
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+onMounted( () => {
|
|
|
+ console.log("获取数据")
|
|
|
+ console.log(assignmentId,"assassignmentId的值")
|
|
|
+ fetchData()
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+export default {
|
|
|
+name: "CorrectPage"
|
|
|
+}
|
|
|
+</script>
|