4 Commity 8894523be6 ... 14b528ad65

Autor SHA1 Wiadomość Data
  natasha 14b528ad65 画画预览背景色与保存按钮与书写预览一致 汉字展示模式播放动画未显示 1 tydzień temu
  natasha a5e40d118e 课文生词匹配拆分的分词 1 tydzień temu
  natasha d8abb7e5d9 对话课文编辑单条对话不上屏问题 1 tydzień temu
  natasha 68d0ed290f 生词模式下切换文章未刷新数据 1 tydzień temu

+ 1 - 0
src/icons/svg/saves.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1787554781679" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6473" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M925.248 356.928l-258.176-258.176a64 64 0 0 0-45.248-18.752H144a64 64 0 0 0-64 64v736a64 64 0 0 0 64 64h736a64 64 0 0 0 64-64V402.176a64 64 0 0 0-18.752-45.248zM288 144h192V256H288V144z m448 736H288V736h448v144z m144 0H800V704a32 32 0 0 0-32-32H256a32 32 0 0 0-32 32v176H144v-736H224V288a32 32 0 0 0 32 32h256a32 32 0 0 0 32-32V144h77.824l258.176 258.176V880z" p-id="6474"></path></svg>

+ 9 - 6
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -830,15 +830,18 @@ export default {
         return;
       }
       let textList = this.textInput.trim().split('\n');
