Bladeren bron

文章统一拼音字段

natasha 2 dagen geleden
bovenliggende
commit
8fdc033009

+ 22 - 11
src/views/book/courseware/create/components/question/article/ArticleSetting.vue

@@ -33,18 +33,29 @@
         </el-radio-group>
       </el-form-item>
       <el-divider />
+
       <el-form-item label="拼音">
-        <el-switch v-model="property.is_enable_pinyin" active-text="" inactive-text="" />
+        <el-switch v-model="property.view_pinyin" active-value="true" inactive-value="false" />
       </el-form-item>
-      <el-form-item v-if="property.is_enable_pinyin" label="拼音位置">
-        <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 v-if="property.is_enable_pinyin" label="">
-        <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">
@@ -63,9 +74,9 @@ import SettingMixin from '@/views/book/courseware/create/components/common/Setti
 import {
   getArticleProperty,
   switchOption,
-  positionList,
   isEnable,
   multilingualList,
+  pinyinPositionList,
 } from '@/views/book/courseware/data/article';
 
 export default {
@@ -76,7 +87,7 @@ export default {
       property: getArticleProperty(),
       switchOption,
       isEnable,
-      positionList,
+      pinyinPositionList,
       multilingualList,
     };
   },

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

@@ -5,9 +5,10 @@ import {
   arrangeTypeList,
   switchOption,
   isEnable,
+  pinyinPositionList
 } from '@/views/book/courseware/data/common';
 
-export { arrangeTypeList, switchOption, isEnable };
+export { arrangeTypeList, switchOption, isEnable, pinyinPositionList };
 
 // 显示
 export const positionList = [
@@ -32,7 +33,7 @@ export const inforList = [
 ];
 
 // 拼音位置
-export const pinyinPositionList = [
+export const pinyinPositionLists = [
   { value: 'front', label: '前面' },
   { value: 'back', label: '后面' },
   { value: 'top', label: '上面' },
@@ -71,9 +72,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', // 句首大写
+
     multilingual_position: multilingualList[1].value,
   };
 }
@@ -92,7 +94,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,
       },
@@ -137,7 +139,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,
       },

+ 2 - 2
src/views/book/courseware/preview/components/article/NormalModelChs.vue

@@ -1127,7 +1127,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,
@@ -1195,7 +1195,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/article/PhraseModelChs.vue

@@ -888,7 +888,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,
@@ -941,7 +941,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/article/Practicechs.vue

@@ -738,7 +738,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/article/WordModelChs.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,
@@ -863,7 +863,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/article/index.vue

@@ -263,7 +263,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;
             }
@@ -480,7 +480,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);
         }
       });