zhangjie 2 tahun lalu
induk
melakukan
a5dcbd1e9c

+ 2 - 3
src/modules/paper/components/AutoBuildPaperStructManage.vue

@@ -196,10 +196,9 @@ export default {
     async deleteStruct(ids) {
       this.loading = true;
       const res = await autoBuildPaperStructDeleteApi(ids.join()).catch(
-        (error) => {
-          this.$message.error(error.response.data.desc);
-        }
+        () => {}
       );
+      this.loading = false;
 
       if (!res) return;
 

+ 11 - 4
src/modules/paper/components/BuildPaperAuto.vue

@@ -63,7 +63,7 @@
             </p>
             <p>
               <span>总分:</span>
-              <span>{{ detail.questionCount * detail.scorePerQuestion }}</span>
+              <span>{{ detail.questionCount * detail.score }}</span>
             </p>
           </div>
         </div>
@@ -160,13 +160,20 @@ export default {
     detailModified(data) {
       const index = this.details.findIndex((item) => item.id === data.id);
       if (index === -1) {
-        this.details.push({ ...data, questionCount: 0 });
+        this.details.push({
+          ...data,
+          questionCount: 0,
+          score: data.scorePerQuestion,
+        });
         if (!this.activeNames.includes(data.id)) this.activeNames.push(data.id);
       } else {
         this.$set(
           this.details,
           index,
-          Object.assign({}, this.details[index], data)
+          Object.assign({}, this.details[index], {
+            ...data,
+            score: data.scorePerQuestion,
+          })
         );
       }
     },
@@ -185,7 +192,7 @@ export default {
           detailName: item.detailName,
           sourceDetailId: item.sourceDetailId,
           courseId: item.courseId,
-          score: structData.questionCount * item.scorePerQuestion,
+          score: item.score,
           ...structData,
         };
       });

+ 11 - 4
src/modules/paper/components/BuildPaperAutoStruct.vue

@@ -56,7 +56,7 @@
             </p>
             <p>
               <span>总分:</span>
-              <span>{{ detail.questionCount * detail.scorePerQuestion }}</span>
+              <span>{{ detail.questionCount * detail.score }}</span>
             </p>
           </div>
         </div>
@@ -146,13 +146,20 @@ export default {
     detailModified(data) {
       const index = this.details.findIndex((item) => item.id === data.id);
       if (index === -1) {
-        this.details.push({ ...data, questionCount: 0 });
+        this.details.push({
+          ...data,
+          questionCount: 0,
+          score: data.scorePerQuestion,
+        });
         if (!this.activeNames.includes(data.id)) this.activeNames.push(data.id);
       } else {
         this.$set(
           this.details,
           index,
-          Object.assign({}, this.details[index], data)
+          Object.assign({}, this.details[index], {
+            ...data,
+            score: data.scorePerQuestion,
+          })
         );
       }
     },
@@ -171,7 +178,7 @@ export default {
           detailName: item.detailName,
           sourceDetailId: item.sourceDetailId,
           courseId: item.courseId,
-          score: structData.questionCount * item.scorePerQuestion,
+          score: item.score,
           ...structData,
         };
       });

+ 3 - 4
src/modules/paper/components/ModifyAutoBuildPaperStruct.vue

