zhangjie před 1 rokem
rodič
revize
00f56ffffe

+ 1 - 1
src/modules/stmms/components/markParam/MarkPaperGroup.vue

@@ -10,7 +10,7 @@
       </div>
       <div>
         <mark-status field="group"></mark-status>
-        <el-button type="primary" @click="toAdd">新增</el-button>
+        <el-button class="ml-2" type="primary" @click="toAdd">新增</el-button>
       </div>
     </div>
 

+ 1 - 1
src/modules/stmms/components/markParam/MarkParamObjectiveAnswer.vue

@@ -253,7 +253,7 @@ export default {
       this.loading = false;
       if (!data) return;
 
-      this.setObjectiveStructure(data.objectiveStructure);
+      this.setObjectiveStructure(datas.objectiveStructure);
       this.$message.success("编辑成功!");
       this.$emit("confirm");
     },

+ 14 - 1
src/modules/stmms/components/markParam/MarkParamUploadAnswer.vue

@@ -24,6 +24,9 @@
               :disabled="loading"
               @file-change="fileChange"
             ></select-file>
+            <p v-if="infos.errorMsg" class="tips-info tips-error">
+              {{ infos.errorMsg }}
+            </p>
           </el-form-item>
           <el-form-item v-if="answerFileUrl">
             <span
@@ -47,7 +50,7 @@
 </template>
 
 <script>
-import { mapState } from "vuex";
+import { mapState, mapMutations } from "vuex";
 import { examStructureUploadAnswer } from "../../api";
 import SelectFile from "../SelectFile.vue";
 import MarkStatus from "./MarkStatus.vue";
@@ -79,6 +82,7 @@ export default {
     },
   },
   methods: {
+    ...mapMutations("markParam", ["setMarkParamInfos"]),
     toViewAnswer() {
       window.open(this.answerFileUrl);
     },
@@ -110,6 +114,15 @@ export default {
       this.loading = false;
       if (!data) return;
 
+      const paperAnswer = JSON.stringify({
+        paperType: this.markParamInfos.basicPaperInfo.paperType,
+        answerUrl: data,
+      });
+      this.setMarkParamInfos({
+        basicPaperInfo: Object.assign({}, this.markParamInfos.basicPaperInfo, {
+          paperAnswer,
+        }),
+      });
       this.$message.success("上传成功!");
       this.$emit("confirm");
     },

+ 21 - 25
src/modules/stmms/components/markParam/MarkStatus.vue

@@ -1,23 +1,25 @@
 <template>
   <div class="mark-status">
-    <span>
-      <i
-        :class="[
-          'el-icon-success',
-          status.save ? 'color-success' : 'color-danger',
-        ]"
-      ></i>
-      提交{{ status.save ? "成功" : "失败" }}
-    </span>
-    <span>
-      <i
-        :class="[
-          'el-icon-success',
-          status.save ? 'color-success' : 'color-danger',
-        ]"
-      ></i>
-      同步{{ status.sync ? "成功" : "失败" }}
-    </span>
+    <template v-if="status">
+      <span>
+        <i
+          :class="[
+            'el-icon-success',
+            status.save ? 'color-success' : 'color-danger',
+          ]"
+        ></i>
+        提交{{ status.save ? "成功" : "失败" }}
+      </span>
+      <span>
+        <i
+          :class="[
+            'el-icon-success',
+            status.save ? 'color-success' : 'color-danger',
+          ]"
+        ></i>
+        同步{{ status.sync ? "成功" : "失败" }}
+      </span>
+    </template>
   </div>
 </template>
 
@@ -38,12 +40,7 @@ export default {
   computed: {
     ...mapState("markParam", ["markStatus"]),
     status() {
-      return (
-        this.markStatus[this.field] || {
-          save: false,
-          sync: false,
-        }
-      );
+      return this.markStatus[this.field];
     },
   },
   methods: {},
@@ -54,6 +51,5 @@ export default {
 .mark-status {
   display: inline-block;
   vertical-align: middle;
-  margin-right: 10px;
 }
 </style>

+ 2 - 2
src/modules/stmms/components/markParam/markPaperClass.vue

@@ -8,7 +8,7 @@
           @change="openClassReadingChange"
         ></el-switch>
       </div>
-      <mark-status field="class"></mark-status>
+      <mark-status class="mr-4" field="class"></mark-status>
     </div>
 
     <div v-if="openClassReading" class="part-box part-box-pad">
@@ -154,7 +154,7 @@ export default {
     },
     checkData() {
       let errorMessages = [];
-      if (!this.openClassReading) return;
+      if (!this.openClassReading) return errorMessages;
 
       this.markerClassList.forEach((item) => {
         if (!item.className.length) {

+ 6 - 2
src/modules/stmms/components/markParam/store.js

@@ -56,8 +56,12 @@ const mutations = {
     state.objectiveStructure = objectiveStructure;
   },
   setMarkStatus(state, markStatus) {
-    Object.keys(markStatus).forEach((k) => {
-      Object.assign(state.markStatus[k], markStatus[k] || {});
+    Object.keys(state.markStatus).forEach((k) => {
+      if (markStatus[k]) {
+        Object.assign(state.markStatus[k], markStatus[k]);
+      } else {
+        state.markStatus[k] = markStatus[k];
+      }
     });
   },
   setMarkLeader(state, markLeader) {