|
@@ -133,6 +133,11 @@
|
|
<el-space wrap>
|
|
<el-space wrap>
|
|
<el-button type="primary" @click="toPage(1)">查询</el-button>
|
|
<el-button type="primary" @click="toPage(1)">查询</el-button>
|
|
<el-button @click="onExport">导出</el-button>
|
|
<el-button @click="onExport">导出</el-button>
|
|
|
|
+ <table-field
|
|
|
|
+ v-model="headFields"
|
|
|
|
+ :fields="tableFields"
|
|
|
|
+ @change="handleFieldChange"
|
|
|
|
+ ></table-field>
|
|
</el-space>
|
|
</el-space>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -146,56 +151,138 @@
|
|
stripe
|
|
stripe
|
|
@sort-change="handleSortChange"
|
|
@sort-change="handleSortChange"
|
|
>
|
|
>
|
|
- <el-table-column prop="examNumber" label="准考证号" width="120" />
|
|
|
|
- <el-table-column prop="name" label="姓名" min-width="100" />
|
|
|
|
- <el-table-column prop="studentCode" label="学号" width="120" sortable />
|
|
|
|
- <el-table-column prop="subjectName" label="科目" min-width="200" />
|
|
|
|
- <el-table-column prop="subjectLevel" label="层次" min-width="100" />
|
|
|
|
- <el-table-column prop="subjectCategory" label="专业类型" width="100" />
|
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
|
+ v-if="checkFieldVisible('examNumber')"
|
|
|
|
+ prop="examNumber"
|
|
|
|
+ label="准考证号"
|
|
|
|
+ width="120"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('name')"
|
|
|
|
+ prop="name"
|
|
|
|
+ label="姓名"
|
|
|
|
+ min-width="100"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('studentCode')"
|
|
|
|
+ prop="studentCode"
|
|
|
|
+ label="学号"
|
|
|
|
+ width="120"
|
|
|
|
+ sortable
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('subjectText')"
|
|
|
|
+ prop="subjectText"
|
|
|
|
+ label="科目"
|
|
|
|
+ min-width="200"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('subjectLevel')"
|
|
|
|
+ prop="subjectLevel"
|
|
|
|
+ label="层次"
|
|
|
|
+ min-width="100"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('subjectCategory')"
|
|
|
|
+ prop="subjectCategory"
|
|
|
|
+ label="专业类型"
|
|
|
|
+ width="100"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('objectiveScore')"
|
|
prop="objectiveScoreString"
|
|
prop="objectiveScoreString"
|
|
label="客观总分"
|
|
label="客观总分"
|
|
width="110"
|
|
width="110"
|
|
sortable
|
|
sortable
|
|
/>
|
|
/>
|
|
<el-table-column
|
|
<el-table-column
|
|
|
|
+ v-if="checkFieldVisible('subjectiveScore')"
|
|
prop="subjectiveScoreString"
|
|
prop="subjectiveScoreString"
|
|
label="主观总分"
|
|
label="主观总分"
|
|
width="110"
|
|
width="110"
|
|
sortable
|
|
sortable
|
|
/>
|
|
/>
|
|
<el-table-column
|
|
<el-table-column
|
|
|
|
+ v-if="checkFieldVisible('totalScore')"
|
|
prop="totalScoreString"
|
|
prop="totalScoreString"
|
|
label="全卷总分"
|
|
label="全卷总分"
|
|
min-width="110"
|
|
min-width="110"
|
|
sortable
|
|
sortable
|
|
/>
|
|
/>
|
|
- <el-table-column label="是否缺考" width="110" sortable>
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('subjectiveScoreList')"
|
|
|
|
+ prop="subjectiveScoreList"
|
|
|
|
+ label="评分明细"
|
|
|
|
+ min-width="200"
|
|
|
|
+ sortable
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('absentText')"
|
|
|
|
+ label="是否缺考"
|
|
|
|
+ width="110"
|
|
|
|
+ sortable
|
|
|
|
+ >
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-tag :type="scope.row.absent ? 'danger' : 'success'">
|
|
<el-tag :type="scope.row.absent ? 'danger' : 'success'">
|
|
{{ scope.row.absent ? '是' : '否' }}
|
|
{{ scope.row.absent ? '是' : '否' }}
|
|
</el-tag>
|
|
</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="是否上传" width="100">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('uploadText')"
|
|
|
|
+ label="是否上传"
|
|
|
|
+ width="100"
|
|
|
|
+ >
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-tag :type="scope.row.upload ? 'success' : 'warning'">
|
|
<el-tag :type="scope.row.upload ? 'success' : 'warning'">
|
|
{{ scope.row.upload ? '是' : '否' }}
|
|
{{ scope.row.upload ? '是' : '否' }}
|
|
</el-tag>
|
|
</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column label="是否违纪" width="100">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('breach')"
|
|
|
|
+ label="是否违纪"
|
|
|
|
+ width="100"
|
|
|
|
+ >
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-tag :type="scope.row.breach ? 'danger' : 'success'">
|
|
<el-tag :type="scope.row.breach ? 'danger' : 'success'">
|
|
{{ scope.row.breach ? '是' : '否' }}
|
|
{{ scope.row.breach ? '是' : '否' }}
|
|
</el-tag>
|
|
</el-tag>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="college" label="学院" min-width="100" sortable />
|
|
|
|
- <el-table-column prop="className" label="班级" min-width="100" />
|
|
|
|
- <el-table-column prop="teacher" label="任课老师" min-width="100" />
|
|
|
|
- <el-table-column prop="examSite" label="考点" min-width="100" sortable />
|
|
|
|
- <el-table-column prop="examRoom" label="考场" min-width="100" />
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('college')"
|
|
|
|
+ prop="college"
|
|
|
|
+ label="学院"
|
|
|
|
+ min-width="100"
|
|
|
|
+ sortable
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('className')"
|
|
|
|
+ prop="className"
|
|
|
|
+ label="班级"
|
|
|
|
+ min-width="100"
|
|
|
|
+ sortable
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('teacher')"
|
|
|
|
+ prop="teacher"
|
|
|
|
+ label="任课老师"
|
|
|
|
+ min-width="100"
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('examSite')"
|
|
|
|
+ prop="examSite"
|
|
|
|
+ label="考点"
|
|
|
|
+ min-width="100"
|
|
|
|
+ sortable
|
|
|
|
+ />
|
|
|
|
+ <el-table-column
|
|
|
|
+ v-if="checkFieldVisible('examRoom')"
|
|
|
|
+ prop="examRoom"
|
|
|
|
+ label="考场"
|
|
|
|
+ min-width="100"
|
|
|
|
+ />
|
|
<el-table-column label="操作" width="100" fixed="right">
|
|
<el-table-column label="操作" width="100" fixed="right">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button type="primary" link @click="viewDetail(scope.row)">
|
|
<el-button type="primary" link @click="viewDetail(scope.row)">
|
|
@@ -216,10 +303,12 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
- import { reactive } from 'vue';
|
|
|
|
|
|
+ import { onMounted, reactive, ref } from 'vue';
|
|
import { getScoreList } from '@/api/score';
|
|
import { getScoreList } from '@/api/score';
|
|
|
|
+ import { getExportFields, saveExportFields } from '@/api/user';
|
|
import { ScoreItem, ScoreListFilter } from '@/api/types/score';
|
|
import { ScoreItem, ScoreListFilter } from '@/api/types/score';
|
|
import useTable from '@/hooks/table';
|
|
import useTable from '@/hooks/table';
|
|
|
|
+ import { downloadExport } from '@/utils/download-export';
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
name: 'ScoreQuery',
|
|
name: 'ScoreQuery',
|
|
@@ -243,16 +332,60 @@
|
|
examRoom: '',
|
|
examRoom: '',
|
|
});
|
|
});
|
|
|
|
|
|
- const { dataList, pagination, loading, toPage, pageSizeChange } =
|
|
|
|
- useTable<ScoreItem>(getScoreList, searchModel, false);
|
|
|
|
|
|
+ const {
|
|
|
|
+ dataList,
|
|
|
|
+ pagination,
|
|
|
|
+ loading,
|
|
|
|
+ toPage,
|
|
|
|
+ pageSizeChange,
|
|
|
|
+ handleSortChange,
|
|
|
|
+ } = useTable<ScoreItem>(getScoreList, searchModel, false);
|
|
|
|
|
|
- function onExport() {
|
|
|
|
- // TODO: 实现导出功能
|
|
|
|
- console.log('导出成绩数据');
|
|
|
|
|
|
+ // 表头配置
|
|
|
|
+ const tableFields = [
|
|
|
|
+ { name: '准考证号', field: 'examNumber' },
|
|
|
|
+ { name: '姓名', field: 'name' },
|
|
|
|
+ { name: '学号', field: 'studentCode' },
|
|
|
|
+ { name: '科目', field: 'subjectText' },
|
|
|
|
+ { name: '层次', field: 'subjectLevel' },
|
|
|
|
+ { name: '专业类型', field: 'subjectCategory' },
|
|
|
|
+ { name: '客观总分', field: 'objectiveScore' },
|
|
|
|
+ { name: '主观总分', field: 'subjectiveScore' },
|
|
|
|
+ { name: '全卷总分', field: 'totalScore' },
|
|
|
|
+ { name: '评分明细', field: 'subjectiveScoreList' },
|
|
|
|
+ { name: '是否缺考', field: 'absentText' },
|
|
|
|
+ { name: '是否上传', field: 'uploadText' },
|
|
|
|
+ { name: '是否违纪', field: 'breach' },
|
|
|
|
+ { name: '学院', field: 'college' },
|
|
|
|
+ { name: '班级', field: 'className' },
|
|
|
|
+ { name: '任课老师', field: 'teacher' },
|
|
|
|
+ { name: '考点', field: 'examSite' },
|
|
|
|
+ { name: '考场', field: 'examRoom' },
|
|
|
|
+ ];
|
|
|
|
+ const defaultCols = tableFields.map((item) => item.field);
|
|
|
|
+ const headFields = ref(defaultCols);
|
|
|
|
+ const checkFieldVisible = (field: string) => {
|
|
|
|
+ return headFields.value.includes(field);
|
|
|
|
+ };
|
|
|
|
+ async function getExportCols() {
|
|
|
|
+ const cols = await getExportFields('SCORE');
|
|
|
|
+ headFields.value = cols && cols.length ? cols : defaultCols;
|
|
|
|
+ }
|
|
|
|
+ async function handleFieldChange() {
|
|
|
|
+ await saveExportFields({ type: 'SCORE', cols: headFields.value });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ async function onExport() {
|
|
|
|
+ await downloadExport('exportScore', searchModel);
|
|
}
|
|
}
|
|
|
|
|
|
function viewDetail(row: ScoreItem) {
|
|
function viewDetail(row: ScoreItem) {
|
|
// TODO: 实现查看详情功能
|
|
// TODO: 实现查看详情功能
|
|
console.log('查看成绩详情', row);
|
|
console.log('查看成绩详情', row);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ onMounted(async () => {
|
|
|
|
+ await getExportCols();
|
|
|
|
+ await toPage(1);
|
|
|
|
+ });
|
|
</script>
|
|
</script>
|