|
|
@@ -251,9 +251,23 @@
|
|
|
score-template="{value} 分"
|
|
|
/>
|
|
|
</div>
|
|
|
- <el-button style="background-color:#597D3B;color:white" @click="submitComment" class="submit-button"
|
|
|
- >提交评语</el-button
|
|
|
- >
|
|
|
+ <div class="correction-actions">
|
|
|
+ <div class="button-container">
|
|
|
+ <el-button
|
|
|
+ style="background-color:#597D3B;color:white;width:300px"
|
|
|
+ @click="submitComment"
|
|
|
+ class="submit-button"
|
|
|
+ :loading="submitting"
|
|
|
+ >
|
|
|
+ 提交评语
|
|
|
+ </el-button>
|
|
|
+
|
|
|
+ <!-- 批改进度数字显示 -->
|
|
|
+ <div class="progress-numbers">
|
|
|
+ {{ correctionStats.correctNumber }}/{{ correctionStats.engageNumber }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -261,7 +275,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, onMounted, onBeforeUnmount, nextTick, defineProps } from "vue";
|
|
|
+import { ref, onMounted, onBeforeUnmount, nextTick, defineProps, computed } from "vue";
|
|
|
import doubaoApis from "@/apis/doubao";
|
|
|
import engagementApis from "@/apis/engagement";
|
|
|
import mediaApis from "@/apis/media";
|
|
|
@@ -321,6 +335,44 @@ const engagement = ref({
|
|
|
|
|
|
const isSuggestionLoading = ref(true);
|
|
|
const isVideoEmotionLoading = ref(true);
|
|
|
+const submitting = ref(false);
|
|
|
+
|
|
|
+// 批改进度统计
|
|
|
+const correctionStats = ref({
|
|
|
+ engageNumber: 0,
|
|
|
+ correctNumber: 0
|
|
|
+});
|
|
|
+
|
|
|
+// 计算批改进度百分比
|
|
|
+const progressPercentage = computed(() => {
|
|
|
+ if (correctionStats.value.engageNumber === 0) return 0;
|
|
|
+ return Math.round((correctionStats.value.correctNumber / correctionStats.value.engageNumber) * 100);
|
|
|
+});
|
|
|
+
|
|
|
+// 获取批改进度统计
|
|
|
+const fetchCorrectionStats = async () => {
|
|
|
+ try {
|
|
|
+ const res = await engagementApis.getAssignmentCorrectionStats(props.assignmentId);
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ correctionStats.value = res.data.data;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取批改进度失败:', error);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 获取下一个学生作业ID
|
|
|
+const getNextStudentAssignment = async () => {
|
|
|
+ try {
|
|
|
+ const res = await engagementApis.getNextStudentAssignment(props.assignmentId, props.userId);
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ return res.data.data;
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.error('获取下一个学生失败:', error);
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+};
|
|
|
|
|
|
const emotionChartRef = ref(null);
|
|
|
let emotionChartInstance = null;
|
|
|
@@ -376,6 +428,8 @@ const submitComment = async () => {
|
|
|
ElMessage.warning("请填写评语和评分");
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ submitting.value = true;
|
|
|
try {
|
|
|
// 调用 API 提交评语和评分
|
|
|
const response = await engagementApis.engagementCorrect(
|
|
|
@@ -388,12 +442,34 @@ const submitComment = async () => {
|
|
|
);
|
|
|
if (response.data.code === 200) {
|
|
|
ElMessage.success("评语提交成功");
|
|
|
+
|
|
|
+ // 获取下一个学生作业ID
|
|
|
+ const nextStudentId = await getNextStudentAssignment();
|
|
|
+
|
|
|
+ if (nextStudentId) {
|
|
|
+ // 跳转到下一个学生的作业
|
|
|
+ router.push({
|
|
|
+ path: `/home/assignment/${props.assignmentId}/airecord`,
|
|
|
+ query: {
|
|
|
+ userId: nextStudentId,
|
|
|
+ assignmentId: props.assignmentId,
|
|
|
+ assignmentName: props.assignmentName
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ElMessage.success("已自动跳转到下一个学生");
|
|
|
+ } else {
|
|
|
+ // 没有下一个学生,跳转到作业列表
|
|
|
+ router.push(`/home/myCorrect/assignment/${props.assignmentId}`);
|
|
|
+ ElMessage.info("已是最后一个学生,批改完成");
|
|
|
+ }
|
|
|
} else {
|
|
|
ElMessage.error("评语提交失败");
|
|
|
}
|
|
|
} catch (error) {
|
|
|
console.error("提交评语失败:", error);
|
|
|
ElMessage.error("网络错误,请重试");
|
|
|
+ } finally {
|
|
|
+ submitting.value = false;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -849,6 +925,10 @@ onMounted(async () => {
|
|
|
score: engagementRes.data.data.score || 0,
|
|
|
remark: engagementRes.data.data.remark || "",
|
|
|
};
|
|
|
+
|
|
|
+ // 获取批改进度统计
|
|
|
+ await fetchCorrectionStats();
|
|
|
+
|
|
|
// 渲染每个对话的图表
|
|
|
nextTick(() => {
|
|
|
renderAvgScoreChart();
|
|
|
@@ -1106,4 +1186,24 @@ onMounted(async () => {
|
|
|
.el-card {
|
|
|
margin-bottom: 30px !important;
|
|
|
}
|
|
|
+
|
|
|
+.correction-actions {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.button-container {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ gap: 8px;
|
|
|
+}
|
|
|
+
|
|
|
+.progress-numbers {
|
|
|
+ font-size: 13px;
|
|
|
+ color: #999;
|
|
|
+ font-weight: 400;
|
|
|
+ margin-left: 0;
|
|
|
+}
|
|
|
</style>
|