123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <template>
- <div class="mark-manage">
- <div class="part-box part-box-filter part-box-flex">
- <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
- <template v-if="checkPrivilege('condition', 'condition')">
- <secp-select
- v-model="filter"
- defaultSelectExam
- @exam-default="search"
- ></secp-select>
- </template>
- <el-form-item label="完成进度">
- <el-select
- v-model="filter.progressStatus"
- style="width: 120px"
- placeholder="完成进度"
- clearable
- >
- <el-option :value="1">已完成</el-option>
- <el-option :value="0">未完成</el-option>
- </el-select>
- </el-form-item>
- <el-form-item label-width="0px">
- <el-button
- v-if="checkPrivilege('button', 'select')"
- type="primary"
- @click="search"
- >查询</el-button
- >
- </el-form-item>
- </el-form>
- <div class="part-box-action">
- <el-button
- v-if="checkPrivilege('button', 'Export')"
- type="primary"
- @click="toExport"
- >
- 导出评卷员工作量
- </el-button>
- <el-button
- v-if="checkPrivilege('button', 'BatchFinish')"
- type="primary"
- :disabled="!multipleSelection.length"
- @click="toBatchFinish"
- >
- 结束评卷
- </el-button>
- </div>
- </div>
- <div class="part-box part-box-pad">
- <el-table
- ref="TableList"
- :data="dataList"
- @selection-change="handleSelectionChange"
- >
- <el-table-column
- type="selection"
- width="55"
- align="center"
- ></el-table-column>
- <el-table-column prop="courseName" label="课程(代码)" min-width="200">
- <template slot-scope="scope">
- {{ scope.row.courseName }}({{ scope.row.courseCode }})
- </template>
- </el-table-column>
- <el-table-column
- prop="paperNumber"
- label="试卷编号"
- min-width="140"
- ></el-table-column>
- <el-table-column prop="percent" label="完成进度" width="120">
- <span slot-scope="scope">{{ scope.row.percent || 0 }}%</span>
- </el-table-column>
- <el-table-column
- class-name="action-column"
- label="操作"
- width="200"
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button
- v-if="checkPrivilege('link', 'Detail')"
- class="btn-primary"
- type="text"
- @click="toDetail(scope.row)"
- >查看详情</el-button
- >
- <el-button
- v-if="checkPrivilege('link', 'Finish')"
- class="btn-primary"
- type="text"
- @click="toSimpleFinish(scope.row)"
- >结束评卷</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div class="part-page">
- <el-pagination
- background
- layout="total, sizes, prev, pager, next, jumper"
- :pager-count="5"
- :current-page="current"
- :total="total"
- :page-size="size"
- @current-change="toPage"
- @size-change="pageSizeChange"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- import {
- markManageListPage,
- markManageItemFinish,
- markManageListExport,
- } from "../api";
- import { downloadByApi } from "@/plugins/download";
- export default {
- name: "mark-manage",
- components: {},
- data() {
- return {
- filter: {
- semesterId: "",
- examId: "",
- courseCode: "",
- paperNumber: "",
- progressStatus: null,
- },
- current: 1,
- size: this.GLOBAL.pageSize,
- total: 0,
- dataList: [],
- curRow: {},
- multipleSelection: [],
- downloading: false,
- };
- },
- methods: {
- async getList() {
- if (!this.checkPrivilege("list", "list")) return;
- const datas = {
- ...this.filter,
- pageNumber: this.current,
- pageSize: this.size,
- };
- if (datas.progressStatus !== null && datas.progressStatus !== "")
- datas.progressStatus = !!datas.progressStatus;
- const data = await markManageListPage(datas);
- this.dataList = data.records;
- this.total = data.total;
- },
- toPage(page) {
- this.current = page;
- this.getList();
- },
- search() {
- this.toPage(1);
- },
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
- async toExport() {
- if (this.downloading) return;
- this.downloading = true;
- const res = await downloadByApi(() => {
- return markManageListExport({
- ...this.filter,
- });
- }).catch((e) => {
- this.$message.error(e || "下载失败,请重新尝试!");
- });
- this.downloading = false;
- if (!res) return;
- this.$message.success("下载成功!");
- },
- toDetail(row) {
- // TODO:
- console.log(row);
- },
- async toBatchFinish() {
- if (!this.multipleSelection.length) return;
- const confirm = await this.$confirm("确定要结束选中的评卷?", "提示", {
- type: "warning",
- }).catch(() => {});
- if (confirm !== "confirm") return;
- this.toFinish(
- this.multipleSelection[0].examId,
- this.multipleSelection.map((item) => item.paperNumber)
- );
- },
- async toSimpleFinish(row) {
- const confirm = await this.$confirm("确定要结束当前评卷?", "提示", {
- type: "warning",
- }).catch(() => {});
- if (confirm !== "confirm") return;
- this.toFinish(row.examId, [row.paperNumber]);
- },
- async toFinish(examId, paperNumbers) {
- if (!paperNumbers.length) return;
- await markManageItemFinish({
- examId,
- paperNumbers,
- status: "FINISH",
- });
- this.$message.success("操作成功!");
- this.getList();
- },
- toBatchModifySetting() {
- if (!this.multipleSelection.length) {
- this.$message.error("请选择数据");
- return;
- }
- },
- },
- };
- </script>
|