|
|
@@ -58,7 +58,10 @@
|
|
|
<template v-if="resArr.length > 0">
|
|
|
<div class="NPC-sentences-list">
|
|
|
<div class="NPC-article-empty">
|
|
|
- <div :class="['empty-left', isHasRemark ? 'hasRemark' : '']"></div>
|
|
|
+ <div
|
|
|
+ :class="['empty-left', isHasRemark ? 'hasRemark' : '']"
|
|
|
+ :style="{ width: curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '' }"
|
|
|
+ ></div>
|
|
|
<div class="empty-right"></div>
|
|
|
</div>
|
|
|
<div
|
|
|
@@ -75,6 +78,7 @@
|
|
|
'article-content',
|
|
|
isHasRemark ? 'hasRemark' : '',
|
|
|
]"
|
|
|
+ :style="{ width: curQue.property.remarkWidth ? 100 - curQue.property.remarkWidth * 1 + '%' : '' }"
|
|
|
>
|
|
|
<template v-if="item.sourceList.length > 0 && item.sourcePosition === 'before'">
|
|
|
<img
|
|
|
@@ -179,7 +183,11 @@
|
|
|
? attrib.topic_color
|
|
|
: pItem.notesColor
|
|
|
? pItem.notesColor
|
|
|
- : pItem.config.color,
|
|
|
+ : annotationList.indexOf(pItem.chs) > -1
|
|
|
+ ? NNPEAnnotationList.find(
|
|
|
+ (item) => item.con.replace(/<[^>]*>?/gm, '') === pItem.chs,
|
|
|
+ ).notesColor
|
|
|
+ : pItem.config.color,
|
|
|
}"
|
|
|
@click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
|
|
|
>{{ convertText(pItem.chs[wIndex]) }}</span
|
|
|
@@ -242,7 +250,11 @@
|
|
|
fontWeight: item.wordsList[pIndex + 1].config.fontWeight,
|
|
|
color: item.wordsList[pIndex + 1].notesColor
|
|
|
? item.wordsList[pIndex + 1].notesColor
|
|
|
- : item.wordsList[pIndex + 1].config.color,
|
|
|
+ : annotationList.indexOf(item.wordsList[pIndex + 1].chs) > -1
|
|
|
+ ? NNPEAnnotationList.find(
|
|
|
+ (item) => item.con.replace(/<[^>]*>?/gm, '') === item.wordsList[pIndex + 1].chs,
|
|
|
+ ).notesColor
|
|
|
+ : item.wordsList[pIndex + 1].config.color,
|
|
|
height:
|
|
|
attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
|
|
|
fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
|
|
|
@@ -338,7 +350,11 @@
|
|
|
fontWeight: item.wordsList[pIndex + 2].config.fontWeight,
|
|
|
color: item.wordsList[pIndex + 2].notesColor
|
|
|
? item.wordsList[pIndex + 2].notesColor
|
|
|
- : item.wordsList[pIndex + 2].config.color,
|
|
|
+ : annotationList.indexOf(item.wordsList[pIndex + 2].chs) > -1
|
|
|
+ ? NNPEAnnotationList.find(
|
|
|
+ (item) => item.con.replace(/<[^>]*>?/gm, '') === item.wordsList[pIndex + 2].chs,
|
|
|
+ ).notesColor
|
|
|
+ : item.wordsList[pIndex + 2].config.color,
|
|
|
height:
|
|
|
attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
|
|
|
fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
|
|
|
@@ -458,7 +474,11 @@
|
|
|
? attrib.topic_color
|
|
|
: pItem.notesColor
|
|
|
? pItem.notesColor
|
|
|
- : pItem.config.color,
|
|
|
+ : annotationList.indexOf(pItem.chs) > -1
|
|
|
+ ? NNPEAnnotationList.find(
|
|
|
+ (item) => item.con.replace(/<[^>]*>?/gm, '') === pItem.chs,
|
|
|
+ ).notesColor
|
|
|
+ : pItem.config.color,
|
|
|
}"
|
|
|
@click.stop="viewNotes($event, pItem.chs[wIndex], pItem.chs, pItem)"
|
|
|
>{{ convertText(pItem.chs[wIndex]) }}</span
|
|
|
@@ -860,7 +880,13 @@
|
|
|
textDecoration: pItem.config.textDecoration,
|
|
|
borderBottom: pItem.config.border === 'dotted' ? '1px dotted' : '',
|
|
|
fontWeight: pItem.config.fontWeight,
|
|
|
- color: pItem.notesColor ? pItem.notesColor : pItem.config.color,
|
|
|
+ color: pItem.notesColor
|
|
|
+ ? pItem.notesColor
|
|
|
+ : annotationList.indexOf(pItem.chs) > -1
|
|
|
+ ? NNPEAnnotationList.find(
|
|
|
+ (item) => item.con.replace(/<[^>]*>?/gm, '') === pItem.chs,
|
|
|
+ ).notesColor
|
|
|
+ : pItem.config.color,
|
|
|
height:
|
|
|
attrib && attrib.font_size ? attrib.font_size.replace('pt', '') * 1.4 + 'pt' : '28px',
|
|
|
fontSize: attrib && attrib.font_size ? attrib.font_size : '20px',
|
|
|
@@ -1100,6 +1126,7 @@ export default {
|
|
|
left: 0,
|
|
|
articleImg: {}, // 文章图片
|
|
|
newWordList: [],
|
|
|
+ annotationList: [],
|
|
|
word: null,
|
|
|
isShow: false,
|
|
|
screenHeight: 0,
|
|
|
@@ -1180,7 +1207,10 @@ export default {
|
|
|
created() {},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
- if (this.NNPENewWordList && this.NNPENewWordList.length > 0) {
|
|
|
+ if (
|
|
|
+ (this.NNPENewWordList && this.NNPENewWordList.length > 0) ||
|
|
|
+ (this.NNPEAnnotationList && this.NNPEAnnotationList.length > 0)
|
|
|
+ ) {
|
|
|
this.handleNewword();
|
|
|
}
|
|
|
if (this.curQue) {
|
|
|
@@ -1525,6 +1555,15 @@ export default {
|
|
|
// });
|
|
|
});
|
|
|
this.newWordList = JSON.parse(JSON.stringify(NewWordList));
|
|
|
+ let annotationList = [];
|
|
|
+ this.NNPEAnnotationList.forEach((wItem) => {
|
|
|
+ // item.forEach((wItem) => {
|
|
|
+ if (wItem.con) {
|
|
|
+ annotationList.push(wItem.con.replace(/<[^>]*>?/gm, ''));
|
|
|
+ }
|
|
|
+ // });
|
|
|
+ });
|
|
|
+ this.annotationList = JSON.parse(JSON.stringify(annotationList));
|
|
|
},
|
|
|
|
|
|
showWordDetail(e, word, words) {
|
|
|
@@ -1635,6 +1674,18 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ } else if (
|
|
|
+ _this.NNPEAnnotationList &&
|
|
|
+ _this.NNPEAnnotationList.length > 0 &&
|
|
|
+ _this.annotationList.indexOf(words.chs) > -1
|
|
|
+ ) {
|
|
|
+ _this.NNPEAnnotationList.forEach((item, indexs) => {
|
|
|
+ let textContent = item.con.replace(/<[^>]*>?/gm, '');
|
|
|
+ if (textContent === words.chs.trim()) {
|
|
|
+ noteIndex = `${String(indexs)}`;
|
|
|
+ this.showNoteDetail(e, noteIndex);
|
|
|
+ }
|
|
|
+ });
|
|
|
} else if (this.newWordList.indexOf(noteNum) > -1) {
|
|
|
if (_this.oldHz !== noteNum) {
|
|
|
this.isShow = false;
|