|
@@ -33,7 +33,7 @@
|
|
|
>
|
|
|
<template v-if="state.question.data?.length > 0">
|
|
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
|
|
|
- <template v-for="(item, index) in state.question.data">
|
|
|
+ <template v-for="(item, index) in dataCpt">
|
|
|
<div
|
|
|
class="question-card overflow-hidden rounded-xl border border-[#e5e7eb] bg-white shadow-sm"
|
|
|
>
|
|
@@ -73,7 +73,7 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<!-- 视频解析列表 -->
|
|
|
- <div>
|
|
|
+ <div v-if="item.questionVideo?.length > 0">
|
|
|
<div class="mb-2 text-sm font-medium text-gray-800">
|
|
|
视频解析:
|
|
|
</div>
|
|
@@ -102,10 +102,11 @@
|
|
|
<div class="q-pa-lg flex-center flex">
|
|
|
<q-pagination
|
|
|
v-model="state.question.page"
|
|
|
- :max="Math.ceil(state.question.total / state.question.size)"
|
|
|
+ :max="
|
|
|
+ Math.ceil(state.question.data.length / state.question.size)
|
|
|
+ "
|
|
|
:max-pages="6"
|
|
|
boundary-numbers
|
|
|
- @update:modelValue="initQuestion"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -185,7 +186,10 @@
|
|
|
import { computed, onBeforeMount, onMounted, reactive, ref } from 'vue'
|
|
|
import StudyLayout from '@/views/study/components/study-layout.vue'
|
|
|
import { Plus } from '@element-plus/icons-vue'
|
|
|
-import { trainingCampQuestionList } from '@/api/modules/study'
|
|
|
+import {
|
|
|
+ trainingCampPaperConfigGetPaperMarkInfoByPlanId,
|
|
|
+ trainingCampQuestionList,
|
|
|
+} from '@/api/modules/study'
|
|
|
import { useAppStore } from '@/stores'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
|
@@ -206,24 +210,22 @@ const state: any = reactive({
|
|
|
const initQuestion = () => {
|
|
|
state.question.loading = true
|
|
|
state.question.data = []
|
|
|
- trainingCampQuestionList({
|
|
|
- pageNum: state.question.page,
|
|
|
- pageSize: state.question.size,
|
|
|
- category: AppStore.studentInfo?.grade,
|
|
|
- subject: route.meta.subjectId,
|
|
|
- planId: route.query.planId || '',
|
|
|
+ trainingCampPaperConfigGetPaperMarkInfoByPlanId(route.query.planId, {
|
|
|
correct: state.question.type !== '错题',
|
|
|
- studentId: AppStore.studentInfo?.studentId,
|
|
|
})
|
|
|
- .then(({ rows, total }: any) => {
|
|
|
- state.question.data = rows
|
|
|
- state.question.total = total
|
|
|
+ .then(({ data }: any) => {
|
|
|
+ state.question.data = data.questionList
|
|
|
})
|
|
|
.finally(() => {
|
|
|
state.question.loading = false
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+const dataCpt = computed(() => {
|
|
|
+ return state.question.data.slice(
|
|
|
+ (state.question.page - 1) * state.question.size,
|
|
|
+ state.question.page * state.question.size,
|
|
|
+ )
|
|
|
+})
|
|
|
onMounted(() => {
|
|
|
initQuestion()
|
|
|
})
|