|
@@ -1,7 +1,10 @@
|
|
|
<template>
|
|
|
<div class="task-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="85px" inline>
|
|
|
+ <el-form-item>
|
|
|
+ <h3 class="filter-title">选择考试</h3>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="档案:">
|
|
|
<archives-select
|
|
|
v-model="filter.paperArchivesId"
|
|
@@ -9,14 +12,6 @@
|
|
|
>
|
|
|
</archives-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="课程:">
|
|
|
- <course-select
|
|
|
- v-model="filter.courseCode"
|
|
|
- :filter-data="filter"
|
|
|
- placeholder="请选择课程"
|
|
|
- >
|
|
|
- </course-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item label-width="0px">
|
|
|
<el-button type="primary" @click="search">查询</el-button>
|
|
|
<el-button v-if="openBarCode" type="primary" @click="toSetOrcArea"
|
|
@@ -25,119 +20,62 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
+ <el-row class="task-parts" :gutter="16">
|
|
|
+ <el-col :span="16">
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
+ <div class="task-part-head">
|
|
|
+ <h3>试卷扫描</h3>
|
|
|
+ </div>
|
|
|
+ <div class="task-part-body box-justify">
|
|
|
+ <div class="task-chart"></div>
|
|
|
+ <div class="task-infos">
|
|
|
+ <div class="task-info-item">
|
|
|
+ <div class="task-info-title">
|
|
|
+ <i class="icon icon-person-grid"></i>
|
|
|
+ <span>考生总数</span>
|
|
|
+ </div>
|
|
|
+ <div class="task-info-cont">123</div>
|
|
|
+ </div>
|
|
|
+ <div class="task-info-item">
|
|
|
+ <div class="task-info-title">
|
|
|
+ <i class="icon icon-right-grid"></i>
|
|
|
+ <span>已扫人数/张数</span>
|
|
|
+ </div>
|
|
|
+ <div class="task-info-cont">1231</div>
|
|
|
+ </div>
|
|
|
+ <div class="task-info-item">
|
|
|
+ <div class="task-info-title">
|
|
|
+ <i class="icon icon-close-grid"></i>
|
|
|
+ <span>未扫人数</span>
|
|
|
+ </div>
|
|
|
+ <div class="task-info-cont">111</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="task-part-foot">
|
|
|
+ <div class="task-btn">
|
|
|
+ <span>开始扫描</span>
|
|
|
+ <i class="icon icon-narrow-right"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="8">
|
|
|
+ <div class="part-box part-box-pad">
|
|
|
+ <div class="task-part-head">
|
|
|
+ <h3>其他文件扫描</h3>
|
|
|
+ </div>
|
|
|
+ <div class="task-part-body"></div>
|
|
|
+ <div class="task-part-foot">
|
|
|
+ <div class="task-btn">
|
|
|
+ <span>开始扫描</span>
|
|
|
+ <i class="icon icon-narrow-right"></i>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
|
|
|
- <div class="mb-4 tab-btns">
|
|
|
- <el-button
|
|
|
- v-for="tab in tabs"
|
|
|
- :key="tab.val"
|
|
|
- size="medium"
|
|
|
- :type="curTab == tab.val ? 'primary' : 'default'"
|
|
|
- @click="selectMenu(tab.val)"
|
|
|
- >{{ tab.name }}
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="part-box part-box-pad">
|
|
|
- <el-table ref="TableList" size="medium" :data="dataList">
|
|
|
- <el-table-column
|
|
|
- prop="id"
|
|
|
- label="任务ID"
|
|
|
- min-width="160"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="scanTaskName"
|
|
|
- label="任务名称"
|
|
|
- min-width="160"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="archivesName"
|
|
|
- label="档案名称"
|
|
|
- min-width="160"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column prop="courseName" label="课程" min-width="200">
|
|
|
- <span slot-scope="scope">
|
|
|
- {{ scope.row.courseName }}({{ scope.row.courseCode }})
|
|
|
- </span>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="studentCount"
|
|
|
- label="学生数"
|
|
|
- min-width="100"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column label="实扫/已上传(采集)" width="100" align="center">
|
|
|
- <span slot-scope="scope">
|
|
|
- {{ scope.row.clientScanCount }} / {{ scope.row.clientUploadCount }}
|
|
|
- </span>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="scanCount"
|
|
|
- label="已上传(后台)"
|
|
|
- width="80"
|
|
|
- align="center"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- v-if="curTab === 'my'"
|
|
|
- class-name="action-column"
|
|
|
- prop="enable"
|
|
|
- label="状态"
|
|
|
- width="80"
|
|
|
- fixed="right"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- :class="scope.row.enable ? 'btn-danger' : 'btn-primary'"
|
|
|
- type="text"
|
|
|
- @click="toEnable(scope.row)"
|
|
|
- >
|
|
|
- {{ scope.row.enable ? "已完成" : "未完成" }}
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- class-name="action-column"
|
|
|
- label="操作"
|
|
|
- width="100"
|
|
|
- fixed="right"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- v-if="!scope.row.enable"
|
|
|
- class="btn-primary"
|
|
|
- type="text"
|
|
|
- @click="toScan(scope.row)"
|
|
|
- >
|
|
|
- 扫描
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- v-if="!scope.row.scanCount && scope.row.clientScanCount"
|
|
|
- class="btn-danger"
|
|
|
- type="text"
|
|
|
- @click="toClean(scope.row)"
|
|
|
- >
|
|
|
- 清除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <div class="part-page">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="total,prev, pager, next"
|
|
|
- :current-page="current"
|
|
|
- :total="total"
|
|
|
- :page-size="size"
|
|
|
- @current-change="toPage"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- ScanTaskProcessDialog -->
|
|
|
- <scan-task-process-dialog
|
|
|
- ref="ScanTaskProcessDialog"
|
|
|
- :task="curRow"
|
|
|
- @on-close="getList"
|
|
|
- ></scan-task-process-dialog>
|
|
|
<!-- OcrAreaSetDialog -->
|
|
|
<ocr-area-set-dialog
|
|
|
v-if="openBarCode"
|
|
@@ -150,35 +88,14 @@
|
|
|
|
|
|
<script>
|
|
|
import db from "../../../plugins/db";
|
|
|
-import { taskListPage, enableScanTask } from "../api";
|
|
|
-import ScanTaskProcessDialog from "../components/ScanTaskProcessDialog.vue";
|
|
|
+import { taskListPage } from "../api";
|
|
|
import OcrAreaSetDialog from "../components/OcrAreaSetDialog.vue";
|
|
|
-import { clearTaskOriginDir } from "../../../plugins/imageOcr";
|
|
|
-// import ScanTaskProcessDialog from "../components/ScanTaskDialog.vue";
|
|
|
|
|
|
export default {
|
|
|
name: "task-manage",
|
|
|
- components: {
|
|
|
- ScanTaskProcessDialog,
|
|
|
- OcrAreaSetDialog,
|
|
|
- },
|
|
|
+ components: { OcrAreaSetDialog },
|
|
|
data() {
|
|
|
return {
|
|
|
- curTab: "all",
|
|
|
- tabs: [
|
|
|
- {
|
|
|
- name: "全部",
|
|
|
- val: "all",
|
|
|
- },
|
|
|
- {
|
|
|
- name: "我的",
|
|
|
- val: "my",
|
|
|
- },
|
|
|
- ],
|
|
|
- cacheData: {
|
|
|
- all: {},
|
|
|
- my: {},
|
|
|
- },
|
|
|
filter: {
|
|
|
paperArchivesId: "",
|
|
|
courseCode: "",
|
|
@@ -189,9 +106,6 @@ export default {
|
|
|
total: 0,
|
|
|
dataList: [],
|
|
|
curRow: {},
|
|
|
- recordList: [],
|
|
|
- courseList: [],
|
|
|
- teachingClassList: [],
|
|
|
ocrArea: null,
|
|
|
};
|
|
|
},
|
|
@@ -232,10 +146,6 @@ export default {
|
|
|
this.total = data.total;
|
|
|
this.updateTaskCount();
|
|
|
},
|
|
|
- toPage(page) {
|
|
|
- this.current = page;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
async updateTaskCount() {
|
|
|
for (let i = 0; i < this.dataList.length; i++) {
|
|
|
const task = this.dataList[i];
|
|
@@ -248,24 +158,7 @@ export default {
|
|
|
this.$set(task, "clientUploadCount", uploadCount);
|
|
|
}
|
|
|
},
|
|
|
- selectMenu(curTab) {
|
|
|
- this.cacheData[this.curTab] = {
|
|
|
- current: this.current,
|
|
|
- total: this.total,
|
|
|
- dataList: this.dataList,
|
|
|
- };
|
|
|
-
|
|
|
- this.curTab = curTab;
|
|
|
|
|
|
- if (this.cacheData[this.curTab].total) {
|
|
|
- const { current, total, dataList } = this.cacheData[this.curTab];
|
|
|
- this.current = current;
|
|
|
- this.total = total;
|
|
|
- this.dataList = dataList;
|
|
|
- } else {
|
|
|
- this.toPage(1);
|
|
|
- }
|
|
|
- },
|
|
|
toScan(row) {
|
|
|
if (row.enable) return;
|
|
|
if (this.openBarCode && !this.ocrArea) {
|
|
@@ -278,37 +171,6 @@ export default {
|
|
|
toSetOrcArea() {
|
|
|
this.$refs.OcrAreaSetDialog.open();
|
|
|
},
|
|
|
- async toEnable(row) {
|
|
|
- await enableScanTask({
|
|
|
- paperScanTaskId: row.id,
|
|
|
- enable: !row.enable,
|
|
|
- });
|
|
|
- row.enable = !row.enable;
|
|
|
- },
|
|
|
- async toClean(row) {
|
|
|
- if (!(row.clientScanCount && !row.scanCount)) return;
|
|
|
-
|
|
|
- this.$parent.$parent.stopUpload();
|
|
|
-
|
|
|
- const res = await db.deleteScanByTaskId(row.id).catch((err) => {
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
- if (!res) {
|
|
|
- this.$message.error("本地数据删除错误!");
|
|
|
- this.$parent.$parent.initUploadTask();
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- try {
|
|
|
- clearTaskOriginDir(row.id);
|
|
|
- } catch (error) {
|
|
|
- console.error(error);
|
|
|
- this.$message.error("本地文件删除错误!");
|
|
|
- }
|
|
|
- this.$parent.$parent.initUploadTask();
|
|
|
-
|
|
|
- this.getList();
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|