Browse Source

生字模板修改配置

natasha 1 month ago
parent
commit
dc5b0176c4

+ 1 - 0
src/views/book/courseware/create/components/question/article/Article.vue

@@ -15,6 +15,7 @@
           <SvgIcon icon-class="delete-black" size="12" @click="removeFile" />
         </div>
         <div v-if="data.content" class="btn-box">
+          <a @click="handleChangeContent">生成分词</a>
           <a @click="checkArticle">文章校对</a>
           <a @click="editWordsFlag = !editWordsFlag">编辑生词短语注释</a>
           <template v-if="data.wordTime && data.wordTime.length > 0">

+ 1 - 1
src/views/book/courseware/data/newWordTemplate.js

@@ -89,7 +89,7 @@ export function getNewWordTemplateProperty() {
 
     is_enable_play_structure: showList[0].value,
     is_enable_pinyin: showList[0].value,
-    is_enable_high_strokes: showList[1].value,
+    is_enable_high_strokes: showList[0].value,
     model:modelList[0].value,
     
     // miao模式

+ 7 - 4
src/views/book/courseware/preview/components/newWord_template/components/EditDiv.vue

@@ -110,7 +110,7 @@ export default {
       this.lock = false;
       let id = '#' + this.id;
       document.querySelector(id).focus();
-      document.execCommand('selectAll', false, null);
+      // document.execCommand('selectAll', false, null);
       document.getSelection().collapseToEnd();
     },
     // 输入中文结束时
@@ -159,12 +159,15 @@ export default {
       }
     },
     // 文本输入框聚焦,焦点在最后位置
-    textFocus() {
+    textFocus(type) {
       let _this = this;
       setTimeout(() => {
         let id = '#' + _this.id;
         document.querySelector(id).focus();
-        document.execCommand('selectAll', false, null);
+        if (type === 'tone') {
+          document.execCommand('selectAll', false, null);
+        }
+
         document.getSelection().collapseToEnd();
       }, 0);
     },
@@ -201,7 +204,7 @@ export default {
             e.target.innerHTML = str.trim();
             _this.fullContent = str.trim();
             _this.$emit('input', str.trim());
-            _this.textFocus();
+            _this.textFocus('tone');
           }, 10);
         }
       });