@@ -77,13 +77,12 @@ export default {
 
       if (this.loading) return;
       this.loading = true;
-      let questionInfo = this.$refs.BuildPaperAuto.getData();
+      let questionInfo = this.$refs.BuildPaperAutoStruct.getData();
 
       let datas = { ...this.instance };
       datas.structInfo = JSON.stringify(questionInfo.detailInfo);
-      const res = await autoBuildPaperStructSaveApi(datas).catch((error) => {
-        this.$message.error(error.response.data.desc);
-      });
+      const res = await autoBuildPaperStructSaveApi(datas).catch(() => {});
+      this.loading = false;
 
       if (!res) return;
       this.$message.success("修改成功");

+ 29 - 12
src/modules/paper/components/QuestionGroupStruct.vue

@@ -303,6 +303,7 @@ export default {
     buildDataList() {
       let _this = this;
       function buildClassifyData(data) {
+        let cpreInfo = data.classifyId + "";
         let classifyData = {
           id: data.classifyId,
           name: data.classifyName,
@@ -310,7 +311,7 @@ export default {
           classifyName: data.classifyName,
           isClassify: true,
           questionCount: data.questionCount,
-          selectCount: _this.gerSourceData(data.classifyId),
+          selectCount: _this.gerSourceData(cpreInfo),
           difficultDistributeInfo: [],
         };
         if (
@@ -319,7 +320,7 @@ export default {
         ) {
           classifyData.difficultDistributeInfo = parseQuestionDistributeInfo(
             data.difficultDistributeInfo,
-            data.classifyId
+            cpreInfo
           );
         }
         if (
@@ -337,7 +338,7 @@ export default {
 
         classifyData.propertyDistributeInfo =
           curCourseProp.propertyDistributeInfo.map((item) =>
-            parsePropertyData(item, classifyData.id)
+            parsePropertyData(item, `${cpreInfo}_${_this.curCoursePropertyId}`)
           );
 
         classifyData.propertyDistributeInfo = filterPropertyData(
@@ -354,7 +355,12 @@ export default {
           );
         }
         return data.map((item) => {
-          return { ...item, selectCount: _this.gerSourceData(preInfo) };
+          return {
+            ...item,
+            selectCount: _this.gerSourceData(
+              `${preInfo}_${item.difficultLevel}`
+            ),
+          };
         });
       }
 
@@ -381,7 +387,7 @@ export default {
 
         if (data.propertyDistributeInfo && data.propertyDistributeInfo.length) {
           propData.propertyDistributeInfo = data.propertyDistributeInfo.map(
-            (item) => parsePropertyData(item, propData.id)
+            (item) => parsePropertyData(item, propId)
           );
         }
         return propData;
@@ -543,24 +549,35 @@ export default {
         });
       }
 
-      function parsePropertyMap(propertyDistributeInfo) {
+      function parsePropertyMap(propertyDistributeInfo, preInfo) {
         if (!propertyDistributeInfo || !propertyDistributeInfo.length) return;
 
         propertyDistributeInfo.forEach((pInfo) => {
-          if (pInfo.selectCount) sourceDataMap[pInfo.id] = pInfo.selectCount;
-          parseDifficultMap(pInfo.difficultDistributeInfo, pInfo.id);
+          let ppreInfo = `${preInfo}_${pInfo.propertyId}`;
+          if (pInfo.selectCount) sourceDataMap[ppreInfo] = pInfo.selectCount;
+          parseDifficultMap(pInfo.difficultDistributeInfo, ppreInfo);
 
-          parsePropertyMap(pInfo.propertyDistributeInfo);
+          parsePropertyMap(pInfo.propertyDistributeInfo, ppreInfo);
         });
       }
 
       this.dataSource.questionDistributeInfo.forEach((classifyData) => {
+        let cpreInfo = classifyData.classifyId + "";
         if (classifyData.selectCount) {
-          sourceDataMap[classifyData.id] = classifyData.selectCount;
+          sourceDataMap[cpreInfo] = classifyData.selectCount;
         }
 
-        parseDifficultMap(classifyData.difficultDistributeInfo);
-        parsePropertyMap(classifyData.propertyDistributeInfo);
+        parseDifficultMap(classifyData.difficultDistributeInfo, cpreInfo);
+        if (
+          classifyData.coursePropertyDistributeInfo &&
+          classifyData.coursePropertyDistributeInfo.length
+        ) {
+          let preInfo = `${cpreInfo}_${classifyData.coursePropertyDistributeInfo[0].coursePropertyId}`;
+          parsePropertyMap(
+            classifyData.coursePropertyDistributeInfo[0].propertyDistributeInfo,
+            preInfo
+          );
+        }
       });
       this.sourceDataMap = sourceDataMap;
     },

+ 2 - 0
src/modules/paper/views/BuildPaper.vue

@@ -230,6 +230,8 @@ export default {
 
       let questionInfo = this.$refs.BuildPaperDetail.getData();
       if (this.IS_AUTO_MODE && this.isSaveStructInfo) {
+        // console.log(questionInfo.detailInfo);
+        // if (questionInfo.detailInfo) return;
         this.saveAutoBuildPaperStruct(questionInfo.detailInfo);
       }
 

+ 7 - 42
src/modules/paper/views/EditPaper.vue

@@ -694,12 +694,7 @@ export default {
     },
     // 保存试卷
     async toSavePaper() {
-      const res = await paperSaveApi(this.paper).catch((error) => {
-        this.$notify({
-          type: "error",
-          message: error.response.data.desc,
-        });
-      });
+      const res = await paperSaveApi(this.paper).catch(() => {});
 
       if (!res) return;
       this.$message.success("保存成功!");
@@ -711,12 +706,7 @@ export default {
       }).catch(() => {});
       if (confirm !== "confirm") return;
 
-      const res = await paperDeleteApi(this.paper.id).catch((error) => {
-        this.$notify({
-          type: "error",
-          message: error.response.data.desc,
-        });
-      });
+      const res = await paperDeleteApi(this.paper.id).catch(() => {});
 
       if (!res) return;
       this.$message.success("删除成功!");
@@ -822,12 +812,7 @@ export default {
     async detailModified(detail) {
       detail.name = detail.detailName;
       const res = await paperDetailUpdateApi(this.paperId, detail).catch(
-        (error) => {
-          this.$notify({
-            type: "error",
-            message: error.response.data.desc,
-          });
-        }
+        () => {}
       );
 
       if (!res) return;
@@ -856,12 +841,7 @@ export default {
         paperId: this.paperId,
         detailId: detail.id,
         vector,
-      }).catch((error) => {
-        this.$notify({
-          type: "error",
-          message: error.response.data.desc,
-        });
-      });
+      }).catch(() => {});
 
       if (!res) return;
       this.$message.success("操作成功!");
@@ -882,12 +862,7 @@ export default {
       const res = await paperDetailDeleteApi({
         paperId: this.paperId,
         detailId: detail.id,
-      }).catch((error) => {
-        this.$notify({
-          type: "error",
-          message: error.response.data.desc,
-        });
-      });
+      }).catch(() => {});
 
       if (!res) return;
       this.$message.success("操作成功!");
@@ -986,12 +961,7 @@ export default {
         detailId,
         unitid,
         vector,
-      }).catch((error) => {
-        this.$notify({
-          type: "error",
-          message: error.response.data.desc,
-        });
-      });
+      }).catch(() => {});
 
       if (!res) return;
       this.$message.success("操作成功!");
@@ -1005,12 +975,7 @@ export default {
       if (confirm !== "confirm") return;
 
       const res = await paperQuestionDeleteApi(paperDetailUnit.id).catch(
-        (error) => {
-          this.$notify({
-            type: "error",
-            message: error.response.data.desc,
-          });
-        }
+        () => {}
       );
       if (!res) return;
 

+ 2 - 7
src/modules/question/components/FolderQuestionManageDialog.vue

@@ -356,13 +356,8 @@ export default {
     },
     async deleteQuestion(ids) {
       this.loading = true;
-      const res = await deleteQuestionApi(ids.join()).catch((error) => {
-        this.$notify({
-          message: error.response.data.desc,
-          type: "error",
-        });
-      });
-
+      const res = await deleteQuestionApi(ids.join()).catch(() => {});
+      this.loading = false;
       if (!res) return;
 
       this.$notify({

+ 2 - 6
src/modules/question/views/QuestionManage.vue

@@ -391,12 +391,8 @@ export default {
       if (confirm !== "confirm") return;
 
       this.loading = true;
-      const res = await deleteQuestionApi(row.id).catch((error) => {
-        this.$notify({
-          message: error.response.data.desc,
-          type: "error",
-        });
-      });
+      const res = await deleteQuestionApi(row.id).catch(() => {});
+      this.loading = false;
 
       if (!res) return;
 

+ 2 - 7
src/modules/questions/views/PropertyInfo.vue

@@ -489,13 +489,8 @@ export default {
             "/" +
             this.coursePropertyId
         )
-        .catch((error) => {
-          this.$notify({
-            type: "error",
-            message: error.response.data.desc,
-          });
-        });
-
+        .catch(() => {});
+      this.loading = false;
       if (!res) return;
 
       this.$notify({

+ 1 - 6
src/modules/questions/views/SynthesisPaperStorage.vue

@@ -445,12 +445,7 @@ export default {
       if (confirm !== "confirm") return;
 
       const res = await synthesizePaperDeleteApi(this.selectedPaperIds).catch(
-        (error) => {
-          this.$notify({
-            message: error.response.data.desc,
-            type: "error",
-          });
-        }
+        () => {}
       );
 
       if (!res) return;