Explorar o código

考试培训增加导出功能

zjq hai 3 días
pai
achega
0dc4467dc9

+ 55 - 1
src/api/examTrain/statistics.ts

@@ -16,6 +16,24 @@ export const getMissExamUsersData = (params?: object) => {
     });
 };
 
+/**
+ * @description 缺考人员列表导出
+ * @param {object} data
+ */
+export const getMissExamUsersExport = (data: object) => {
+    return request(
+        {
+            url: 'api/v1/UserExam/ExportUnExamUsers',
+            method: 'post',
+            data,
+            responseType: 'blob',
+        },
+        {
+            reduce_data_format: false,
+        }
+    );
+};
+
 /**
  * @description 获取成绩统计分析列表
  * @param {object} params
@@ -28,6 +46,24 @@ export const getScoresAnalysisData = (params?: object) => {
     });
 };
 
+/**
+ * @description 成绩统计分析导出
+ * @param {object} data
+ */
+export const getScoresAnalysisExport = (data: object) => {
+    return request(
+        {
+            url: '/api/v1/UserExam/ExportUserExamResults',
+            method: 'post',
+            data,
+            responseType: 'blob',
+        },
+        {
+            reduce_data_format: false,
+        }
+    );
+};
+
 /**
  * @description 获取培训结果明细表数据
  * @param {object} params
@@ -40,6 +76,24 @@ export const getTrainResultAnalysisData = (params?: object) => {
     });
 };
 
+/**
+ * @description 培训结果明细表导出
+ * @param {object} data
+ */
+export const getTrainResultAnalysisExport = (data: object) => {
+    return request(
+        {
+            url: '/api/v1/TrainRecord/ExportTrainResult',
+            method: 'post',
+            data,
+            responseType: 'blob',
+        },
+        {
+            reduce_data_format: false,
+        }
+    );
+};
+
 /**
  * @description 获取学习完成度数据
  * @param {object} params
@@ -50,4 +104,4 @@ export const getTrainCalcuteAnalysisData = (params?: object) => {
         method: 'post',
         data: params,
     });
-};
+};

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

@@ -33,7 +33,7 @@
 import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
 import { defaultDate } from '@/utils/constants';
-import { getMissExamUsersData } from '@/api/examTrain/statistics';
+import { getMissExamUsersData, getMissExamUsersExport } from '@/api/examTrain/statistics';
 import Other from '@/utils/other';
 
 // 引入组件
@@ -75,6 +75,11 @@ const gridOptions = reactive<any>({
 				handleQuery();
 			},
 		},
+		tools: [{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }],
+	},
+	params: {
+		exportMethod: getMissExamUsersExport,
+		exportParams: requestParams,
 	},
 	customConfig: {
 		storage: true,

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

@@ -49,7 +49,7 @@
 import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
 import { defaultDate } from '@/utils/constants';
-import { getScoresAnalysisData } from '@/api/examTrain/statistics';
+import { getScoresAnalysisData, getScoresAnalysisExport } from '@/api/examTrain/statistics';
 import Other from '@/utils/other';
 
 // 引入组件
@@ -96,6 +96,11 @@ const gridOptions = reactive<any>({
 				handleQuery();
 			},
 		},
+		tools: [{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }],
+	},
+	params: {
+		exportMethod: getScoresAnalysisExport,
+		exportParams: requestParams,
 	},
 	customConfig: {
 		storage: true,

+ 6 - 1
src/views/examTrain/train/statistics/resultAnalysis.vue

@@ -50,7 +50,7 @@ import { defineAsyncComponent, onMounted, reactive, ref } from 'vue';
 import { FormInstance } from 'element-plus';
 import { defaultDate } from '@/utils/constants';
 import Other from '@/utils/other';
-import { getTrainResultAnalysisData, getTrainCalcuteAnalysisData } from '@/api/examTrain/statistics';
+import { getTrainResultAnalysisData, getTrainResultAnalysisExport, getTrainCalcuteAnalysisData } from '@/api/examTrain/statistics';
 
 const StatisticalTime = defineAsyncComponent(() => import('@/components/StatisticalTime/index.vue')); // 日期类型选择组件
 const pagination = defineAsyncComponent(() => import('@/components/ProTable/components/Pagination.vue')); // 分页
@@ -98,6 +98,11 @@ const gridOptions = reactive<any>({
 				handleQuery();
 			},
 		},
+		tools: [{ toolRender: { name: 'exportCurrent' } }, { toolRender: { name: 'exportAll' } }],
+	},
+	params: {
+		exportMethod: getTrainResultAnalysisExport,
+		exportParams: requestParams,
 	},
 	customConfig: {
 		storage: true,