فهرست منبع

Merge branch 'dev_1.2.0' of http://git.qmth.com.cn/union-question/union-question-web into dev_1.2.0

xiatian 2 سال پیش
والد
کامیت
f1aa8edb2d

+ 1 - 1
src/assets/styles/base.scss

@@ -309,7 +309,7 @@ body {
 }
 .tips-info {
   color: $--color-text-secondary;
-  height: 25px;
+  min-height: 25px;
   line-height: 25px;
 }
 .tips-error {

+ 9 - 0
src/assets/styles/pages.scss

@@ -758,6 +758,15 @@
     margin-left: 5px;
     margin-right: 5px;
   }
+  u {
+    text-decoration: underline;
+  }
+  i {
+    font-style: italic;
+  }
+  b {
+    font-weight: 600;
+  }
 }
 .question-answer {
   display: inline-block;

+ 1 - 0
src/components/vEditor/components/VMenu.vue

@@ -192,6 +192,7 @@ export default {
       el.style = `width: ${result.param.width}px;height:${result.param.height}px;`;
       this.curEditFocusRange.insertNode(el);
       this.curEditFocusRange.collapse();
+      this.$parent.emitJSON();
     },
   },
 };

+ 2 - 1
src/components/vEditor/renderJSON.js

@@ -119,7 +119,8 @@ function renderBlock(block, inline) {
     } else {
       node = document.createElement("img");
       node.className = "audio";
-      node.src = "/img/editor/text_audio.png";
+      node.src =
+        "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAACrElEQVRYR72XTYiOURTHf7OzUmOBjGKBxRALCxRTKFMyNmKhyAILSYQoG7NBjIWPfC4U+c6GhbJiI6KUmEKyUMoCG9b0f7tHx517n+c+r/edu7zP+fidc8859z49dGadBXYGU2uB+6Vme0oFM3JTgOvASsBs/QbeAneB08CPKh//AzAA3ASmBQcewHy+A04B53MQ7QJsBS5HRlMAJvIQWJ2CaAfgOLA/YawKwMTH+GsCMDOkU0VWFcxEYA9wOCE0JhOlAKuAM8CcioKKbfUHiPWRzjVgczYlCQdqLzmvW7lg7gAxhI5wRAZjpe3AUmAZoJTnltIbp9hsHQNuA6+ccgpiLjDqAV4CC+vCDI6HAfW7X3ERag5sCAKaF8+BGU5BAQybUoowxdJSCh/qACTmIfYBJ5xRDat5AtgEXG0QuYmWAEj2CHAImBCyMN/5GhRAHL2iFPloDVQO4A2g87X1C1gMaP8gcNR9GxHAZ2C621wOPC7ISA5A7aegPIQqXpW/MdwdZv6pAHKG6hiq9NRNF52BR8AgsAh45vY/dgtgFvDBOfoKTAUmAd/c/s9uAWiGfHKOvgB9QC/wfTwAtgBXnKMHgO4QzRnNG1utIxCpn3qtCVVXABW1kypC3aAHwkhWgf5ThJoBmgW21IZPCjqhnTYUhEb1X1/KQFyxueD9FJRMJwbRgI3ipvdAKUDRKLaIm94HdRlodBkZhGphCFgSTcf4WKqu45PALeCFUyq6jnNnvys8xeoaoyMPkpyTNeFVVPVIiQHU89Z63m7jJ5kpzwYuACsylAagaadWU3fF6zWwwG+WPkq9ziVgW8J415/l3udee1S6zSoA/R3tTmWunQyYHV2vmqKTw8a4/poZhG44/R/qFe0B3gM3uv1z6jN6DtgRNtYB9+p61r7/AUdtnNZgQrCLAAAAAElFTkSuQmCC";
       node.dataset.audioSrc = block.value;
       node.dataset.isAudio = true;
       if (block.param && block.param.duration) {

+ 2 - 2
src/components/vEditor/toJSON.js

@@ -121,8 +121,8 @@ function toJSONBlock(e) {
   ) {
     block.type = "image";
     // 公式latex表达式
-    if (e.dataset.latex) {
-      block.latex = e.dataset.latex;
+    if (e.dataset.dataLatex) {
+      block.latex = e.dataset.dataLatex;
     }
     // change base64 image size, draw canvas
     block.value = e.src;

+ 6 - 1
src/modules/card/elements/card-head/CardHead.vue

@@ -1,7 +1,9 @@
 <template>
   <div :class="classes">
     <div class="card-head-title">
-      <h1>{{ data.title }}</h1>
+      <h1 v-for="(t, tindex) in titles" :key="tindex">
+        {{ t }}
+      </h1>
     </div>
     <div class="card-head-info">
       <div v-for="(info, index) in fields" :key="index" class="info-item">
@@ -61,6 +63,9 @@ export default {
     notices() {
       return this.data.attention.split("\n") || [];
     },
+    titles() {
+      return this.data.title.split("\n") || [];
+    },
   },
   methods: {},
 };

+ 1 - 1
src/modules/card/elements/fill-question/EditFillQuestion.vue

@@ -37,7 +37,7 @@
           v-model="modalForm.optionCount"
           style="width: 125px"
           :min="2"
-          :max="22"
+          :max="20"
           :step="1"
           step-strictly
           :controls="false"

+ 4 - 2
src/modules/card/elements/fill-question/model.js

@@ -61,6 +61,7 @@ const getModel = (presetData) => {
 };
 
 const getFullModel = (modelProp, { pageSize, columnNumber }) => {
+  console.log(modelProp);
   const parent = deepCopy(modelProp);
   const childModel = objAssign(MODEL, parent);
 
@@ -102,8 +103,8 @@ const getFullModel = (modelProp, { pageSize, columnNumber }) => {
           curGroup.map((item) => item.optionCount)
         );
         if (
-          curGroupMaxOptionCount + 1 + groupOptionCount <=
-          lineMaxOptionCount
+          curGroupMaxOptionCount + 1 + groupOptionCount <= lineMaxOptionCount ||
+          !groups.length
         ) {
           groupOptionCount += curGroupMaxOptionCount + 1;
           groups.push(curGroup);
@@ -131,6 +132,7 @@ const getFullModel = (modelProp, { pageSize, columnNumber }) => {
       questionGroup,
       parent,
     });
+    console.log(questionGroup);
     const maxOptionCountPerGroup =
       questionGroup.length > 1
         ? childModel.questionCountPerGroup

+ 2 - 2
src/modules/questions/views/CheckDuplicateList.vue

@@ -114,12 +114,12 @@
             <span>{{ scope.row.course.name }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="试卷名称" width="180">
+        <el-table-column label="试卷名称">
           <template slot-scope="scope">
             <span>{{ scope.row.basePaperName }}</span>
           </template>
         </el-table-column>
-        <el-table-column label="题干">
+        <el-table-column label="题干" min-width="240">
           <template slot-scope="scope">
             <rich-text
               class="row-question-body"

+ 33 - 1
src/modules/questions/views/EditPaper.vue

@@ -109,7 +109,12 @@
           <el-button type="info" size="small" @click="showAuditDialog">
             审核记录
           </el-button>
-          <el-button type="info" size="small" @click="toEditCard">
+          <el-button
+            v-if="enableCardEdit"
+            type="info"
+            size="small"
+            @click="toEditCard"
+          >
             编辑题卡
           </el-button>
         </div>
@@ -1337,6 +1342,11 @@ export default {
         this.quesModel.questionType == "BANKED_CLOZE"
       );
     },
+    enableCardEdit() {
+      return (
+        this.paper.auditStatus === "PASS" && this.paper.paperType === "GENERATE"
+      );
+    },
   },
   created() {
     let qt = sessionStorage.getItem("quesTagShow");
@@ -1521,6 +1531,9 @@ export default {
                   type: "success",
                 });
                 this.loading = false;
+              })
+              .catch(() => {
+                this.loading = false;
               });
           }
         },
