|
|
@@ -57,6 +57,22 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <el-divider v-if="isEnable(data.property.view_pinyin)" content-position="left">拼音效果</el-divider>
|
|
|
+ <template v-if="isEnable(data.property.view_pinyin)">
|
|
|
+ <div v-for="(item, i) in data.model_essay" :key="i" class="pinyin-text-list">
|
|
|
+ <template v-for="(li, j) in item">
|
|
|
+ <PinyinText
|
|
|
+ v-if="li.type === 'text'"
|
|
|
+ :key="`${i}-${j}`"
|
|
|
+ ref="PinyinText"
|
|
|
+ :paragraph-list="li.paragraph_list"
|
|
|
+ :pinyin-position="data.property.pinyin_position"
|
|
|
+ @fillCorrectPinyin="fillCorrectPinyin($event, i, j, 'model_essay')"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<MultilingualFill
|
|
|
:visible.sync="multilingualVisible"
|
|
|
:text="data.content"
|
|
|
@@ -71,6 +87,7 @@
|
|
|
import ModuleMixin from '../../common/ModuleMixin';
|
|
|
import SoundRecord from '@/views/book/courseware/create/components/question/fill/components/SoundRecord.vue';
|
|
|
import UploadAudio from '@/views/book/courseware/create/components/question/fill/components/UploadAudio.vue';
|
|
|
+import PinyinText from '@/components/PinyinText.vue';
|
|
|
|
|
|
import { getFillData, arrangeTypeList, fillFontList, fillTypeList } from '@/views/book/courseware/data/fill';
|
|
|
import { addTone, handleToneValue } from '@/views/book/courseware/data/common';
|
|
|
@@ -82,6 +99,7 @@ export default {
|
|
|
components: {
|
|
|
SoundRecord,
|
|
|
UploadAudio,
|
|
|
+ PinyinText,
|
|
|
},
|
|
|
mixins: [ModuleMixin],
|
|
|
data() {
|
|
|
@@ -108,6 +126,20 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
+ 'data.property': {
|
|
|
+ handler({ view_pinyin }) {
|
|
|
+ if (!this.isEnable(view_pinyin)) return;
|
|
|
+ this.data.model_essay.forEach((item, i) => {
|
|
|
+ item.forEach((option, j) => {
|
|
|
+ const text = option.content.replace(/<[^>]+>/g, '');
|
|
|
+ if (!text) return;
|
|
|
+ option.paragraph_list_parameter.text = text;
|
|
|
+ this.createParsedTextInfoPinyin(text, i, j, 'model_essay');
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
// 识别文本
|
|
|
@@ -139,7 +171,15 @@ export default {
|
|
|
index = _str.indexOf('###', start);
|
|
|
if (index === -1) break;
|
|
|
matchNum += 1;
|
|
|
- arr.push({ content: _str.slice(start, index), type: 'text' });
|
|
|
+ arr.push({
|
|
|
+ content: _str.slice(start, index),
|
|
|
+ type: 'text',
|
|
|
+ paragraph_list: [],
|
|
|
+ paragraph_list_parameter: {
|
|
|
+ text: '',
|
|
|
+ pinyin_proofread_word_list: [],
|
|
|
+ },
|
|
|
+ });
|
|
|
if (matchNum % 2 === 0 && arr.length > 0) {
|
|
|
arr[arr.length - 1].type = 'input';
|
|
|
arr[arr.length - 1].audio_answer_list = [];
|
|
|
@@ -161,7 +201,15 @@ export default {
|
|
|
}
|
|
|
let last = _str.slice(start);
|
|
|
if (last) {
|
|
|
- arr.push({ content: last, type: 'text' });
|
|
|
+ arr.push({
|
|
|
+ content: last,
|
|
|
+ type: 'text',
|
|
|
+ paragraph_list: [],
|
|
|
+ paragraph_list_parameter: {
|
|
|
+ text: '',
|
|
|
+ pinyin_proofread_word_list: [],
|
|
|
+ },
|
|
|
+ });
|
|
|
}
|
|
|
return arr;
|
|
|
},
|