Browse Source

查询结果任务类型

Michael Wang 4 years ago
parent
commit
54b02f3478

+ 2 - 7
src/components/TaskSelect.vue

@@ -19,6 +19,7 @@
 </template>
 
 <script>
+import { IMPORT_EXPORT_TASKS } from "@/constant/constants";
 export default {
   name: "TaskSelect",
   props: {
@@ -31,13 +32,7 @@ export default {
   },
   data() {
     return {
-      optionList: this.options || [
-        { code: "CALCULATE_EXAM_SCORE", name: "考试重新算分" },
-        { code: "IMPORT_EXAM_STUDENT", name: "导入考生" },
-        { code: "IMPORT_EXAM_PAPER", name: "导入试卷" },
-        { code: "IMPORT_INVIGILATE_USER", name: "导入监考员" },
-        { code: "EXPORT_INVIGILATE_USER", name: "导出监考员" },
-      ],
+      optionList: this.options || IMPORT_EXPORT_TASKS,
       selected: "",
     };
   },

+ 8 - 0
src/constant/constants.js

@@ -39,6 +39,14 @@ export const REEXAM_REASON = {
   INVIGILATE_MISS: "监考人员误操作",
 };
 
+export const IMPORT_EXPORT_TASKS = [
+  { code: "CALCULATE_EXAM_SCORE", name: "考试重新算分" },
+  { code: "IMPORT_EXAM_STUDENT", name: "导入考生" },
+  { code: "IMPORT_EXAM_PAPER", name: "导入试卷" },
+  { code: "IMPORT_INVIGILATE_USER", name: "导入监考员" },
+  { code: "EXPORT_INVIGILATE_USER", name: "导出监考员" },
+];
+
 let domain;
 if (process.env.VUE_APP_SELF_DEFINE_DOMAIN === "true") {
   domain = window.localStorage.getItem("domain_in_url");

+ 7 - 1
src/features/examwork/ImportExportTask/ImportExportTask.vue

@@ -14,7 +14,7 @@
         <span slot-scope="scope">{{ scope.row.id }}</span>
       </el-table-column>
       <el-table-column width="150" label="任务名称">
-        <span slot-scope="scope">{{ scope.row.entityName }}</span>
+        <span slot-scope="scope">{{ scope.row.type | taskName }}</span>
       </el-table-column>
       <el-table-column width="150" label="上传文件名">
         <span slot-scope="scope">{{ scope.row.importFileName }}</span>
@@ -76,6 +76,7 @@
 import { searchTasks } from "@/api/examwork-task";
 import { downloadFileURL } from "@/utils/utils";
 import { downloadFile } from "@/api/system-info";
+import { IMPORT_EXPORT_TASKS } from "@/constant/constants";
 
 export default {
   name: "ImportExportTask",
@@ -123,6 +124,11 @@ export default {
       downloadFileURL(url);
     },
   },
+  filters: {
+    taskName(code) {
+      return IMPORT_EXPORT_TASKS.find((v) => v.code == code).name;
+    },
+  },
 };
 </script>