|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
<div class="student-manage">
|
|
<div class="student-manage">
|
|
- <div class="part-box part-box-filter part-box-flex">
|
|
|
|
|
|
+ <div class="part-box part-box-filter">
|
|
<el-form ref="FilterForm" label-position="left" label-width="90px" inline>
|
|
<el-form ref="FilterForm" label-position="left" label-width="90px" inline>
|
|
<sec-select
|
|
<sec-select
|
|
v-model="filter"
|
|
v-model="filter"
|
|
@@ -24,28 +24,53 @@
|
|
>
|
|
>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <div class="part-box-action">
|
|
|
|
- <el-button
|
|
|
|
- v-if="checkPrivilege('button', 'BatchDelete')"
|
|
|
|
- type="danger"
|
|
|
|
- icon="el-icon-delete"
|
|
|
|
- @click="toBatchDelete"
|
|
|
|
- >批量删除</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- v-if="checkPrivilege('button', 'import')"
|
|
|
|
- type="success"
|
|
|
|
- icon="el-icon-upload"
|
|
|
|
- @click="toImportStudent"
|
|
|
|
- >导入考生</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- v-if="checkPrivilege('button', 'add')"
|
|
|
|
- type="primary"
|
|
|
|
- icon="el-icon-circle-plus-outline"
|
|
|
|
- @click="toAdd"
|
|
|
|
- >新增考生</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ <div class="box-justify" style="padding-bottom: 15px">
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-s-order"
|
|
|
|
+ @click="toDataTask('EXAM_STUDENT_IMPORT')"
|
|
|
|
+ >导入结果</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-s-order"
|
|
|
|
+ @click="toDataTask('EXAM_STUDENT_IMPORT')"
|
|
|
|
+ >pdf生成结果</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'BatchDelete')"
|
|
|
|
+ type="danger"
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
+ @click="toBatchDelete"
|
|
|
|
+ >批量删除</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ type="success"
|
|
|
|
+ icon="el-icon-upload"
|
|
|
|
+ @click="toImportStudent"
|
|
|
|
+ >导入考生</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'import')"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-document"
|
|
|
|
+ @click="toBuildPdf"
|
|
|
|
+ >生成PDF</el-button
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ v-if="checkPrivilege('button', 'add')"
|
|
|
|
+ type="primary"
|
|
|
|
+ icon="el-icon-circle-plus-outline"
|
|
|
|
+ @click="toAdd"
|
|
|
|
+ >新增考生</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="part-box part-box-pad">
|
|
<div class="part-box part-box-pad">
|
|
@@ -59,18 +84,62 @@
|
|
width="55"
|
|
width="55"
|
|
align="center"
|
|
align="center"
|
|
></el-table-column>
|
|
></el-table-column>
|
|
- <el-table-column prop="courseName" label="课程名称"></el-table-column>
|
|
|
|
- <el-table-column prop="courseCode" label="课程代码"></el-table-column>
|
|
|
|
- <el-table-column prop="studentName" label="姓名"></el-table-column>
|
|
|
|
- <el-table-column prop="studentCode" label="学号"></el-table-column>
|
|
|
|
- <el-table-column prop="collegeName" label="学院"></el-table-column>
|
|
|
|
- <el-table-column prop="majorName" label="专业"></el-table-column>
|
|
|
|
- <el-table-column prop="className" label="班级"></el-table-column>
|
|
|
|
- <el-table-column prop="teacher" label="任课老师"></el-table-column>
|
|
|
|
- <el-table-column prop="teachClass" label="教学班"></el-table-column>
|
|
|
|
- <el-table-column prop="score" label="成绩"></el-table-column>
|
|
|
|
- <el-table-column prop="examRoom" label="考场"></el-table-column>
|
|
|
|
- <el-table-column prop="remark" label="备注"></el-table-column>
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="courseName"
|
|
|
|
+ label="课程名称"
|
|
|
|
+ min-width="200"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="courseCode"
|
|
|
|
+ label="课程代码"
|
|
|
|
+ width="120"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="studentName"
|
|
|
|
+ label="姓名"
|
|
|
|
+ min-width="140"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="studentCode"
|
|
|
|
+ label="学号"
|
|
|
|
+ width="140"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="collegeName"
|
|
|
|
+ label="学院"
|
|
|
|
+ min-width="120"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="majorName"
|
|
|
|
+ label="专业"
|
|
|
|
+ min-width="120"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="className"
|
|
|
|
+ label="班级"
|
|
|
|
+ min-width="120"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="teacher"
|
|
|
|
+ label="任课老师"
|
|
|
|
+ min-width="140"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="teachClass"
|
|
|
|
+ label="教学班"
|
|
|
|
+ min-width="120"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column prop="score" label="成绩" width="60"></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="examRoom"
|
|
|
|
+ label="考场"
|
|
|
|
+ min-width="140"
|
|
|
|
+ ></el-table-column>
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="remark"
|
|
|
|
+ label="备注"
|
|
|
|
+ width="160"
|
|
|
|
+ ></el-table-column>
|
|
<el-table-column prop="createTime" label="创建时间" width="170">
|
|
<el-table-column prop="createTime" label="创建时间" width="170">
|
|
<span slot-scope="scope">{{
|
|
<span slot-scope="scope">{{
|
|
scope.row.createTime | timestampFilter
|
|
scope.row.createTime | timestampFilter
|
|
@@ -129,22 +198,35 @@
|
|
examId: filter.examId,
|
|
examId: filter.examId,
|
|
}"
|
|
}"
|
|
:format="['xls', 'xlsx']"
|
|
:format="['xls', 'xlsx']"
|
|
- :download-url="downloadUrl"
|
|
|
|
|
|
+ :download-handle="downloadTemplate"
|
|
:download-filename="dfilename"
|
|
:download-filename="dfilename"
|
|
:auto-upload="false"
|
|
:auto-upload="false"
|
|
@upload-success="uploadSuccess"
|
|
@upload-success="uploadSuccess"
|
|
- ></import-file>
|
|
|
|
|
|
+ >
|
|
|
|
+ </import-file>
|
|
|
|
+ <!-- DataTaskDialog -->
|
|
|
|
+ <data-task-dialog
|
|
|
|
+ ref="DataTaskDialog"
|
|
|
|
+ :task-type="taskType"
|
|
|
|
+ ></data-task-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { studentListQuery, deleteStudent } from "../api";
|
|
|
|
|
|
+import {
|
|
|
|
+ studentListQuery,
|
|
|
|
+ deleteStudent,
|
|
|
|
+ buildStudentPdf,
|
|
|
|
+ exportStudentTemplate,
|
|
|
|
+} from "../api";
|
|
import ModifyStudent from "../components/ModifyStudent.vue";
|
|
import ModifyStudent from "../components/ModifyStudent.vue";
|
|
import ImportFile from "../../../components/ImportFile.vue";
|
|
import ImportFile from "../../../components/ImportFile.vue";
|
|
|
|
+import DataTaskDialog from "../components/DataTaskDialog.vue";
|
|
|
|
+import { downloadByApi } from "@/plugins/download";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "student-manage",
|
|
name: "student-manage",
|
|
- components: { ModifyStudent, ImportFile },
|
|
|
|
|
|
+ components: { ModifyStudent, ImportFile, DataTaskDialog },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
filter: {
|
|
filter: {
|
|
@@ -159,9 +241,10 @@ export default {
|
|
dataList: [],
|
|
dataList: [],
|
|
curRow: {},
|
|
curRow: {},
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
|
|
+ taskType: "",
|
|
// import
|
|
// import
|
|
|
|
+ tempDownloading: false,
|
|
uploadUrl: "/api/admin/exam/student/import",
|
|
uploadUrl: "/api/admin/exam/student/import",
|
|
- downloadUrl: "/temps/studentTemplate.xlsx",
|
|
|
|
dfilename: "考生导入模板.xlsx",
|
|
dfilename: "考生导入模板.xlsx",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -230,9 +313,31 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {});
|
|
.catch(() => {});
|
|
},
|
|
},
|
|
|
|
+ async toBuildPdf() {
|
|
|
|
+ await buildStudentPdf();
|
|
|
|
+ this.$message.success("任务已经提交,后台正在生成pdf!");
|
|
|
|
+ },
|
|
|
|
+ toDataTask(taskType) {
|
|
|
|
+ this.taskType = taskType;
|
|
|
|
+ this.$refs.DataTaskDialog.open();
|
|
|
|
+ },
|
|
// import
|
|
// import
|
|
|
|
+ async downloadTemplate() {
|
|
|
|
+ if (this.tempDownloading) return;
|
|
|
|
+ this.tempDownloading = true;
|
|
|
|
+
|
|
|
|
+ const res = await downloadByApi(() => {
|
|
|
|
+ return exportStudentTemplate();
|
|
|
|
+ }).catch((e) => {
|
|
|
|
+ this.$message.error(e || "下载失败,请重新尝试!");
|
|
|
|
+ });
|
|
|
|
+ this.tempDownloading = false;
|
|
|
|
+
|
|
|
|
+ if (!res) return;
|
|
|
|
+ this.$message.success("下载成功!");
|
|
|
|
+ },
|
|
uploadSuccess() {
|
|
uploadSuccess() {
|
|
- this.$message.success("导入成功");
|
|
|
|
|
|
+ this.$message.success("文件上传成功,后台正在导入!");
|
|
this.getList();
|
|
this.getList();
|
|
},
|
|
},
|
|
},
|
|
},
|