|
@@ -199,7 +199,23 @@ export default {
|
|
|
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.data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case;
|
|
|
+ this.crateParsedTextInfoPinyin(text);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
+ 'data.property.is_first_sentence_first_hz_pinyin_first_char_upper_case': {
|
|
|
+ handler(val) {
|
|
|
+ let text = '';
|
|
|
+ this.data.option_list.forEach((item) => {
|
|
|
+ item.forEach((items) => {
|
|
|
+ text += items.content.replace(/<[^>]+>/g, '') + '\n';
|
|
|
+ });
|
|
|
+ });
|
|
|
+ if (text) {
|
|
|
+ this.data.paragraph_list_parameter.text = text;
|
|
|
+ this.data.paragraph_list_parameter.is_first_sentence_first_hz_pinyin_first_char_upper_case = val;
|
|
|
this.crateParsedTextInfoPinyin(text);
|
|
|
}
|
|
|
},
|
|
@@ -295,20 +311,39 @@ export default {
|
|
|
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;
|
|
|
+ const mergedData = res.parsed_text.paragraph_list.map((outerArr, i) =>
|
|
|
+ outerArr.map((innerArr, j) =>
|
|
|
+ innerArr.map((newItem, k) => {
|
|
|
+ // 从 originalData 中找到对应的项
|
|
|
+ const originalItem = this.data.paragraph_list[i]?.[j]?.[k];
|
|
|
+
|
|
|
+ // 如果 originalItem 有 activeTextStyle,就合并到 newItem
|
|
|
+ if (originalItem?.activeTextStyle) {
|
|
|
+ return {
|
|
|
+ ...newItem,
|
|
|
+ activeTextStyle: originalItem.activeTextStyle,
|
|
|
+ };
|
|
|
+ }
|
|
|
+ // 否则直接返回 newItem
|
|
|
+ return newItem;
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ this.data.paragraph_list = mergedData;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 填充校对后的拼音
|
|
|
- fillCorrectPinyin(selectContent, tonePinyin, i, j, k) {
|
|
|
+ fillCorrectPinyin(selectContent, 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,
|
|
|
+ word: selectContent.text,
|
|
|
+ pinyin: selectContent.pinyin,
|
|
|
});
|
|
|
- this.data.paragraph_list[i][j][k].pinyin = tonePinyin;
|
|
|
+ if (selectContent.pinyin) this.data.paragraph_list[i][j][k].pinyin = selectContent.pinyin;
|
|
|
+ this.data.paragraph_list[i][j][k].activeTextStyle = selectContent.activeTextStyle;
|
|
|
},
|
|
|
// 思维导图数据
|
|
|
handleMindMap() {
|