|
@@ -1,376 +0,0 @@
|
|
-<style lang="css"></style>
|
|
|
|
-
|
|
|
|
-<template lang="html">
|
|
|
|
- <div>
|
|
|
|
- <section class="content">
|
|
|
|
- <div class="box box-info">
|
|
|
|
- <div class="box-header with-border">
|
|
|
|
- <h3 class="box-title">请选择评卷工作</h3>
|
|
|
|
- <div class="box-tools pull-right">
|
|
|
|
- <button
|
|
|
|
- type="button"
|
|
|
|
- class="btn btn-box-tool"
|
|
|
|
- data-widget="collapse"
|
|
|
|
- >
|
|
|
|
- <i class="fa fa-minus"></i>
|
|
|
|
- </button>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="box-body">
|
|
|
|
- <el-form
|
|
|
|
- :inline="true"
|
|
|
|
- :model="formSearch"
|
|
|
|
- label-position="right"
|
|
|
|
- label-width="110px"
|
|
|
|
- >
|
|
|
|
- <el-form-item label="课程代码" class="pull-left">
|
|
|
|
- <el-input
|
|
|
|
- placeholder="课程代码"
|
|
|
|
- v-model="formSearch.courseCode"
|
|
|
|
- ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="课程名称" class="pull-left">
|
|
|
|
- <el-input
|
|
|
|
- placeholder="课程名称"
|
|
|
|
- v-model="formSearch.courseName"
|
|
|
|
- ></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item class="pull-right">
|
|
|
|
- <el-button type="primary" icon="search" @click="searchMarkWork"
|
|
|
|
- >查询</el-button
|
|
|
|
- >
|
|
|
|
- <el-button type="success" icon="caret-left" @click="backIndex"
|
|
|
|
- >返回</el-button
|
|
|
|
- >
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <el-table
|
|
|
|
- v-loading="loading"
|
|
|
|
- element-loading-text="拼命加载中"
|
|
|
|
- :data="tableData"
|
|
|
|
- border
|
|
|
|
- style="width: 100%"
|
|
|
|
- >
|
|
|
|
- <el-table-column label="课程名称" width="200">
|
|
|
|
- <div>
|
|
|
|
- <span style="margin-left: 10px">{{ row.courseName }}</span>
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="课程代码" width="250">
|
|
|
|
- <div>
|
|
|
|
- <span style="margin-left: 10px">{{ row.courseCode }}</span>
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="试卷数" width="200">
|
|
|
|
- <div>
|
|
|
|
- <span style="margin-left: 10px">{{ row.totalCount }}</span>
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="进度">
|
|
|
|
- <div>
|
|
|
|
- <span style="margin-left: 10px"
|
|
|
|
- >{{
|
|
|
|
- (
|
|
|
|
- ((row.totalCount - row.leftCount) * 100) /
|
|
|
|
- row.totalCount
|
|
|
|
- ).toFixed(2)
|
|
|
|
- }}%</span
|
|
|
|
- >
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="未评数">
|
|
|
|
- <div>
|
|
|
|
- <span style="margin-left: 10px">{{ row.leftCount }}</span>
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column :context="_self" label="操作">
|
|
|
|
- <div class="pull-left">
|
|
|
|
- <el-button
|
|
|
|
- @click="batchUserPaperInfo(row);"
|
|
|
|
- type="success"
|
|
|
|
- size="mini"
|
|
|
|
- >批量下载</el-button
|
|
|
|
- >
|
|
|
|
- <el-button
|
|
|
|
- @click="uploadMarkScore(row);"
|
|
|
|
- type="info"
|
|
|
|
- size="mini"
|
|
|
|
- >上传评分</el-button
|
|
|
|
- >
|
|
|
|
- </div>
|
|
|
|
- </el-table-column>
|
|
|
|
- </el-table>
|
|
|
|
-
|
|
|
|
- <!-- 导入弹窗 -->
|
|
|
|
- <el-dialog
|
|
|
|
- title="离线分数"
|
|
|
|
- size="tiny"
|
|
|
|
- v-model="batchScoreImportDialog"
|
|
|
|
- >
|
|
|
|
- <el-form>
|
|
|
|
- <el-row>
|
|
|
|
- <el-form-item style="margin-left:20px">
|
|
|
|
- <el-upload
|
|
|
|
- class="form_left"
|
|
|
|
- ref="upload"
|
|
|
|
- accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
|
|
- :action="uploadAction"
|
|
|
|
- :headers="uploadHeaders"
|
|
|
|
- :data="uploadData"
|
|
|
|
- :before-upload="beforeUpload"
|
|
|
|
- :on-progress="uploadProgress"
|
|
|
|
- :on-success="uploadSuccess"
|
|
|
|
- :on-error="uploadError"
|
|
|
|
- :file-list="fileList"
|
|
|
|
- :auto-upload="false"
|
|
|
|
- :multiple="false"
|
|
|
|
- >
|
|
|
|
- <el-button size="small" slot="trigger" type="primary"
|
|
|
|
- >选择文件</el-button
|
|
|
|
- >
|
|
|
|
- <el-button size="small" type="success" @click="submitUpload"
|
|
|
|
- >确认上传</el-button
|
|
|
|
- >
|
|
|
|
- <el-button size="small" type="danger" @click="removeFile"
|
|
|
|
- >清空文件</el-button
|
|
|
|
- >
|
|
|
|
- <!--
|
|
|
|
- <el-button size="small" type="info" @click="exportFile">下载模板</el-button>
|
|
|
|
- -->
|
|
|
|
- <div slot="tip" class="el-upload__tip">
|
|
|
|
- 只能上传xlsx文件
|
|
|
|
- </div>
|
|
|
|
- </el-upload>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-row>
|
|
|
|
- </el-form>
|
|
|
|
- </el-dialog>
|
|
|
|
-
|
|
|
|
- <!-- 导入错误信息列表 -->
|
|
|
|
- <el-dialog title="错误提示" v-model="errDialog">
|
|
|
|
- <div
|
|
|
|
- class="text-danger"
|
|
|
|
- v-for="errMessage in errMessages"
|
|
|
|
- :key="errMessage.row"
|
|
|
|
- >
|
|
|
|
- 第{{ errMessage.row }}行:{{ errMessage.excelErrorType }}
|
|
|
|
- </div>
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="errDialog = false;">确定</el-button>
|
|
|
|
- </span>
|
|
|
|
- </el-dialog>
|
|
|
|
-
|
|
|
|
- <div class="page pull-right">
|
|
|
|
- <el-pagination
|
|
|
|
- background
|
|
|
|
- @current-change="paging"
|
|
|
|
- :current-page="currentPage"
|
|
|
|
- :page-size="pageSize"
|
|
|
|
- layout="total, prev, pager, next, jumper"
|
|
|
|
- :total="total"
|
|
|
|
- >
|
|
|
|
- </el-pagination>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </section>
|
|
|
|
- </div>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
-import { DATA_PROCESS_API } from "../constants/constants";
|
|
|
|
-import { mapState } from "vuex";
|
|
|
|
-export default {
|
|
|
|
- data() {
|
|
|
|
- return {
|
|
|
|
- formSearch: {
|
|
|
|
- courseCode: "",
|
|
|
|
- courseName: ""
|
|
|
|
- },
|
|
|
|
- tableData: [],
|
|
|
|
- currentPage: 1,
|
|
|
|
- pageSize: 10,
|
|
|
|
- total: 0,
|
|
|
|
- loading: false,
|
|
|
|
- batchScoreImportDialog: false,
|
|
|
|
- uploadAction: DATA_PROCESS_API + "/markTasks/batchImportScore",
|
|
|
|
- uploadHeaders: {},
|
|
|
|
- uploadData: { workId: this.$route.params.workId, courseCode: "" },
|
|
|
|
- errMessages: [],
|
|
|
|
- errDialog: false,
|
|
|
|
- fileLoading: false,
|
|
|
|
- fileList: []
|
|
|
|
- };
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- searchMarkWork() {
|
|
|
|
- var self = this;
|
|
|
|
- this.loading = true;
|
|
|
|
- this.workId = this.$route.params.workId;
|
|
|
|
- var userId = this.user.userId;
|
|
|
|
- $.ajax({
|
|
|
|
- type: "GET",
|
|
|
|
- url:
|
|
|
|
- DATA_PROCESS_API +
|
|
|
|
- "/markTasks?workId=" +
|
|
|
|
- self.workId +
|
|
|
|
- "&userId=" +
|
|
|
|
- userId,
|
|
|
|
- async: false,
|
|
|
|
- beforeSend: function(XMLHttpRequest) {
|
|
|
|
- XMLHttpRequest.setRequestHeader("key", self.user.key);
|
|
|
|
- XMLHttpRequest.setRequestHeader("token", self.user.token);
|
|
|
|
- },
|
|
|
|
- success: function(response) {
|
|
|
|
- self.tableData = response;
|
|
|
|
- self.total = self.tableData.length;
|
|
|
|
- self.filterMarkWork();
|
|
|
|
- self.paging();
|
|
|
|
- self.loading = false;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- filterMarkWork() {
|
|
|
|
- var tempData = this.tableData.filter(element => {
|
|
|
|
- var flag = true;
|
|
|
|
- if (this.formSearch.courseCode || this.formSearch.courseName) {
|
|
|
|
- if (this.formSearch.courseCode) {
|
|
|
|
- flag =
|
|
|
|
- flag && element.courseCode.includes(this.formSearch.courseCode);
|
|
|
|
- }
|
|
|
|
- if (this.formSearch.courseName) {
|
|
|
|
- flag =
|
|
|
|
- flag && element.courseName.includes(this.formSearch.courseName);
|
|
|
|
- }
|
|
|
|
- return flag;
|
|
|
|
- } else {
|
|
|
|
- return flag;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- this.tableData = tempData;
|
|
|
|
- this.total = tempData.length;
|
|
|
|
- },
|
|
|
|
- handleCurrentChange(val) {
|
|
|
|
- this.currentPage = val;
|
|
|
|
- this.searchMarkWork();
|
|
|
|
- },
|
|
|
|
- paging() {
|
|
|
|
- var start = (this.currentPage - 1) * this.pageSize;
|
|
|
|
- var end =
|
|
|
|
- this.currentPage * this.pageSize < this.total
|
|
|
|
- ? this.currentPage * this.pageSize
|
|
|
|
- : this.total;
|
|
|
|
- var tempData = [];
|
|
|
|
- console.log(`当前页: ${this.currentPage},开始:${start},结束:${end}`);
|
|
|
|
- for (let i = start; i < end; i++) {
|
|
|
|
- tempData.push(this.tableData[i]);
|
|
|
|
- }
|
|
|
|
- console.log(tempData);
|
|
|
|
- this.tableData = tempData;
|
|
|
|
- },
|
|
|
|
- batchUserPaperInfo(row) {
|
|
|
|
- this.$notify({
|
|
|
|
- message: "离线考试批量评阅",
|
|
|
|
- type: "warning"
|
|
|
|
- });
|
|
|
|
- },
|
|
|
|
- uploadMarkScore(row) {
|
|
|
|
- this.uploadData.courseCode = row.courseCode;
|
|
|
|
- this.batchScoreImportDialog = true;
|
|
|
|
- this.initUpload();
|
|
|
|
- },
|
|
|
|
- backIndex() {
|
|
|
|
- this.$router.push({ path: "/index/mark_setting_work/marking" });
|
|
|
|
- },
|
|
|
|
- //关于导入/导出
|
|
|
|
- beforeUpload(file) {
|
|
|
|
- console.log(file);
|
|
|
|
- },
|
|
|
|
- uploadProgress(event, file, fileList) {
|
|
|
|
- console.log("uploadProgress");
|
|
|
|
- },
|
|
|
|
- uploadSuccess(response, file, fileList) {
|
|
|
|
- console.log("uploadSuccess");
|
|
|
|
- console.log(response);
|
|
|
|
- if (!response || response.length == 0) {
|
|
|
|
- this.$notify({
|
|
|
|
- message: "上传成功",
|
|
|
|
- type: "success"
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- this.errMessages = response;
|
|
|
|
- this.errDialog = true;
|
|
|
|
- }
|
|
|
|
- this.fileLoading = false;
|
|
|
|
- this.batchScoreImportDialog = false;
|
|
|
|
- this.searchMarkWork();
|
|
|
|
- },
|
|
|
|
- uploadError(err, file, fileList) {
|
|
|
|
- var result = err.message.match(/\{.+}/);
|
|
|
|
- var errMessage = JSON.parse(result[0]).errorMsg;
|
|
|
|
- this.$notify({
|
|
|
|
- message: errMessage,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- this.fileLoading = false;
|
|
|
|
- },
|
|
|
|
- initUpload() {
|
|
|
|
- this.fileList = [];
|
|
|
|
- },
|
|
|
|
- checkUpload() {
|
|
|
|
- var fileList = this.$refs.upload.uploadFiles;
|
|
|
|
- if (fileList.length == 0) {
|
|
|
|
- this.$notify({
|
|
|
|
- message: "上传文件不能为空",
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- if (fileList.length > 1) {
|
|
|
|
- this.$notify({
|
|
|
|
- message: "每次只能上传一个文件",
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- for (let file of fileList) {
|
|
|
|
- if (!file.name.endsWith(".xlsx")) {
|
|
|
|
- this.$notify({
|
|
|
|
- message: "上传文件必须为xlsx格式",
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- this.initUpload();
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return true;
|
|
|
|
- },
|
|
|
|
- //确定上传
|
|
|
|
- submitUpload() {
|
|
|
|
- if (!this.checkUpload()) {
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- this.$refs.upload.submit();
|
|
|
|
- this.fileLoading = true;
|
|
|
|
- },
|
|
|
|
- //清空文件
|
|
|
|
- removeFile() {
|
|
|
|
- this.$refs.upload.clearFiles();
|
|
|
|
- },
|
|
|
|
- //下载模板
|
|
|
|
- exportFile() {
|
|
|
|
- window.location.href = "/api/sms/teacher/download";
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- computed: {
|
|
|
|
- ...mapState({ user: state => state.user })
|
|
|
|
- },
|
|
|
|
- created() {
|
|
|
|
- this.uploadHeaders = {
|
|
|
|
- key: this.user.key,
|
|
|
|
- token: this.user.token
|
|
|
|
- };
|
|
|
|
- this.searchMarkWork();
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
-</script>
|
|
|