Ver código fonte

对话课文等统一拼音字段

natasha 2 meses atrás
pai
commit
978ec38487
24 arquivos alterados com 66 adições e 56 exclusões
  1. 1 1
      src/views/book/courseware/create/components/base/character_base/CharacterBase.vue
  2. 1 1
      src/views/book/courseware/create/components/base/character_base/CharacterBaseSetting.vue
  3. 1 1
      src/views/book/courseware/create/components/question/article/CheckPinyin.vue
  4. 2 2
      src/views/book/courseware/create/components/question/character/Character.vue
  5. 1 1
      src/views/book/courseware/create/components/question/character/CharacterSetting.vue
  6. 1 1
      src/views/book/courseware/create/components/question/character_structure/CharacterStructure.vue
  7. 1 1
      src/views/book/courseware/create/components/question/character_structure/CharacterStructureSetting.vue
  8. 21 9
      src/views/book/courseware/create/components/question/dialogue_article/ArticleSetting.vue
  9. 3 5
      src/views/book/courseware/create/components/question/newWord_template/NewWordTemplate.vue
  10. 1 1
      src/views/book/courseware/create/components/question/newWord_template/NewWordTemplateSetting.vue
  11. 1 1
      src/views/book/courseware/data/character.js
  12. 1 1
      src/views/book/courseware/data/characterBase.js
  13. 1 1
      src/views/book/courseware/data/characterStructure.js
  14. 9 7
      src/views/book/courseware/data/dialogueArticle.js
  15. 1 1
      src/views/book/courseware/data/newWordTemplate.js
  16. 5 5
      src/views/book/courseware/preview/components/character/CharacterPreview.vue
  17. 1 1
      src/views/book/courseware/preview/components/character_base/CharacterBasePreview.vue
  18. 2 2
      src/views/book/courseware/preview/components/character_structure/CharacterStructurePreview.vue
  19. 1 1
      src/views/book/courseware/preview/components/dialogue_article/NormalModelChs.vue
  20. 1 1
      src/views/book/courseware/preview/components/dialogue_article/PhraseModelChs.vue
  21. 1 1
      src/views/book/courseware/preview/components/dialogue_article/Practicechs.vue
  22. 1 1
      src/views/book/courseware/preview/components/dialogue_article/WordModelChs.vue
  23. 2 2
      src/views/book/courseware/preview/components/dialogue_article/index.vue
  24. 6 8
      src/views/book/courseware/preview/components/newWord_template/NewWordTemplatePreview.vue

+ 1 - 1
src/views/book/courseware/create/components/base/character_base/CharacterBase.vue

@@ -5,7 +5,7 @@
       <div class="fill-wrapper">
         <el-input v-model="data.content" placeholder="输入汉字" @blur="handleChineseStrokes(data)" />
         <el-input
-          v-if="isEnable(data.property.is_enable_pinyin)"
+          v-if="isEnable(data.property.view_pinyin)"
           v-model="data.pinyin"
           placeholder="输入拼音"
           @blur="handleSplitPy(data)"

+ 1 - 1
src/views/book/courseware/create/components/base/character_base/CharacterBaseSetting.vue

@@ -8,7 +8,7 @@
         </el-select>
       </el-form-item>
       <el-form-item label="拼音">
-        <el-radio-group v-model="property.is_enable_pinyin">
+        <el-radio-group v-model="property.view_pinyin">
           <el-radio v-for="{ value, label } in showList" :key="value" :label="value">
             {{ label }}
           </el-radio>

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

