|
@@ -100,6 +100,15 @@
|
|
|
:translations="data.multilingual"
|
|
|
@SubmitTranslation="handleMultilingualTranslation"
|
|
|
/>
|
|
|
+ <el-divider v-if="isEnable(data.property.view_pinyin)" content-position="left">拼音效果</el-divider>
|
|
|
+ <PinyinText
|
|
|
+ v-if="isEnable(data.property.view_pinyin)"
|
|
|
+ :id="'table_pinyin_text'"
|
|
|
+ ref="PinyinText"
|
|
|
+ :paragraph-list="data.paragraph_list"
|
|
|
+ :pinyin-position="data.property.pinyin_position"
|
|
|
+ @fillCorrectPinyin="fillCorrectPinyin"
|
|
|
+ />
|
|
|
</template>
|
|
|
</ModuleBase>
|
|
|
</template>
|
|
@@ -107,8 +116,10 @@
|
|
|
<script>
|
|
|
import { isEnable } from '@/views/book/courseware/data/common';
|
|
|
import ModuleMixin from '../../common/ModuleMixin';
|
|
|
+import { CrateParsedTextInfo_Pinyin } from '@/api/book';
|
|
|
|
|
|
import { getRandomNumber } from '@/utils';
|
|
|
+import PinyinText from '@/components/PinyinText.vue';
|
|
|
|
|
|
import {
|
|
|
getTableData,
|
|
@@ -120,7 +131,9 @@ import {
|
|
|
|
|
|
export default {
|
|
|
name: 'Table',
|
|
|
- components: {},
|
|
|
+ components: {
|
|
|
+ PinyinText,
|
|
|
+ },
|
|
|
mixins: [ModuleMixin],
|
|
|
data() {
|
|
|
return {
|
|
@@ -129,6 +142,8 @@ export default {
|
|
|
tableTypeList,
|
|
|
fontFamilyList,
|
|
|
multilingualText: '',
|
|
|
+ isViewExplanatoryNoteDialog: false,
|
|
|
+ oldRichData: {},
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -173,10 +188,28 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
},
|
|
|
+ 'data.property.view_pinyin': {
|
|
|
+ handler(val) {
|
|
|
+ let text = '';
|
|
|
+ this.data.option_list.forEach((item) => {
|
|
|
+ item.forEach((items) => {
|
|
|
+ text += items.content.replace(/<[^>]+>/g, '') + '\n';
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (isEnable(val) && text) {
|
|
|
+ this.data.paragraph_list_parameter.text = text;
|
|
|
+ this.data.paragraph_list_parameter.is_first_sentence_first_hz_pinyin_first_char_upper_case =
|
|
|
+ val.is_first_sentence_first_hz_pinyin_first_char_upper_case;
|
|
|
+ this.crateParsedTextInfoPinyin(text);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
methods: {
|
|
|
// 识别文本
|
|
|
identifyText() {
|
|
|
+ let text = '';
|
|
|
this.data.has_identify = 'true';
|
|
|
this.data.option_list.forEach((item, index) => {
|
|
|
item.forEach((items, indexs) => {
|
|
@@ -208,8 +241,12 @@ export default {
|
|
|
// .replace(/<span class="rich-fill".*?>(.*?)<\/span>|([_]{3,})/gi, '###$1$2###');
|
|
|
});
|
|
|
}
|
|
|
+ text += items.content.replace(/<[^>]+>/g, '') + '\n';
|
|
|
});
|
|
|
});
|
|
|
+ if (isEnable(this.data.property.view_pinyin)) {
|
|
|
+ this.crateParsedTextInfoPinyin(text);
|
|
|
+ }
|
|
|
},
|
|
|
// 分割富文本
|
|
|
splitRichText(str) {
|
|
@@ -247,6 +284,32 @@ export default {
|
|
|
}
|
|
|
return arr;
|
|
|
},
|
|
|
+ // 获取拼音解析文本
|
|
|
+ crateParsedTextInfoPinyin(text) {
|
|
|
+ if (text === '') {
|
|
|
+ this.data.paragraph_list_parameter.pinyin_proofread_word_list = [];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.data.paragraph_list_parameter.text = text.replace(/<[^>]+>/g, '');
|
|
|
+ this.data.paragraph_list_parameter.is_first_sentence_first_hz_pinyin_first_char_upper_case =
|
|
|
+ this.data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case;
|
|
|
+ CrateParsedTextInfo_Pinyin(this.data.paragraph_list_parameter).then((res) => {
|
|
|
+ if (res.parsed_text) {
|
|
|
+ this.data.paragraph_list = res.parsed_text.paragraph_list;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 填充校对后的拼音
|
|
|
+ fillCorrectPinyin(selectContent, tonePinyin, i, j, k) {
|
|
|
+ this.data.paragraph_list_parameter.pinyin_proofread_word_list.push({
|
|
|
+ paragraph_index: i,
|
|
|
+ sentence_index: j,
|
|
|
+ word_index: k,
|
|
|
+ word: selectContent,
|
|
|
+ pinyin: tonePinyin,
|
|
|
+ });
|
|
|
+ this.data.paragraph_list[i][j][k].pinyin = tonePinyin;
|
|
|
+ },
|
|
|
// 思维导图数据
|
|
|
handleMindMap() {
|
|
|
let node_list = [];
|