|
@@ -0,0 +1,143 @@
|
|
|
+<template>
|
|
|
+ <div class="check-data ">
|
|
|
+ <div class="part-box check-list">
|
|
|
+ <table class="table">
|
|
|
+ <tr>
|
|
|
+ <th>序号</th>
|
|
|
+ <th>校验内容</th>
|
|
|
+ <th>执行结果</th>
|
|
|
+ <th>操作</th>
|
|
|
+ </tr>
|
|
|
+ <tr v-for="(citem, cindex) in checkItemInfo" :key="cindex">
|
|
|
+ <td>{{ cindex + 1 }}</td>
|
|
|
+ <td>
|
|
|
+ {{ citem.desc }}
|
|
|
+ <InputNumber
|
|
|
+ v-if="paramCheckItems.includes(citem.checkItem)"
|
|
|
+ v-model="citem.paramValue"
|
|
|
+ :min="1"
|
|
|
+ :max="1000"
|
|
|
+ ></InputNumber>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ {{ resultStr(citem.result) }}
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ :disabled="citem.status && citem.status !== 'FINISH'"
|
|
|
+ @click="submit(citem)"
|
|
|
+ >开始</Button
|
|
|
+ >
|
|
|
+ <Button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ :loading="loading"
|
|
|
+ :disabled="!citem.result && !citem.content"
|
|
|
+ @click="toView(citem)"
|
|
|
+ >详情</Button
|
|
|
+ >
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- CheckDataResult -->
|
|
|
+ <CheckDataResult ref="CheckDataResult" :content="curCheckItemContent" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { checkDataList, dataItemCheck } from "@/api";
|
|
|
+import CheckDataResult from "./components/CheckDataResult.vue";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "check-data",
|
|
|
+ components: { CheckDataResult },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ workId: this.$route.params && this.$route.params.workId,
|
|
|
+ checkItemInfo: [],
|
|
|
+ paramCheckItems: ["LEVEL_DIFF", "SCORE_DIFF"],
|
|
|
+ loading: false,
|
|
|
+ curCheckItemContent: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.initCheckDataInfo();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initCheckDataInfo() {
|
|
|
+ const checkItems = [
|
|
|
+ "PAPER_SIZE",
|
|
|
+ "ALL_SCORE",
|
|
|
+ "LEVEL_SCORE_MATCH",
|
|
|
+ "LEVEL_DIFF",
|
|
|
+ "SCORE_DIFF"
|
|
|
+ ];
|
|
|
+ const checkItemDesc = {
|
|
|
+ PAPER_SIZE: "所有试卷图片大小均不为0",
|
|
|
+ ALL_SCORE: "校验每张试卷都有分数",
|
|
|
+ LEVEL_SCORE_MATCH: "每张试卷分数都在其所属档位分数区间内",
|
|
|
+ LEVEL_DIFF: "同一考生各科目档位差不超过",
|
|
|
+ SCORE_DIFF: "同一考生各科目成绩差不超过"
|
|
|
+ };
|
|
|
+ const checkItemInfo = checkItems.map(item => {
|
|
|
+ return {
|
|
|
+ checkItem: item,
|
|
|
+ desc: checkItemDesc[item],
|
|
|
+ paramValue: null,
|
|
|
+ status: null,
|
|
|
+ result: null,
|
|
|
+ errorCount: 0,
|
|
|
+ content: null
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.checkItemInfo = checkItemInfo;
|
|
|
+ },
|
|
|
+ async getCheckDataInfo() {
|
|
|
+ const res = await checkDataList(this.workId);
|
|
|
+ const data = res || [];
|
|
|
+ const checkItemInfoMap = {};
|
|
|
+ data.forEach(item => {
|
|
|
+ checkItemInfoMap[item.checkItem] = item;
|
|
|
+ });
|
|
|
+
|
|
|
+ this.checkItemInfo = this.checkItemInfo.map(item => {
|
|
|
+ return Object.assign({}, item, checkItemInfoMap[item.checkItem]);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ resultStr(val) {
|
|
|
+ if (val === null) return "--";
|
|
|
+ return val ? "成功" : "失败";
|
|
|
+ },
|
|
|
+ toView(row) {
|
|
|
+ this.curCheckItemContent = row.content;
|
|
|
+ this.$refs.CheckDataResult.open();
|
|
|
+ },
|
|
|
+ async submit(row) {
|
|
|
+ if (
|
|
|
+ ["LEVEL_DIFF", "SCORE_DIFF"].includes(row.checkItem) &&
|
|
|
+ !row.paramValue
|
|
|
+ ) {
|
|
|
+ this.$Message.error("请输入参数");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.loading) return;
|
|
|
+ this.loading = true;
|
|
|
+ const res = await dataItemCheck({
|
|
|
+ workId: this.workId,
|
|
|
+ checkItem: row.checkItem,
|
|
|
+ paramValue: row.paramValue
|
|
|
+ }).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ if (!res) return;
|
|
|
+ this.$Message.success("提交成功!");
|
|
|
+ this.getCheckDataInfo();
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|