@@ -135,7 +135,7 @@ export default {
           items.forEach((itemss, indexss) => {
             let pinyin =
               this.data.pinyin_type === 'pinyin'
-                ? this.data.property.is_enable_sentence_case && indexss === 0
+                ? this.data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && indexss === 0
                   ? itemss.pinyin_up
                   : itemss.pinyin
                 : itemss.pinyin_tone;

+ 2 - 2
src/views/book/courseware/create/components/question/character/Character.vue

@@ -39,7 +39,7 @@
                 <el-radio :label="false">否</el-radio>
               </el-radio-group>
             </template>
-            <template v-if="isEnable(data.property.is_enable_pinyin)">
+            <template v-if="isEnable(data.property.view_pinyin)">
               <!-- <span>共用拼音:</span>
               <el-radio-group v-model="item.is_common_pinyin">
                 <el-radio :label="true">是</el-radio>
@@ -72,7 +72,7 @@
                 @updateFileList="updateFileList"
               />
               <div class="option-item">
-                <template v-if="isEnable(data.property.is_enable_pinyin) && !item.is_common_pinyin">
+                <template v-if="isEnable(data.property.view_pinyin) && !item.is_common_pinyin">
                   <span>拼音</span>
                   <el-input v-model="items.pinyin" placeholder="输入拼音"></el-input>
                 </template>

+ 1 - 1
src/views/book/courseware/create/components/question/character/CharacterSetting.vue

@@ -43,7 +43,7 @@
         </el-radio-group>
       </el-form-item>
       <el-form-item label="拼音">
-        <el-radio-group v-model="property.is_enable_pinyin">
+        <el-radio-group v-model="property.view_pinyin">
           <el-radio v-for="{ value, label } in showList" :key="value" :label="value">
             {{ label }}
           </el-radio>

+ 1 - 1
src/views/book/courseware/create/components/question/character_structure/CharacterStructure.vue

@@ -38,7 +38,7 @@
           <span>汉字</span>
           <el-input v-model="item.content" @change="handleHanzi(item)" placeholder="请输入一个汉字"></el-input>
         </div>
-        <div class="option-item" v-if="isEnable(data.property.is_enable_pinyin)">
+        <div class="option-item" v-if="isEnable(data.property.view_pinyin)">
           <span>拼音</span>
           <el-input v-model="item.pinyin"></el-input>
         </div>

+ 1 - 1
src/views/book/courseware/create/components/question/character_structure/CharacterStructureSetting.vue

@@ -3,7 +3,7 @@
     <el-form :model="property" label-width="72px" label-position="left">
       <SerailNumber :property="property" />
       <el-form-item label="拼音显示">
-        <el-radio-group v-model="property.is_enable_pinyin">
+        <el-radio-group v-model="property.view_pinyin">
           <el-radio v-for="{ value, label } in showList" :key="value" :label="value">
             {{ label }}
           </el-radio>

+ 21 - 9
src/views/book/courseware/create/components/question/dialogue_article/ArticleSetting.vue

@@ -92,17 +92,27 @@
 
       <el-divider />
       <el-form-item label="拼音">
-        <el-switch v-model="property.is_enable_pinyin" active-text="" inactive-text=""> </el-switch>
+        <el-switch v-model="property.view_pinyin" active-value="true" inactive-value="false" />
       </el-form-item>
-      <el-form-item label="拼音位置" v-if="property.is_enable_pinyin">
-        <el-radio-group v-model="property.pinyin_position">
-          <el-radio v-for="{ value, label } in positionList" :key="value" :label="value" :value="value">
-            {{ label }}
-          </el-radio>
-        </el-radio-group>
+      <el-form-item label="拼音位置">
+        <el-radio
+          v-for="{ value, label } in pinyinPositionList"
+          :key="value"
+          v-model="property.pinyin_position"
+          :label="value"
+          :disabled="!isEnable(property.view_pinyin)"
+        >
+          {{ label }}
+        </el-radio>
       </el-form-item>
-      <el-form-item label="" v-if="property.is_enable_pinyin">
-        <el-checkbox v-model="property.is_enable_sentence_case">句首大写</el-checkbox>
+      <el-form-item label="">
+        <el-checkbox
+          v-model="property.is_first_sentence_first_hz_pinyin_first_char_upper_case"
+          :disabled="!isEnable(property.view_pinyin)"
+          true-label="true"
+          false-label="false"
+          >句首大写</el-checkbox
+        >
       </el-form-item>
       <el-form-item label="多语言">
         <el-radio-group v-model="property.multilingual_position">
@@ -127,6 +137,7 @@ import {
   getRole,
   roleTypeList,
   multilingualList,
+  pinyinPositionList,
 } from '@/views/book/courseware/data/dialogueArticle';
 const Base64 = require('js-base64').Base64;
 import cnchar from 'cnchar';
@@ -142,6 +153,7 @@ export default {
       positionList,
       roleTypeList,
       multilingualList,
+      pinyinPositionList,
     };
   },
   computed: {

+ 3 - 5
src/views/book/courseware/create/components/question/newWord_template/NewWordTemplate.vue

@@ -32,7 +32,7 @@
         </div>
         <div class="option-item">
           <template v-if="data.property.model === 'input'">
-            <template v-if="isEnable(data.property.is_enable_pinyin)">
+            <template v-if="isEnable(data.property.view_pinyin)">
               <span>共用拼音:</span>
               <el-radio-group v-model="item.is_common_pinyin">
                 <el-radio :label="true">是</el-radio>
@@ -40,9 +40,7 @@
               </el-radio-group>
             </template>
             <template
-              v-if="
-                isEnable(data.property.is_enable_pinyin) && data.property.model === 'input' && item.is_common_pinyin
-              "
+              v-if="isEnable(data.property.view_pinyin) && data.property.model === 'input' && item.is_common_pinyin"
             >
               <span>拼音</span>
               <el-input v-model="item.pinyin" placeholder="输入拼音"></el-input>
@@ -94,7 +92,7 @@
             <div class="option-item">
               <template
                 v-if="
-                  isEnable(data.property.is_enable_pinyin) &&
+                  isEnable(data.property.view_pinyin) &&
                   (data.property.model === 'miao' || (data.property.model === 'input' && !item.is_common_pinyin))
                 "
               >

+ 1 - 1
src/views/book/courseware/create/components/question/newWord_template/NewWordTemplateSetting.vue

@@ -10,7 +10,7 @@
         </el-radio-group>
       </el-form-item>
       <el-form-item label="拼音">
-        <el-radio-group v-model="property.is_enable_pinyin">
+        <el-radio-group v-model="property.view_pinyin">
           <el-radio v-for="{ value, label } in showList" :key="value" :label="value">
             {{ label }}
           </el-radio>

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

@@ -73,7 +73,7 @@ export function getCharacterProperty() {
     sn_position: serialNumberPositionList[3].value,
     sn_display_mode: displayList[0].value,
 
-    is_enable_pinyin: showList[0].value,
+    view_pinyin: showList[0].value,
     frame_type: 'tian',
     frame_color: '#F13232',
     is_enable_stroke: showList[0].value,

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

@@ -81,7 +81,7 @@ export function getCharacterBaseProperty() {
     audio_generation_method: audioGenerationMethodList[0].value,
     is_enable_voice_answer: switchOption[0].value,
 
-    is_enable_pinyin: showList[0].value,
+    view_pinyin: showList[0].value,
     fun_type: 'show',
     is_enable_voice: showList[0].value,
     frame_type: 'tian',

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

@@ -119,7 +119,7 @@ export function getCharacterStructureProperty() {
     sn_position: serialNumberPositionList[3].value,
     sn_display_mode: displayList[0].value,
     
-    is_enable_pinyin: showList[0].value,
+    view_pinyin: showList[0].value,
   };
 }
 

+ 9 - 7
src/views/book/courseware/data/dialogueArticle.js

@@ -5,10 +5,11 @@ import {
   arrangeTypeList,
   switchOption,
   isEnable,
+  pinyinPositionList
 } from '@/views/book/courseware/data/common';
 import { getRandomNumber } from '@/utils';
 
-export { arrangeTypeList, switchOption, isEnable };
+export { arrangeTypeList, switchOption, isEnable,pinyinPositionList };
 
 export const roleDefaultColorList = ['#306EFF', '#3ABD38', '#FC8E3D', '#FC493D', '#BF3DFC']; // 角色默认颜色
 
@@ -35,7 +36,7 @@ export const inforList = [
 ];
 
 // 拼音位置
-export const pinyinPositionList = [
+export const pinyinPositionLists = [
   { value: 'front', label: '前面' },
   { value: 'back', label: '后面' },
   { value: 'top', label: '上面' },
@@ -90,9 +91,10 @@ export function getArticleProperty() {
     is_enable_new_word: switchOption[0].value,
     is_enable_read: switchOption[0].value,
     is_enable_word: switchOption[0].value,
-    is_enable_pinyin: true,
-    pinyin_position: positionList[0].value,
-    is_enable_sentence_case: true,
+    view_pinyin: 'true',
+    pinyin_position: pinyinPositionList[0].value,
+    is_first_sentence_first_hz_pinyin_first_char_upper_case: 'true', // 句首大写
+
     role_img_type: 'word',
     role_list: [getRole(0), getRole(1)],
     
@@ -131,7 +133,7 @@ export function getArticleData() {
       title_con: '',
       property: {
         audio_generation_method: audioGenerationMethodList[0].value,
-        pinyin_position: pinyinPositionList[0].value,
+        pinyin_position: pinyinPositionLists[0].value,
         auto_wrap: switchOption[0].value, // 自动换行
         is_has_infor: inforList[0].value,
       },
@@ -175,7 +177,7 @@ export function getArticleData() {
       title_con: '',
       property: {
         audio_generation_method: audioGenerationMethodList[0].value,
-        pinyin_position: pinyinPositionList[0].value,
+        pinyin_position: pinyinPositionLists[0].value,
         auto_wrap: switchOption[0].value, // 自动换行
         is_has_infor: inforList[0].value,
       },

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

@@ -88,7 +88,7 @@ export function getNewWordTemplateProperty() {
     sn_display_mode: displayList[0].value,
 
     is_enable_play_structure: showList[0].value,
-    is_enable_pinyin: showList[0].value,
+    view_pinyin: showList[0].value,
     is_enable_high_strokes: showList[0].value,
     model:modelList[0].value,
     

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

@@ -14,18 +14,18 @@
           <div
             class="number-box"
             :style="{
-              marginTop: isEnable(data.property.is_enable_pinyin) ? '30px' : '',
+              marginTop: isEnable(data.property.view_pinyin) ? '30px' : '',
             }"
           >
             <span class="number">{{ index + 1 }}</span>
           </div>
           <div class="pinyin-en" :class="[item.is_example ? 'item-example' : '']">
-            <div v-if="isEnable(data.property.is_enable_pinyin) && item.is_common_pinyin" class="pinyin">
+            <div v-if="isEnable(data.property.view_pinyin) && item.is_common_pinyin" class="pinyin">
               {{ item.pinyin }}
             </div>
             <div class="items-flex">
               <div class="items" v-for="(items, indexs) in item.content_list" :key="indexs">
-                <div v-if="isEnable(data.property.is_enable_pinyin) && !item.is_common_pinyin" class="pinyin">
+                <div v-if="isEnable(data.property.view_pinyin) && !item.is_common_pinyin" class="pinyin">
                   {{ items.pinyin }}
                 </div>
                 <div class="items-content">
@@ -139,7 +139,7 @@
                   theme-color="gray"
                   v-if="isEnable(data.property.is_enable_voice)"
                 />
-                <span class="pinyin" v-if="isEnable(data.property.is_enable_pinyin) && item.is_common_pinyin">{{
+                <span class="pinyin" v-if="isEnable(data.property.view_pinyin) && item.is_common_pinyin">{{
                   item.pinyin
                 }}</span>
               </div>
@@ -148,7 +148,7 @@
               <!-- 描红 -->
               <template v-for="(items, indexs) in item.content_list">
                 <div v-if="item.is_show_ben" :key="'miao' + indexs">
-                  <!-- <div v-if="isEnable(data.property.is_enable_pinyin) && !item.is_common_pinyin" class="pinyin">
+                  <!-- <div v-if="isEnable(data.property.view_pinyin) && !item.is_common_pinyin" class="pinyin">
                     {{ items.pinyin }}
                   </div> -->
                   <Strockplayredline

+ 1 - 1
src/views/book/courseware/preview/components/character_base/CharacterBasePreview.vue

@@ -6,7 +6,7 @@
     <div class="main">
       <div class="main-top" :style="{ width: data.hz_strokes_list.length * 64 + 'px' }">
         <AudioPlay v-if="isEnable(data.property.is_enable_voice)" :file-id="data.audio_file_id" theme-color="gray" />
-        <span v-if="isEnable(data.property.is_enable_pinyin)" class="pinyin">{{ data.pinyin }}</span>
+        <span v-if="isEnable(data.property.view_pinyin)" class="pinyin">{{ data.pinyin }}</span>
       </div>
       <div class="strock-chinese-box">
         <template v-if="data.property.fun_type === 'show'">

+ 2 - 2
src/views/book/courseware/preview/components/character_structure/CharacterStructurePreview.vue

@@ -37,7 +37,7 @@
             {{ row + 1 }}
           </div>
           <div class="hzpinyin">
-            <div class="pinyin" v-if="isEnable(data.property.is_enable_pinyin)">
+            <div class="pinyin" v-if="isEnable(data.property.view_pinyin)">
               {{ items.pinyin }}
             </div>
             <template v-if="items.hz_info.length > 0">
@@ -118,7 +118,7 @@
               {{ row + 1 }}
             </div>
             <div class="hzpinyin">
-              <div class="pinyin" v-if="isEnable(data.property.is_enable_pinyin)">
+              <div class="pinyin" v-if="isEnable(data.property.view_pinyin)">
                 {{ items.pinyin }}
               </div>
               <template v-if="items.hz_info.length > 0">

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

@@ -703,7 +703,7 @@ export default {
               wordIndex: wIndex, //单词的索引
               pinyin:
                 curQue.pinyin_type === 'pinyin'
-                  ? curQue.property.is_enable_sentence_case && wIndex === 0
+                  ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
                     ? wItem.pinyin_up
                     : wItem.pinyin
                   : wItem.pinyin_tone,

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

@@ -616,7 +616,7 @@ export default {
               wordIndex: wIndex, //单词的索引
               pinyin:
                 curQue.pinyin_type === 'pinyin'
-                  ? curQue.property.is_enable_sentence_case && wIndex === 0
+                  ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
                     ? wItem.pinyin_up
                     : wItem.pinyin
                   : wItem.pinyin_tone,

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

@@ -806,7 +806,7 @@ export default {
               wordIndex: wIndex, //单词的索引
               pinyin:
                 curQue.pinyin_type === 'pinyin'
-                  ? curQue.property.is_enable_sentence_case && wIndex === 0
+                  ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
                     ? wItem.pinyin_up
                     : wItem.pinyin
                   : wItem.pinyin_tone,

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

@@ -576,7 +576,7 @@ export default {
               wordIndex: wIndex, //单词的索引
               pinyin:
                 curQue.pinyin_type === 'pinyin'
-                  ? curQue.property.is_enable_sentence_case && wIndex === 0
+                  ? curQue.property.is_first_sentence_first_hz_pinyin_first_char_upper_case === 'true' && wIndex === 0
                     ? wItem.pinyin_up
                     : wItem.pinyin
                   : wItem.pinyin_tone,

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

@@ -209,7 +209,7 @@ export default {
               this.config.isHasEN = true;
             }
             let pinyin = this.handleObj(this.data.detail[i].wordsList);
-            if (pinyin && this.data.property.is_enable_pinyin) {
+            if (pinyin && this.isEnable(this.data.property.view_pinyin)) {
               this.config.isShowPY = true;
               this.config.isHasPY = true;
             }
@@ -475,7 +475,7 @@ export default {
           resArr.push(objs);
         });
         timeArr.push(dItem.timeList);
-        if (curQue.property.is_enable_pinyin) {
+        if (this.isEnable(curQue.property.view_pinyin)) {
           dhaspinyinArr.push(dhaspinyin);
         }
       });

+ 6 - 8
src/views/book/courseware/preview/components/newWord_template/NewWordTemplatePreview.vue

@@ -13,7 +13,7 @@
         <div
           class="number-box"
           :style="{
-            marginTop: isEnable(data.property.is_enable_pinyin)
+            marginTop: isEnable(data.property.view_pinyin)
               ? '30px'
               : data.answer_type.indexOf('pinyin') > -1 && data.property.model === 'input'
                 ? '52px'
@@ -24,7 +24,7 @@
         </div>
         <div class="pinyin-en" :class="[item.is_example ? 'item-example' : '']">
           <div
-            v-if="isEnable(data.property.is_enable_pinyin) && data.property.model === 'input' && item.is_common_pinyin"
+            v-if="isEnable(data.property.view_pinyin) && data.property.model === 'input' && item.is_common_pinyin"
             class="pinyin"
           >
             {{ item.pinyin }}
@@ -51,7 +51,7 @@
             >
               <div
                 v-if="
-                  isEnable(data.property.is_enable_pinyin) &&
+                  isEnable(data.property.view_pinyin) &&
                   (data.property.model === 'miao' || (data.property.model === 'input' && !item.is_common_pinyin))
                 "
                 class="pinyin"
@@ -154,7 +154,7 @@
           <div
             class="number-box"
             :style="{
-              marginTop: isEnable(data.property.is_enable_pinyin)
+              marginTop: isEnable(data.property.view_pinyin)
                 ? '30px'
                 : data.answer_type.indexOf('pinyin') > -1 && data.property.model === 'input'
                   ? '52px'
@@ -165,9 +165,7 @@
           </div>
           <div class="pinyin-en" :class="[item.is_example ? 'item-example' : '']">
             <div
-              v-if="
-                isEnable(data.property.is_enable_pinyin) && data.property.model === 'input' && item.is_common_pinyin
-              "
+              v-if="isEnable(data.property.view_pinyin) && data.property.model === 'input' && item.is_common_pinyin"
               class="pinyin"
             >
               {{ item.pinyin }}
@@ -193,7 +191,7 @@
               >
                 <div
                   v-if="
-                    isEnable(data.property.is_enable_pinyin) &&
+                    isEnable(data.property.view_pinyin) &&
                     (data.property.model === 'miao' || (data.property.model === 'input' && !item.is_common_pinyin))
                   "
                   class="pinyin"