소스 검색

下载类型

zhangjie 2 년 전
부모
커밋
ea3f4ee2ff
4개의 변경된 파일57개의 추가작업 그리고 39개의 파일을 삭제
  1. 8 5
      src/constants/enumerate.js
  2. 20 10
      src/modules/admin/views/AuthSet.vue
  3. 13 24
      src/modules/exam/views/DataTaskManage.vue
  4. 16 0
      src/modules/exam/views/DownloadManage.vue

+ 8 - 5
src/constants/enumerate.js

@@ -187,19 +187,22 @@ export const DATA_TASK_STATUS = {
   FINISH: "已完成"
 };
 export const DATA_TASK_TYPE = {
+  USER_IMPORT: "用户导入",
+  STUDENT_IMPORT: "学生导入",
+  CLAZZ_IMPORT: "班级导入",
   QUESTION_MISSION_BATCH_CREATE: "批量新建命题任务",
   SAMPLE_EXPORT: "导出审核样本",
   EXAMINATION_IMPORT: "考务数据导入",
   EXAMINATION_EXPORT: "考务数据导出",
   PRINT_PDF_DOWNLOAD: "批量下载pdf",
-  CREATE_PDF: "生成pdf",
-  USER_IMPORT: "用户导入",
-  STUDENT_IMPORT: "学生导入",
-  // COURSE_IMPORT: "课程导入",//同步导入
   PAPER_AND_CARD_PDF_DOWNLOAD: "卷库查询管理试卷、空白题卡批量下载pdf",
+  CREATE_PDF: "生成pdf",
+  DATA_CALCULATE: "数据计算",
+  CREATE_TASK_PRINT: "发布印刷任务",
   STATISTICS_IMPORT: "命题统计导入",
   SCORE_EXPORT: "成绩导出",
-  SCORE_DOWNLOAD: "成绩轨迹下载"
+  SCORE_DOWNLOAD: "成绩轨迹下载",
+  DOWNLOAD_PAPER_FILE_BATCH: "批量下载试卷文件"
 };
 export const DATA_TASK_RESULT = {
   SUCCESS: "成功",

+ 20 - 10
src/modules/admin/views/AuthSet.vue

@@ -8,19 +8,19 @@
         label-width="120px"
       >
         <el-form-item prop="loginName" label="当前信息:">
-          {{ expireTime === null ? "未授权" : "已授权" }}
+          {{ AUTH_TYPE[authInfo.authMode] }}
         </el-form-item>
         <el-form-item label="过期时间:">
-          <span v-if="expireTime === -1">不过期</span>
-          <span v-else-if="expireTime">
-            {{ expireTime | timestampFilter }}</span
+          <span v-if="authInfo.expireTime === -1">不过期</span>
+          <span v-else-if="authInfo.expireTime">
+            {{ authInfo.expireTime | timestampFilter }}</span
           >
           <span v-else>--</span>
         </el-form-item>
         <el-form-item label="授权模式:">
           <el-select v-model="mode" @change="modeChange">
-            <el-option value="OFFLINE" label="离线激活"></el-option>
-            <el-option value="ONLINE" label="在线激活"></el-option>
+            <el-option value="OFF_LINE" label="离线激活"></el-option>
+            <el-option value="ON_LINE" label="在线激活"></el-option>
           </el-select>
         </el-form-item>
         <el-form-item v-if="IS_OFFLINE_MODE" prop="mobileNumber" label="导出:">
@@ -83,8 +83,13 @@ export default {
   components: { UploadButton },
   data() {
     return {
-      mode: "OFFLINE",
-      expireTime: "",
+      mode: "OFF_LINE",
+      authInfo: { expireTime: -1, authMode: "NON_ACTIVATED" },
+      AUTH_TYPE: {
+        ON_LINE: "在线激活",
+        OFF_LINE: "离线激活",
+        NON_ACTIVATED: "未激活"
+      },
       modalForm: {
         accessKey: "",
         accessSecret: ""
@@ -123,7 +128,7 @@ export default {
   },
   computed: {
     IS_OFFLINE_MODE() {
-      return this.mode === "OFFLINE";
+      return this.mode === "OFF_LINE";
     }
   },
   created() {
@@ -132,7 +137,12 @@ export default {
   methods: {
     async search() {
       const res = await authSelect();
-      this.expireTime = res;
+      this.authInfo = res || {};
+      this.mode =
+        this.authInfo.authMode === "NON_ACTIVATED"
+          ? ""
+          : this.authInfo.authMode;
+      this.modalForm = this.$objAssign(this.modalForm, this.authInfo);
     },
     modeChange() {
       this.$nextTick(() => {

+ 13 - 24
src/modules/exam/views/DataTaskManage.vue

@@ -112,7 +112,6 @@
           class-name="action-column"
           label="操作"
           width="160px"
-          align="center"
           fixed="right"
         >
           <template slot-scope="scope">
@@ -121,7 +120,7 @@
               class="btn-primary"
               type="text"
               :disabled="loading"
-              @click="toDonwloadLog(scope.row)"
+              @click="toDonwloadFile(scope.row.id, 'TASK_REPORT')"
               >导出日志</el-button
             >
             <el-button
@@ -137,9 +136,17 @@
               class="btn-primary"
               type="text"
               :disabled="loading"
-              @click="toDonwloadFile(scope.row)"
+              @click="toDonwloadFile(scope.row.id, scope.row.downloadType)"
               >下载文件</el-button
             >
+            <el-button
+              v-if="scope.row.hasErrorFile"
+              class="btn-primary"
+              type="text"
+              :disabled="loading"
+              @click="toDonwloadFile(scope.row.id, 'ERROR_FILE')"
+              >下载错误文件</el-button
+            >
           </template>
         </el-table-column>
       </el-table>
@@ -258,13 +265,13 @@ export default {
         })
         .catch(() => {});
     },
-    async toDonwloadLog(row) {
+    async toDonwloadFile(id, type) {
       if (this.loading) return;
 
       this.loading = true;
       const res = await attachmentDownload({
-        id: row.id,
-        type: "TASK_REPORT"
+        id,
+        type
       }).catch(() => {});
       this.loading = false;
 
@@ -279,24 +286,6 @@ export default {
         return;
       }
 
-      downloadByUrl(url);
-      this.$message.success("文件下载成功!");
-    },
-    async toDonwloadFile(row) {
-      if (this.loading) return;
-
-      this.loading = true;
-      const res = await attachmentDownload({
-        id: row.id,
-        type: row.downloadType
-      }).catch(() => {});
-      this.loading = false;
-
-      if (!res) {
-        this.$message.error("文件下载失败,请重新尝试!");
-        return;
-      }
-
       downloadByUrl(res.url);
       this.$message.success("文件下载成功!");
     },

+ 16 - 0
src/modules/exam/views/DownloadManage.vue

@@ -43,6 +43,13 @@
         >
           批量下载
         </el-button>
+        <el-button
+          v-if="checkPrivilege('button', 'download')"
+          type="primary"
+          icon="el-icon-s-order"
+          @click="toDataTask"
+          >批量下载结果查询</el-button
+        >
       </div>
     </div>
 
@@ -109,6 +116,12 @@
     <!-- DownloadSetDialog -->
     <download-set-dialog :download-set="downloadSet" ref="DownloadSetDialog">
     </download-set-dialog>
+    <!-- data-task-dialog -->
+    <data-task-dialog
+      v-if="checkPrivilege('button', 'download')"
+      ref="DataTaskDialog"
+      task-type="DOWNLOAD_PAPER_FILE_BATCH"
+    ></data-task-dialog>
   </div>
 </template>
 
@@ -198,6 +211,9 @@ export default {
 
       if (!res) return;
       this.$message.success("下载成功!");
+    },
+    toDataTask() {
+      this.$refs.DataTaskDialog.open();
     }
   }
 };