浏览代码

修改对话答题-字体设置
连线题预览修改

gcj 2 年之前
父节点
当前提交
8f3bc2fa03

+ 2 - 2
src/components/Adult/inputModules/DialogueTem/components/SegbywordChs.vue

@@ -260,7 +260,7 @@ export default {
         let obj = {
           chs: sItem,
           pinyin: "",
-          fontSize: "24px",
+          fontSize: "20px",
           fontColor: "#000",
           fontFamily: "FZJCGFKTK",
           wordPadding: [],
@@ -309,7 +309,7 @@ export default {
       createPinyin(data).then((res) => {
         let wordsList = res.data.result[0];
         wordsList = wordsList.map((item, index) => {
-          item.fontSize = "24px";
+          item.fontSize = "20px";
           item.fontColor = "#000";
           item.fontFamily = "FZJCGFKTK";
           item.wordPadding = [];

+ 6 - 0
src/components/Adult/inputModules/DialogueTem/index.vue

@@ -270,6 +270,12 @@ export default {
           isFn: false,
           isDisable: false,
         },
+        {
+          type: "record",
+          name: "录音题",
+          isFn: false,
+          isDisable: false,
+        },
       ],
       imgNumber: 1,
       mp3Number: 1,

+ 26 - 3
src/components/Adult/preview/DialogueArticleViewChs/AnswerModel.vue

@@ -99,6 +99,7 @@
                                   ? 'NNPE-chs-underline'
                                   : '',
                               ]"
+                              :style="{ fontSize: pItem.config.fontSize }"
                               >{{ pItem.chs }}</span
                             >
                           </template>
@@ -114,6 +115,7 @@
                                 class="answer-input userRight"
                                 v-model="curQue.answerArr[pItem.hengIndex - 1]"
                                 :canEdit="false"
+                                :style="hengStyle(pItem.config.fontSize)"
                               />
                             </template>
                             <template v-else>
@@ -149,6 +151,7 @@
                                 "
                                 :hengIndex="pItem.hengIndex - 1"
                                 @saveBlankTF="saveBlankTF"
+                                :style="hengStyle(pItem.config.fontSize)"
                               />
                             </template>
                           </template>
@@ -195,6 +198,7 @@
                                 ? 'wordActive'
                                 : '',
                             ]"
+                            :style="{ fontSize: pItem.config.fontSize }"
                             >{{ item.wordsList[pIndex + 1].chs }}</span
                           >
 
@@ -260,6 +264,7 @@
                                 ? 'wordActive'
                                 : '',
                             ]"
+                            :style="{ fontSize: pItem.config.fontSize }"
                             >{{ item.wordsList[pIndex + 2].chs }}</span
                           >
                           <span
@@ -314,6 +319,7 @@
                                 ? 'NNPE-chs-underline'
                                 : '',
                             ]"
+                            :style="{ fontSize: pItem.config.fontSize }"
                             >{{ pItem.chs }}</span
                           >
                         </template>
@@ -329,6 +335,7 @@
                               class="answer-input userRight"
                               v-model="curQue.answerArr[pItem.hengIndex - 1]"
                               :canEdit="false"
+                              :style="hengStyle(pItem.config.fontSize)"
                             />
                           </template>
                           <template v-else>
@@ -364,6 +371,7 @@
                               "
                               :hengIndex="pItem.hengIndex - 1"
                               @saveBlankTF="saveBlankTF"
+                              :style="hengStyle(pItem.config.fontSize)"
                             />
                           </template>
                         </template>
@@ -502,6 +510,7 @@
                         class="answer-input userRight"
                         v-model="curQue.answerArr[pItem.hengIndex - 1]"
                         :canEdit="false"
+                        :style="hengStyle(pItem.config.fontSize)"
                       />
                     </template>
                     <template v-else>
@@ -532,6 +541,7 @@
                         "
                         :hengIndex="pItem.hengIndex - 1"
                         @saveBlankTF="saveBlankTF"
+                        :style="hengStyle(pItem.config.fontSize)"
                       />
                     </template>
                   </template>
@@ -547,8 +557,11 @@
                     type="normal"
                     class="normal-box"
                     :TaskModel="TaskModel"
-                    :answerRecordList=" judgeAnswer != 'standardAnswer'
-                    ? Bookanswer.recordList[index]:[]"
+                    :answerRecordList="
+                      judgeAnswer != 'standardAnswer'
+                        ? Bookanswer.recordList[index]
+                        : []
+                    "
                     :tmIndex="index"
                     @handleWav="handleWav"
                   />
@@ -711,6 +724,16 @@ export default {
         return classname;
       };
     },
+    hengStyle() {
+      return function (fontSize) {
+        let sizeVal = fontSize.replace("px", "");
+        return {
+          minHeight: Number(sizeVal) + 9 + "px",
+          lineHeight: Number(sizeVal) + 8 + "px",
+          fontSize: fontSize,
+        };
+      };
+    },
   },
   watch: {},
   //方法集合
