zhangjie 3 vuotta sitten
vanhempi
commit
bae23acb04

+ 6 - 1
src/constants/enumerate.js

@@ -199,4 +199,9 @@ export const MARK_TASK_SYNC_STATUS = {
   SUBJECTIVE_FINISH: "同步中", // 主观题结构同步成功
   FINISH: "已同步"
 };
-export const STMMS_SYNC_TYPE = {};
+export const STMMS_SYNC_TYPE = {
+  USER_PUSH: "用户推送",
+  EXAM_PUSH: "考试、考生、题卡推送",
+  STRUCTURE_PUSH: "试卷结构推送",
+  SCORE_PUSH: "成绩推送"
+};

+ 20 - 12
src/modules/stmms/views/ScoreArchive.vue

@@ -56,7 +56,8 @@
         <el-button
           type="success"
           icon="el-icon-refresh"
-          :loading="loading"
+          :loading="syncLoading"
+          :disabled="!filter.semesterId || !filter.orgId"
           @click="toSync"
           >同步</el-button
         >
@@ -65,6 +66,7 @@
           type="primary"
           icon="el-icon-download"
           :loading="loading"
+          :disabled="!filter.semesterId || !filter.orgId"
           @click="toDownloadAll"
           >一键下载</el-button
         >
@@ -72,7 +74,8 @@
           v-if="checkPrivilege('button', 'export')"
           type="primary"
           icon="el-icon-download"
-          :loading="loading"
+          :loading="exportLoading"
+          :disabled="!filter.semesterId || !filter.orgId"
           @click="toExport"
           >成绩导出</el-button
         >
@@ -112,7 +115,7 @@
               v-if="checkPrivilege('link', 'download')"
               class="btn-primary"
               type="text"
-              :loading="downloading"
+              :disabled="downloading"
               @click="toDownload(scope.row)"
               >下载</el-button
             >
@@ -174,6 +177,8 @@ export default {
       curRow: {},
       curPapers: [],
       downloading: false,
+      syncLoading: false,
+      exportLoading: false,
       loading: false,
       // img view
       curImageIndex: 0,
@@ -200,10 +205,13 @@ export default {
       this.getList();
     },
     async toSync() {
-      if (this.loading) return;
-      this.loading = true;
-      const res = await scoreSync({ examId: "" }).catch(() => {});
-      this.loading = false;
+      if (this.syncLoading) return;
+      this.syncLoading = true;
+      const res = await scoreSync({
+        semesterId: this.filter.semesterId,
+        orgId: this.filter.orgId
+      }).catch(() => {});
+      this.syncLoading = false;
       if (!res) return;
       this.$message.success("同步任务已经提交");
     },
@@ -216,10 +224,10 @@ export default {
       this.$message.success("下载任务已经提交");
     },
     async toExport() {
-      if (this.loading) return;
-      this.loading = true;
+      if (this.exportLoading) return;
+      this.exportLoading = true;
       const res = await scoreExport(this.filter).catch(() => {});
-      this.loading = false;
+      this.exportLoading = false;
       if (!res) return;
       this.$message.success("导出任务已经提交");
     },
@@ -229,7 +237,7 @@ export default {
 
       const res = await downloadByApi(() => {
         return scoreDownload(row.studentCode);
-      }, `${row.name}-原卷.zip`).catch(e => {
+      }).catch(e => {
         console.log(e);
       });
       this.downloading = false;
@@ -248,7 +256,7 @@ export default {
         return;
       }
       this.curImageIndex = 0;
-      this.imageList = row.sheetUrls.map((item, index) => {
+      this.imageList = JSON.parse(row.sheetUrls).map((item, index) => {
         return { url: item, name: index + 1 };
       });
       this.selectImage(this.curImageIndex);

+ 3 - 3
src/modules/stmms/views/SyncManage.vue

@@ -13,10 +13,10 @@
               ></el-option>
             </el-select>
           </el-form-item>
-          <el-form-item label="数据结果:">
+          <el-form-item label="同步结果:">
             <el-select
               v-model="filter.result"
-              placeholder="数据结果"
+              placeholder="同步结果"
               clearable
               style="width: 120px;"
             >
@@ -103,7 +103,7 @@ export default {
     };
   },
   created() {
-    this.getList();
+    // this.getList();
   },
   methods: {
     async getList() {

+ 1 - 1
src/plugins/download.js

@@ -6,7 +6,7 @@ const parseDownloadFilename = dispositionInfo => {
   strs
     .map(item => item.split("="))
     .find(item => {
-      if (item[0].indexOf("filename") !== -1) {
+      if (item[0].indexOf("fileName") !== -1) {
         filename = decodeURI(item[1]);
       }
     });