@@ -1574,6 +1587,9 @@ export default {
                   type: "success",
                 });
                 this.loading = false;
+              })
+              .catch(() => {
+                this.loading = false;
               });
           }
         },
@@ -1626,6 +1642,9 @@ export default {
                   type: "success",
                 });
                 this.loading = false;
+              })
+              .catch(() => {
+                this.loading = false;
               });
           }
         },
@@ -1856,6 +1875,9 @@ export default {
             console.log(scrollPosition);
           }, 1000);
           this.loading = false;
+        })
+        .catch(() => {
+          this.loading = false;
         });
     },
     //删除大题
@@ -1892,6 +1914,9 @@ export default {
                     type: "success",
                   });
                   this.loading = false;
+                })
+                .catch(() => {
+                  this.loading = false;
                 });
             }
           },
@@ -2016,6 +2041,7 @@ export default {
       return count;
     },
     quesBodyChange(quesBodyJson) {
+      console.log(quesBodyJson);
       this.quesModel.quesBody = quesBodyJson;
 
       if (this.quesModel.questionType == "FILL_BLANK_QUESTION") {
@@ -2431,6 +2457,9 @@ export default {
                   type: "success",
                 });
                 this.loading = false;
+              })
+              .catch(() => {
+                this.loading = false;
               });
           }
         },
@@ -2470,6 +2499,9 @@ export default {
                   });
                 }
                 this.loading = false;
+              })
+              .catch(() => {
+                this.loading = false;
               });
           }
         },

+ 1 - 5
src/modules/questions/views/ImportPaper.vue

@@ -870,11 +870,7 @@ export default {
             ? 1
             : parseInt(sessionStorage.getItem("import_paper_currentPage"));
       }
-      if (this.formSearch.courseName) {
-        this.getCourses(this.formSearch.courseName);
-      } else {
-        this.getCourses("");
-      }
+      this.getCourses(this.formSearch.courseName || "");
       this.handleCurrentChange(this.currentPage);
     },
   },