فهرست منبع

reactor:调整考试培训得培训模板目录;

zhangchong 6 روز پیش
والد
کامیت
daa329d48e
2فایلهای تغییر یافته به همراه49 افزوده شده و 25 حذف شده
  1. 38 24
      src/views/examTrain/exam/statistics/scoresAnalysis.vue
  2. 11 1
      src/views/examTrain/train/statistics/resultAnalysis.vue

+ 38 - 24
src/views/examTrain/exam/statistics/scoresAnalysis.vue

@@ -1,19 +1,26 @@
 <template>
 	<div class="snapshot-statistics-grid-handle-container layout-padding">
 		<div class="layout-padding-auto layout-padding-view pd20">
-			<vxe-grid v-bind="gridOptions" ref="gridRef">
+			<vxe-grid v-bind="gridOptions" ref="gridRef"  v-on="gridEvents">
 				<template #form>
 					<el-form :model="state.queryParams" ref="ruleFormRef" @submit.native.prevent inline :disabled="gridOptions.loading">
 						<el-form-item prop="crTime">
 							<statistical-time v-model="state.queryParams.crTime" @change="handleQuery" ref="statisticalTimeRef" :disabled="state.loading" />
 						</el-form-item>
-                        <el-form-item label="考试标题" prop="keyword">
-                            <el-input v-model="state.queryParams.keyword" placeholder="考试标题" clearable @change="handleQuery" :disabled="state.loading" class="keyword-input" />
-                        </el-form-item>
-                        <el-form-item label="考试分数>=" prop="minScore">
-                            <el-input-number v-model="state.queryParams.minScore" :min="0" class="w100" ></el-input-number>
-                        </el-form-item>
-                        <!-- <el-form-item label="考试分数<=" prop="maxScore">
+						<el-form-item label="考试标题" prop="keyword">
+							<el-input
+								v-model="state.queryParams.keyword"
+								placeholder="考试标题"
+								clearable
+								@change="handleQuery"
+								:disabled="state.loading"
+								class="keyword-input"
+							/>
+						</el-form-item>
+						<el-form-item label="考试分数>=" prop="minScore">
+							<el-input-number v-model="state.queryParams.minScore" :min="0" class="w100"></el-input-number>
+						</el-form-item>
+						<!-- <el-form-item label="考试分数<=" prop="maxScore">
                             <el-input-number v-model="state.queryParams.maxScore" :min="0" class="w100" ></el-input-number>
                         </el-form-item> -->
 						<el-form-item>
@@ -58,12 +65,14 @@ const state = reactive<any>({
 		PageIndex: 1,
 		PageSize: 20,
 		crTime: defaultDate, // 时间默认今天开始到今天结束
-        keyword: '',
-        minScore: 0,
-        maxScore: null,
+		keyword: '',
+		minScore: 0,
+		maxScore: null,
 		startTime: null,
 		endTime: null,
 		IndustryId: null,
+		sortField: null,
+		sortRule: null,
 	},
 });
 
@@ -91,6 +100,9 @@ const gridOptions = reactive<any>({
 	customConfig: {
 		storage: true,
 	},
+	sortConfig: {
+		remote: true,
+	},
 	id: 'examTrainExamStatisticsScoresAnalysis',
 	rowConfig: { isHover: true, height: 30, isCurrent: true, useKey: true },
 	height: 'auto',
@@ -100,39 +112,33 @@ const gridOptions = reactive<any>({
 			field: 'userName',
 			title: '参考人员',
 			width: 200,
-			fixed: 'left',
 		},
 		{
 			field: 'orgName',
 			title: '部门名称',
-			fixed: 'left',
 			width: 200,
 		},
-        {
+		{
 			field: 'examName',
 			title: '考试标题',
-			fixed: 'left',
 			minWidth: 200,
 		},
-        {
+		{
 			field: 'totalScore',
 			title: '考试总分',
-			fixed: 'left',
-            sortable: true,
+			sortable: true,
 			width: 120,
 		},
-        {
+		{
 			field: 'cutoffScore',
 			title: '合格分数',
-			fixed: 'left',
-            sortable: true,
+			sortable: true,
 			width: 120,
 		},
-        {
+		{
 			field: 'score',
 			title: '考试分数',
-			fixed: 'left',
-            sortable: true,
+			sortable: true,
 			width: 120,
 		},
 	],
@@ -163,6 +169,14 @@ const queryList = () => {
 			gridOptions.loading = false;
 		});
 };
+const gridEvents = {
+	sortChange(val: any) {
+		state.queryParams.sortField = val.order ? val.field : null;
+		// 0 升序 1 降序
+		state.queryParams.sortRule = val.order ? (val.order == 'desc' ? 1 : 0) : null;
+		handleQuery();
+	},
+};
 // 重置表单
 const ruleFormRef = ref<any>(null); // 表单ref
 const statisticalTimeRef = ref<RefType>();

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

@@ -25,7 +25,7 @@
 			<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 v-bind="gridOptions" ref="gridRef" v-on="gridEvents">
 							<template #pager>
 								<pagination
 									@pagination="queryList"
@@ -66,6 +66,8 @@ const state = reactive<any>({
 		startTime: null,
 		endTime: null,
 		keyword: '',
+		sortField: null,
+		sortRule: null,
 	},
 	tableData: [], //表单
 	loading: false, // 加载
@@ -137,6 +139,14 @@ const queryList = () => {
 		state.loading = false;
 	});
 };
+const gridEvents = {
+	sortChange(val: any) {
+		state.queryParams.sortField = val.order ? val.field : null;
+		// 0 升序 1 降序
+		state.queryParams.sortRule = val.order ? (val.order == 'desc' ? 1 : 0) : null;
+		handleQuery();
+	},
+};
 /** 重置按钮操作 */
 const statisticalTimeRef = ref<RefType>();
 const resetQuery = (formEl: FormInstance | undefined) => {