@@ -1198,7 +1221,7 @@ export default {
         }
         .chs {
           font-family: "FZJCGFKTK";
-          font-size: 16px;
+          font-size: 20px;
           line-height: 24px;
           color: rgba(0, 0, 0, 0.85);
         }

+ 5 - 6
src/components/Adult/preview/DialogueArticleViewChs/NormalModelChs.vue

@@ -131,7 +131,6 @@
                               item.dhaspinyin
                             "
                             class="NNPE-pinyin"
-
                             :class="[
                               pItem.className ? pItem.className : '',
                               noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
@@ -153,7 +152,9 @@
                                     ? 'wordActive'
                                     : '',
                                 ]"
-                                @click.stop="viewNotes($event, pItem.chs[wIndex])"
+                                @click.stop="
+                                  viewNotes($event, pItem.chs[wIndex])
+                                "
                                 >{{
                                   NumberList.indexOf(pItem.pinyin) == -1
                                     ? pItem.chs[wIndex]
@@ -216,10 +217,7 @@
                                 : '',
                             ]"
                             @click.stop="
-                              viewNotes(
-                                $event,
-                                item.wordsList[pIndex + 1].chs
-                              )
+                              viewNotes($event, item.wordsList[pIndex + 1].chs)
                             "
                             >{{
                               NumberList.indexOf(
@@ -653,6 +651,7 @@ export default {
               endIndex: endIndex,
               leg: wItem.chs.length,
               chstimeList: [],
+              fontSize: wItem.fontSize,
             };
             if (wordTimeList && wordTimeList.length > 0) {
               obj.chstimeList = wordTimeList[asIndex].wordsResultList.slice(

+ 38 - 39
src/components/Adult/preview/Ligature.vue

@@ -39,7 +39,10 @@
                  -->
                 <div
                   class="text"
-                  :class="['left' + index, YouranswerClass(index, 'left')]"
+                  :class="[
+                    'left' + index,
+                    YouranswerClass(index, 'left', item),
+                  ]"
                   v-if="
                     item.detail.wordsList.length > 0 || item.detail.sentence
                   "
@@ -157,7 +160,10 @@
                  -->
                 <div
                   class="text"
-                  :class="['right' + index, YouranswerClass(index, 'right')]"
+                  :class="[
+                    'right' + index,
+                    YouranswerClass(index, 'right', item),
+                  ]"
                   v-if="
                     item.detail.wordsList.length > 0 || item.detail.sentence
                   "
@@ -263,55 +269,42 @@ export default {
   //方法集合
   methods: {
     // 判断对错
-    YouranswerClass(index, type) {
+    YouranswerClass(index, type, item) {
+      let clss = "";
       if (
         this.judgeAnswer == "studentAnswer" ||
         this.judgeAnswer == "userAnswer" ||
         this.judgeAnswer == "standardAnswer"
       ) {
-        let clss = "";
-        this.data.data.forEach((items, i) => {
-          if (type == "left") {
-            if (index == i) {
-              if (items.source) {
-                if (items.correct) {
-                  clss = "correct";
-                } else if (items.error) {
-                  clss = "error";
-                }
-              } else {
-                if (items.correct) {
-                  clss = "correct";
-                } else if (items.error) {
-                  clss = "error";
-                }
-              }
+        let items = this.data.data[index];
+
+        if (type == "left") {
+          if (items) {
+            if (items.correct) {
+              clss = "correct";
+            } else if (items.error) {
+              clss = "error";
             }
-          } else {
-            if (index == i) {
-              if (items.target) {
-                if (items.correct) {
-                  clss = "correct";
-                } else if (items.error) {
-                  clss = "error";
-                }
-              } else {
-                if (items.correct) {
-                  clss = "correct";
-                } else if (items.error) {
-                  clss = "error";
-                }
+          }
+        } else {
+          for (let i = 0; i < this.data.data.length; i++) {
+            let dItems = this.data.data[i];
+            if (item.nodeId == dItems.target) {
+              if (dItems.correct) {
+                clss = "correct";
+              } else if (dItems.error) {
+                clss = "error";
               }
+              break;
             }
           }
-          if (items.Isexample && index == i) {
+
+          if (items && items.Isexample) {
             clss = "example";
           }
-        });
-        return clss;
-      } else {
-        return "";
+        }
       }
+      return clss;
     },
     //   清除所有连线
     clearLine() {
@@ -699,6 +692,12 @@ export default {
             correct: true,
             Isexample: item.Isexample,
           });
+        } else {
+          this.data.data.push({
+            source: item.nodeId,
+            target: null,
+            Isexample: item.Isexample,
+          });
         }
       });
     } else if (