Browse Source

主客观题导入

zhangjie 1 year ago
parent
commit
d0696fd881
2 changed files with 97 additions and 11 deletions
  1. 6 0
      src/constants/enumerate.js
  2. 91 11
      src/modules/mark/views/MarkSetting.vue

+ 6 - 0
src/constants/enumerate.js

@@ -211,6 +211,8 @@ export const DATA_TASK_TYPE = {
   SCORE_EXPORT: "成绩导出",
   SCORE_DOWNLOAD: "成绩轨迹下载",
   DOWNLOAD_PAPER_FILE_BATCH: "批量下载试卷文件",
+  SUBJECTIVE_STRUCT_IMPORT: "主观题导入",
+  OBJECTIVE_STRUCT_IMPORT: "客观题导入",
 };
 export const DATA_TASK_RESULT = {
   SUCCESS: "成功",
@@ -246,6 +248,10 @@ export const IMPORT_TEMPLATE_TYPE = {
   markStudent: "TEMPLATE_MARK_STUDENT",
   // 试卷结构
   paperStruct: "TEMPLATE_PAPER_STRUCT",
+  // 主观题结构
+  subjectiveStruct: "TEMPLATE_SUBJECTIVE_STRUCT",
+  // 客观题结构
+  objectiveStruct: "TEMPLATE_OBJECTIVE_STRUCT",
 };
 // 印刷 -------------->
 // 印刷计划状态

+ 91 - 11
src/modules/mark/views/MarkSetting.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="mark-setting">
-    <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>
         <template v-if="checkPrivilege('condition', 'condition')">
           <secp-select
@@ -29,15 +29,46 @@
           >
         </el-form-item>
       </el-form>
-      <div class="part-box-action">
-        <el-button
-          v-if="checkPrivilege('button', 'add')"
-          type="primary"
-          :disabled="!multipleSelection.length"
-          @click="toBatchModifySetting"
-        >
-          评卷设置
-        </el-button>
+      <div class="box-justify">
+        <div></div>
+        <div>
+          <el-button
+            v-if="checkPrivilege('button', 'add')"
+            type="primary"
+            :disabled="!multipleSelection.length"
+            @click="toBatchModifySetting"
+          >
+            评卷设置
+          </el-button>
+          <el-button
+            v-if="checkPrivilege('button', 'SubjectiveStructImport')"
+            type="primary"
+            icon="el-icon-upload2"
+            @click="toImportSubjective"
+            >主观题导入</el-button
+          >
+          <el-button
+            v-if="checkPrivilege('button', 'SubjectiveStructImport')"
+            type="success"
+            icon="el-icon-s-order"
+            @click="toDataTask('SUBJECTIVE_STRUCT_IMPORT')"
+            >主观题导入结果查询</el-button
+          >
+          <el-button
+            v-if="checkPrivilege('button', 'ObjectiveStructImport')"
+            type="primary"
+            icon="el-icon-upload2"
+            @click="toImportObjective"
+            >客观题导入</el-button
+          >
+          <el-button
+            v-if="checkPrivilege('button', 'ObjectiveStructImport')"
+            type="success"
+            icon="el-icon-s-order"
+            @click="toDataTask('OBJECTIVE_STRUCT_IMPORT')"
+            >客观题导入结果查询</el-button
+          >
+        </div>
       </div>
     </div>
 
@@ -122,6 +153,41 @@
       ref="ModifyMarkParams"
       :instance="curRow"
     ></modify-mark-params>
+    <!-- 主观题导入 -->
+    <import-file
+      v-if="checkPrivilege('button', 'SubjectiveStructImport')"
+      ref="ImportSubjectiveFile"
+      title="主观题导入"
+      upload-url="/api/admin/mark/setting/subjective_struct/import"
+      :upload-data="{ examId: filter.examId }"
+      :download-handle="() => downloadTemplate('subjectiveStruct')"
+      download-filename="主观题导入模板.xlsx"
+      :format="['xls', 'xlsx']"
+      @upload-success="getList"
+    >
+    </import-file>
+    <!-- 客观题导入 -->
+    <import-file
+      v-if="checkPrivilege('button', 'ObjectiveStructImport')"
+      ref="ImportObjectiveFile"
+      title="客观题导入"
+      upload-url="/api/admin/mark/setting/objective_struct/import"
+      :upload-data="{ examId: filter.examId }"
+      :download-handle="() => downloadTemplate('objectiveStruct')"
+      download-filename="客观题导入模板.xlsx"
+      :format="['xls', 'xlsx']"
+      @upload-success="getList"
+    >
+    </import-file>
+    <!-- data-task-dialog -->
+    <data-task-dialog
+      v-if="
+        checkPrivilege('button', 'SubjectiveStructImport') ||
+        checkPrivilege('button', 'ObjectiveStructImport')
+      "
+      ref="DataTaskDialog"
+      :task-type="questionType"
+    ></data-task-dialog>
   </div>
 </template>
 
@@ -129,10 +195,13 @@
 import { markSettingListPage } from "../api";
 import ModifyMarkSetting from "../components/ModifyMarkSetting.vue";
 import ModifyMarkParams from "../components/markParam/ModifyMarkParams.vue";
+import ImportFile from "@/components/ImportFile.vue";
+import templateDownload from "@/mixins/templateDownload";
 
 export default {
   name: "mark-setting",
-  components: { ModifyMarkSetting, ModifyMarkParams },
+  components: { ModifyMarkSetting, ModifyMarkParams, ImportFile },
+  mixins: [templateDownload],
   data() {
     return {
       filter: {
@@ -148,6 +217,7 @@ export default {
       dataList: [],
       curRow: {},
       multipleSelection: [],
+      questionType: "",
     };
   },
   methods: {
@@ -190,6 +260,16 @@ export default {
         return;
       }
     },
+    toImportSubjective() {
+      this.$refs.ImportSubjectiveFile.open();
+    },
+    toImportObjective() {
+      this.$refs.ImportObjectiveFile.open();
+    },
+    toDataTask(type) {
+      this.questionType = type;
+      this.$refs.DataTaskDialog.open();
+    },
   },
 };
 </script>