ソースを参照

Merge branch 'refs/heads/test/exam' into dev

zhangchong 6 日 前
コミット
f8c1768937

+ 15 - 1
src/views/examTrain/exam/statistics/missExamUsers.vue

@@ -15,6 +15,15 @@
 						</el-form-item>
 					</el-form>
 				</template>
+				<template #pager>
+					<pagination
+						@pagination="queryList"
+						:total="state.total"
+						v-model:current-page="state.queryParams.PageIndex"
+						v-model:page-size="state.queryParams.PageSize"
+						:disabled="state.loading"
+					/>
+				</template>
 			</vxe-grid>
 		</div>
 	</div>
@@ -29,12 +38,16 @@ import Other from '@/utils/other';
 
 // 引入组件
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 
 // 定义变量内容
 const state = reactive<any>({
 	loading: false,
+	total: 0, // 总数
 	queryParams: {
 		// 查询参数
+		PageIndex: 1,
+		PageSize: 20,
 		crTime: defaultDate, // 时间默认今天开始到今天结束
 		startTime: null,
 		endTime: null,
@@ -108,7 +121,8 @@ const queryList = () => {
 	getMissExamUsersData(requestParams.value)
 		.then((res) => {
 			state.loading = false;
-			gridOptions.data = res.result.item ?? [];
+			gridOptions.data = res.result.items ?? [];
+			state.total = res?.result.pagination.totalCount ?? 0;
 			gridOptions.loading = false;
 		})
 		.finally(() => {

+ 15 - 1
src/views/examTrain/exam/statistics/scoresAnalysis.vue

@@ -24,6 +24,15 @@
 						</el-form-item>
 					</el-form>
 				</template>
+				<template #pager>
+					<pagination
+						@pagination="queryList"
+						:total="state.total"
+						v-model:current-page="state.queryParams.PageIndex"
+						v-model:page-size="state.queryParams.PageSize"
+						:disabled="state.loading"
+					/>
+				</template>
 			</vxe-grid>
 		</div>
 	</div>
@@ -38,12 +47,16 @@ import Other from '@/utils/other';
 
 // 引入组件
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
 
 // 定义变量内容
 const state = reactive<any>({
 	loading: false,
+	total: 0, // 总数
 	queryParams: {
 		// 查询参数
+		PageIndex: 1,
+		PageSize: 20,
 		crTime: defaultDate, // 时间默认今天开始到今天结束
         keyword: '',
         minScore: 0,
@@ -141,7 +154,8 @@ const queryList = () => {
 	getScoresAnalysisData(requestParams.value)
 		.then((res) => {
 			state.loading = false;
-			gridOptions.data = res.result.item ?? [];
+			gridOptions.data = res.result.items ?? [];
+			state.total = res?.result.pagination.totalCount ?? 0;
 			gridOptions.loading = false;
 		})
 		.finally(() => {

+ 18 - 3
src/views/examTrain/train/statistics/resultAnalysis.vue

@@ -18,7 +18,17 @@
 			<el-row :gutter="20">
                 <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
 					<div style="height: 70vh">
-						<vxe-grid v-bind="gridOptions" ref="gridRef"> </vxe-grid>
+						<vxe-grid v-bind="gridOptions" ref="gridRef">
+							<template #pager>
+								<pagination
+									@pagination="queryList"
+									:total="state.total"
+									v-model:current-page="state.queryParams.PageIndex"
+									v-model:page-size="state.queryParams.PageSize"
+									:disabled="state.loading"
+								/>
+							</template>
+						</vxe-grid>
 					</div>
 				</el-col>
 				<el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
@@ -36,12 +46,16 @@ import Other from '@/utils/other';
 import { getTrainResultAnalysisData, getTrainCalcuteAnalysisData } from '@/api/examTrain/statistics';
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
+const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
+
 // 定义变量内容
 const ruleFormRef = ref<RefType>(); // 表单ref
 const state = reactive<any>({
 	queryParams: {
 		// 查询条件
-		crTime: defaultDate, //
+		PageIndex: 1,
+		PageSize: 20,
+		crTime: defaultDate, 
 		startTime: null,
 		endTime: null,
         keyword: ''
@@ -100,7 +114,8 @@ const queryList = async () => {
     Reflect.deleteProperty(requestParams.value, 'crTime');
     getTrainResultAnalysisData(requestParams.value)
     .then((res) => {
-        gridOptions.data = res.result.item ?? [];
+        gridOptions.data = res.result.items ?? [];
+		state.total = res?.result.pagination.totalCount ?? 0;
     });
     getTrainCalcuteAnalysisData(requestParams.value)
     .then((res) => {

+ 4 - 1
src/views/examTrain/train/userTrain/study.vue

@@ -9,12 +9,13 @@
                     </el-tabs>
                     <el-scrollbar style="height: calc(100% - 100px);" ref="scrollBarRef">
                         <el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '0'">
-                            <p class="knowladgeDtosItem" v-for="(item) in state.trainPracticeKnowladgeDtos" @click="onClickKnowladge(item.id)">
+                            <p class="knowladgeDtosItem" v-if="state.trainPracticeKnowladgeDtos.length > 0" v-for="(item) in state.trainPracticeKnowladgeDtos" @click="onClickKnowladge(item.id)">
                                 <el-icon color="#409efc" class="el-input__icon">
                                     <ele-Notebook />
                                 </el-icon>
                                 {{ item.title }}
                             </p>
+                            <el-empty v-else description="暂无数据" />
                         </el-skeleton>
                         <el-skeleton :loading="state.loading" animated :rows="10" v-if="state.activeName === '1'">
                             <p class="knowladgeDtosItem" v-for="(item) in state.trainPracticeQuestionsDtos" @click="onSelQuestion(item.id)">
@@ -209,6 +210,8 @@ import { fileDownloadByUrl } from '@/api/public/file';
 import { getTrainInfo, answerUserTrain, getTrainQuestion, submitUserTrain } from '@/api/examTrain/userTrain';
 import { KnowledgeInfo} from '@/api/knowledge';
 
+const AnnexList = defineAsyncComponent(() => import('@/components/AnnexList/index.vue')); // 附件列表
+
 const router = useRouter(); //路由
 const route = useRoute(); //  获取路由参数
 const horizontal = ref(false);