-      for (let i = 0; i < textList.length; i++) {
-        if (textList[i].trim()) {
-          if (textList[i].indexOf(':') === -1) {
-            // 如果不包含描述、语境或者角色名
-            this.$message.error('缺少角色或语境,请补全');
-            return false;
+      if (textList.length > 1) {
+        for (let i = 0; i < textList.length; i++) {
+          if (textList[i].trim()) {
+            if (textList[i].indexOf(':') === -1) {
+              // 如果不包含描述、语境或者角色名
+              this.$message.error('缺少角色或语境,请补全');
+              return false;
+            }
           }
         }
       }
+
       textList.forEach((item) => {
         if (item.trim()) {
           let obj = {

+ 1 - 1
src/views/book/courseware/preview/components/article/PhraseModelChs.vue

@@ -2237,7 +2237,7 @@ export default {
             words = wItem.chs;
             endIndex = startIndex + 1;
           }
-        } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
           let index = null;
           let chsStr = '';
           for (let i = startIndex; i < sItem.length + 1; i++) {

+ 66 - 0
src/views/book/courseware/preview/components/article/Practicechs.vue

@@ -1089,6 +1089,8 @@ export default {
       mathNum: Math.random().toString(36).substr(2),
       ed: undefined,
       refresh: true,
+      highWords: null,
+      newWordList: [],
       multilingualTextList: {},
     };
   },
@@ -1262,6 +1264,7 @@ export default {
       let wordTimeList = curQue.wordTime;
       let dhaspinyin = false; // 每段是否有拼音
       let dhaspinyinArr = [];
+      this.handleNewword();
       curQue.detail.forEach((dItem, dIndex) => {
         dhaspinyin = false;
         dItem.wordsList.forEach((sItem, sIndex) => {
@@ -1271,7 +1274,21 @@ export default {
             let startIndex = wIndex === 0 ? 0 : sentArr[wIndex - 1].startIndex + sentArr[wIndex - 1].chs.length;
             let endIndex = wIndex === 0 ? wItem.chs.length : sentArr[wIndex - 1].endIndex + wItem.chs.length;
             // this.judgePad(sItem, wItem, wIndex);
+            let sentence = dItem.sentences[sIndex];
             this.mergeWordSymbol(wItem);
+            let words = '';
+            if (this.newWordList.length > 0) {
+              if (!this.highWords) {
+                this.findLightWord(wItem, wIndex, sentence, sItem);
+                words = this.highWords ? this.highWords.words : '';
+              } else if (wIndex > this.highWords.endIndex - 1) {
+                this.highWords = null;
+                this.findLightWord(wItem, wIndex, sentence, sItem);
+                words = this.highWords ? this.highWords.words : '';
+              } else {
+                words = this.highWords ? this.highWords.words : '';
+              }
+            }
             let obj = {
               paraIndex: dIndex, // 段落索引
               sentIndex: sIndex, // 在段落中句子索引
@@ -1289,6 +1306,7 @@ export default {
               startIndex,
               endIndex,
               leg: wItem.chs.length,
+              words,
               timeList: [],
               config: {
                 fontFamily: wItem.fontFamily,
@@ -1352,6 +1370,54 @@ export default {
         wItem.isShow = true;
       }
     },
+    findLightWord(wItem, startIndex, sentence, sItem) {
+      let endIndex = 0;
+      let words = '';
+      this.newWordList.forEach((item) => {
+        if (item.length === 1) {
+          if (item === wItem.chs && !wItem.banLight) {
+            words = wItem.chs;
+            endIndex = startIndex + 1;
+          }
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
+          let index = null;
+          let chsStr = '';
+          for (let i = startIndex; i < sItem.length + 1; i++) {
+            index = i;
+            if (chsStr.length === item.length) {
+              break;
+            } else {
+              chsStr += sItem[i] ? sItem[i].chs : '';
+            }
+          }
+          if (chsStr === item && !wItem.banLight) {
+            words = item;
+            endIndex = index;
+          }
+        } else if (wItem.new_word && wItem.new_word === item && !wItem.banLight) {
+          words = item;
+          endIndex = startIndex + 1;
+        }
+      });
+      if (words) {
+        this.highWords = { words, endIndex };
+      } else {
+        this.highWords = null;
+      }
+    },
+    handleNewword() {
+      let NewWordList = [];
+      this.NNPENewWordList.forEach((wItem) => {
+        // item.forEach((wItem) => {
+        if (wItem.new_word) {
+          NewWordList.push(wItem.new_word);
+        } else if (wItem.detail && wItem.detail.sentence) {
+          NewWordList.push(wItem.detail.sentence);
+        }
+        // });
+      });
+      this.newWordList = JSON.parse(JSON.stringify(NewWordList));
+    },
 
     // 判断是否有padding
     judgePad(sItem, wItem, curIndex) {

+ 1 - 1
src/views/book/courseware/preview/components/article/Voicefullscreen.vue

@@ -1604,7 +1604,7 @@ export default {
             }
           });
         }
-      } else if (this.newWordList.indexOf(item.chs) > -1) {
+      } else if (this.newWordList.indexOf(item.chs) > -1 || this.newWordList.indexOf(item.words) > -1) {
         if (this.oldHz !== item.chs) {
           this.isShow = false;
 

+ 5 - 1
src/views/book/courseware/preview/components/article/index.vue

@@ -348,6 +348,9 @@ export default {
     'data.content': {
       handler(val) {
         if (val) {
+          this.showPhrases = false;
+          this.showPractice = false;
+          this.showWord = false;
           this.handleData();
           let _this = this;
           if (!this.isJudgingRightWrong) {
@@ -629,6 +632,7 @@ export default {
             : [],
         );
       this.NNPEAnnotationList = this.data.notes_list && this.data.notes_list.option ? this.data.notes_list.option : [];
+      this.handleNewword();
       let resArr = [];
       let sentArrTotal = [];
       let timeArr = [];
@@ -739,7 +743,7 @@ export default {
             words = wItem.chs;
             endIndex = startIndex + 1;
           }
-        } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
           let index = null;
           let chsStr = '';
           for (let i = startIndex; i < sItem.length + 1; i++) {

+ 1 - 1
src/views/book/courseware/preview/components/character/CharacterPreview.vue

@@ -77,7 +77,7 @@
                   <Strockplayredline
                     v-if="items && items.type === 'hanzi'"
                     :Book_text="items.con"
-                    :play-storkes="isEnable(data.property.is_enable_play_structure)"
+                    :play-storkes="isEnable(data.property.is_enable_stroke)"
                     :cur-item="
                       isEnable(data.property.is_enable_high_strokes)
                         ? data.property.model === 'input'

+ 1 - 1
src/views/book/courseware/preview/components/dialogue_article/PhraseModelChs.vue

@@ -1615,7 +1615,7 @@ export default {
             words = wItem.chs;
             endIndex = startIndex + 1;
           }
-        } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
           let index = null;
           let chsStr = '';
           for (let i = startIndex; i < sItem.length + 1; i++) {

+ 2 - 1
src/views/book/courseware/preview/components/dialogue_article/Practicechs.vue

@@ -1255,6 +1255,7 @@ export default {
       let curQue = JSON.parse(JSON.stringify(this.curQue));
       let wordTimeList = curQue.wordTime;
       let dhaspinyin = false; // 每段是否有拼音
+      this.handleNewword();
       curQue.detail.forEach((dItem, dIndex) => {
         dhaspinyin = false;
         let roleDetail = this.getRole(dItem);
@@ -1382,7 +1383,7 @@ export default {
             words = wItem.chs;
             endIndex = startIndex + 1;
           }
-        } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
           let index = null;
           let chsStr = '';
           for (let i = startIndex; i < sItem.length + 1; i++) {

+ 5 - 1
src/views/book/courseware/preview/components/dialogue_article/index.vue

@@ -343,6 +343,9 @@ export default {
     'data.detail.length': {
       handler(val) {
         if (val) {
+          this.showPhrases = false;
+          this.showPractice = false;
+          this.showWord = false;
           this.handleData();
           let _this = this;
           _this.$nextTick(() => {
@@ -628,6 +631,7 @@ export default {
             : [],
         );
       this.NNPEAnnotationList = this.data.notes_list && this.data.notes_list.option ? this.data.notes_list.option : [];
+      this.handleNewword();
       let resArr = [];
       let sentArrTotal = [];
       let timeArr = [];
@@ -737,7 +741,7 @@ export default {
             words = wItem.chs;
             endIndex = startIndex + 1;
           }
-        } else if (item[0] === wItem.chs && sentence.indexOf(item) > -1) {
+        } else if (item.substring(0, wItem.chs.length) === wItem.chs && sentence.indexOf(item) > -1) {
           let index = null;
           let chsStr = '';
           for (let i = startIndex; i < sItem.length + 1; i++) {

+ 8 - 17
src/views/book/courseware/preview/components/drawing/DrawingPreview.vue

@@ -6,10 +6,10 @@
     <div
       class="img-box"
       :style="{
-        background: image_url ? '' : '#DCDFE6',
+        background: image_url ? '' : '#f7f8fa',
         width: isMobile ? '100%' : data.image_width + 'px',
         height: isMobile ? mobileHeight + 'px' : data.image_height + 'px',
-        border: '1px dotted #DCDFE6',
+        border: '1px dotted #f7f8fa',
       }"
     >
       <div v-if="image_url" class="img-set" :style="{ top: `${data.imgData.top}px`, left: `${data.imgData.left}px` }">
@@ -82,7 +82,9 @@
           @click="selSize(2)"
           :style="{ cursor: disabled ? 'not-allowed' : 'pointer' }"
         />
-        <div class="save" @click="save" :style="{ cursor: disabled ? 'not-allowed' : 'pointer' }">保 存</div>
+        <div class="save" @click="save" :style="{ cursor: disabled ? 'not-allowed' : 'pointer' }">
+          <SvgIcon icon-class="saves" size="24" title="保存" />
+        </div>
       </div>
     </div>
   </div>
@@ -187,7 +189,7 @@ export default {
     eraser() {
       this.penIndex = null;
       this.options = {
-        penColor: '#DCDFE6',
+        penColor: '#f7f8fa',
         minWidth: 3,
         maxWidth: 3,
       };
@@ -289,22 +291,11 @@ export default {
 
   .save {
     box-sizing: border-box;
-    width: 65px;
-    height: 32px;
-    margin-left: 16px;
-    font-size: 16px;
-    font-weight: 400;
-    line-height: 32px;
+    height: 24px;
+    margin-left: 8px;
     color: #000;
     text-align: center;
     cursor: pointer;
-    background: rgba(0, 0, 0, 5%);
-    border: 1px solid rgba(0, 0, 0, 10%);
-    border-radius: 6px;
-  }
-
-  .save:hover {
-    background: rgba(0, 0, 0, 25%);
   }
 
   > img {

+ 1 - 1
src/views/book/courseware/preview/components/write_base/WriteBasePreview.vue

@@ -27,7 +27,7 @@
         />
         <div class="btn-box">
           <SvgIcon icon-class="clear" size="24" title="清除" @click="handleReset" />
-          <SvgIcon icon-class="camera" size="24" title="保存" @click="handleGenerate" />
+          <SvgIcon icon-class="saves" size="24" title="保存" @click="handleGenerate" />
         </div>
       </div>
       <!-- <template v-if="data.write_base64[0]">