|
@@ -63,7 +63,10 @@
|
|
|
v-if="
|
|
|
item.wordsList[pIndex + 1] &&
|
|
|
item.wordsList[pIndex + 1].chs &&
|
|
|
- chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1
|
|
|
+ (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) >
|
|
|
+ -1 ||
|
|
|
+ NumberList.indexOf(item.wordsList[pIndex + 1].chs) >
|
|
|
+ -1)
|
|
|
"
|
|
|
>
|
|
|
<span class="NNPE-words-box">
|
|
@@ -74,6 +77,7 @@
|
|
|
pItem.className ? pItem.className : '',
|
|
|
noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
|
|
|
]"
|
|
|
+ @click.stop="viewNotes($event, pItem.pinyin)"
|
|
|
>{{ pItem.pinyin }}</span
|
|
|
>
|
|
|
<span
|
|
@@ -81,7 +85,10 @@
|
|
|
'NNPE-chs',
|
|
|
newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
|
|
|
]"
|
|
|
- >{{ pItem.chs }}</span
|
|
|
+ @click.stop="viewNotes($event, pItem.chs)"
|
|
|
+ >{{ NumberList.indexOf(pItem.pinyin) == -1
|
|
|
+ ? pItem.chs
|
|
|
+ : "" }}</span
|
|
|
>
|
|
|
<span
|
|
|
v-if="
|
|
@@ -92,6 +99,7 @@
|
|
|
pItem.className ? pItem.className : '',
|
|
|
noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
|
|
|
]"
|
|
|
+ @click.stop="viewNotes($event, pItem.pinyin)"
|
|
|
>{{ pItem.pinyin }}</span
|
|
|
>
|
|
|
</span>
|
|
@@ -106,10 +114,25 @@
|
|
|
: '',
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ @click.stop="
|
|
|
+ viewNotes(
|
|
|
+ $event,
|
|
|
+ item.wordsList[pIndex + 1].pinyin
|
|
|
+ )
|
|
|
+ "
|
|
|
>{{ item.wordsList[pIndex + 1].pinyin }}</span
|
|
|
>
|
|
|
- <span class="NNPE-chs" style="text-align: left">{{
|
|
|
- item.wordsList[pIndex + 1].chs
|
|
|
+ <span class="NNPE-chs" style="text-align: left" @click.stop="
|
|
|
+ viewNotes(
|
|
|
+ $event,
|
|
|
+ item.wordsList[pIndex + 1].chs
|
|
|
+ )
|
|
|
+ ">{{
|
|
|
+ NumberList.indexOf(
|
|
|
+ item.wordsList[pIndex + 1].pinyin
|
|
|
+ ) == -1
|
|
|
+ ? item.wordsList[pIndex + 1].chs
|
|
|
+ : ""
|
|
|
}}</span>
|
|
|
<span
|
|
|
v-if="
|
|
@@ -123,6 +146,12 @@
|
|
|
: '',
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ @click.stop="
|
|
|
+ viewNotes(
|
|
|
+ $event,
|
|
|
+ item.wordsList[pIndex + 1].pinyin
|
|
|
+ )
|
|
|
+ "
|
|
|
>{{ item.wordsList[pIndex + 1].pinyin }}</span
|
|
|
>
|
|
|
</span>
|
|
@@ -132,7 +161,11 @@
|
|
|
v-if="
|
|
|
item.wordsList[pIndex + 2] &&
|
|
|
item.wordsList[pIndex + 2].chs &&
|
|
|
- chsFhList.indexOf(item.wordsList[pIndex + 2].chs) > -1
|
|
|
+ (chsFhList.indexOf(item.wordsList[pIndex + 2].chs) >
|
|
|
+ -1 ||
|
|
|
+ NumberList.indexOf(
|
|
|
+ item.wordsList[pIndex + 2].chs
|
|
|
+ ) > -1)
|
|
|
"
|
|
|
>
|
|
|
<span
|
|
@@ -145,10 +178,25 @@
|
|
|
: '',
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ @click.stop="
|
|
|
+ viewNotes(
|
|
|
+ $event,
|
|
|
+ item.wordsList[pIndex + 2].pinyin
|
|
|
+ )
|
|
|
+ "
|
|
|
>{{ item.wordsList[pIndex + 2].pinyin }}</span
|
|
|
>
|
|
|
- <span class="NNPE-chs" style="text-align: left">{{
|
|
|
- item.wordsList[pIndex + 2].chs
|
|
|
+ <span class="NNPE-chs" style="text-align: left" @click.stop="
|
|
|
+ viewNotes(
|
|
|
+ $event,
|
|
|
+ item.wordsList[pIndex + 2].chs
|
|
|
+ )
|
|
|
+ ">{{
|
|
|
+ NumberList.indexOf(
|
|
|
+ item.wordsList[pIndex + 2].pinyin
|
|
|
+ ) == -1
|
|
|
+ ? item.wordsList[pIndex + 2].chs
|
|
|
+ : ""
|
|
|
}}</span>
|
|
|
<span
|
|
|
v-if="
|
|
@@ -162,6 +210,12 @@
|
|
|
: '',
|
|
|
]"
|
|
|
style="text-align: left"
|
|
|
+ @click.stop="
|
|
|
+ viewNotes(
|
|
|
+ $event,
|
|
|
+ item.wordsList[pIndex + 2].pinyin
|
|
|
+ )
|
|
|
+ "
|
|
|
>{{ item.wordsList[pIndex + 2].pinyin }}</span
|
|
|
>
|
|
|
</span>
|
|
@@ -175,6 +229,7 @@
|
|
|
pItem.className ? pItem.className : '',
|
|
|
noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
|
|
|
]"
|
|
|
+ @click.stop="viewNotes($event, pItem.pinyin)"
|
|
|
>{{ pItem.pinyin }}</span
|
|
|
>
|
|
|
<span
|
|
@@ -183,7 +238,10 @@
|
|
|
pItem.chs != '“' && pItem.padding ? 'padding' : '',
|
|
|
newWordList.indexOf(pItem.chs) > -1 ? 'active' : '',
|
|
|
]"
|
|
|
- >{{ pItem.chs }}</span
|
|
|
+ @click.stop="viewNotes($event, pItem.chs)"
|
|
|
+ >{{ NumberList.indexOf(pItem.pinyin) == -1
|
|
|
+ ? pItem.chs
|
|
|
+ : "" }}</span
|
|
|
>
|
|
|
<span
|
|
|
v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
|
|
@@ -193,6 +251,7 @@
|
|
|
pItem.className ? pItem.className : '',
|
|
|
noFont.indexOf(pItem.pinyin) > -1 ? 'noFont' : '',
|
|
|
]"
|
|
|
+ @click.stop="viewNotes($event, pItem.pinyin)"
|
|
|
>{{ pItem.pinyin }}</span
|
|
|
>
|
|
|
</template>
|
|
@@ -230,6 +289,15 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <template v-if="isNoteShow">
|
|
|
+ <div
|
|
|
+ ref="notecard"
|
|
|
+ class="NNPE-wordDetail"
|
|
|
+ :style="{ top: top + 'px', left: left + 'px' }"
|
|
|
+ >
|
|
|
+ <Notecard :item="curNoteCon" :changeCard="changeCard" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -237,6 +305,7 @@
|
|
|
import { timeStrToSen } from "../../../../utils/index";
|
|
|
import AudioLine from "../AudioLine.vue";
|
|
|
import Wordcard from "../components/Wordcard.vue"; // 卡片
|
|
|
+import Notecard from "../components/Notecard.vue"; // 注释
|
|
|
export default {
|
|
|
name: "PhraseModelChs",
|
|
|
props: [
|
|
@@ -248,17 +317,41 @@ export default {
|
|
|
"currentTreeID",
|
|
|
"config",
|
|
|
"TaskModel",
|
|
|
+ "NNPEAnnotationList",
|
|
|
],
|
|
|
components: {
|
|
|
AudioLine,
|
|
|
Wordcard,
|
|
|
+ Notecard
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
resArr: [],
|
|
|
curTime: 0, //单位s
|
|
|
- chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";"],
|
|
|
+ chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";", "#"],
|
|
|
enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
|
|
|
+ NumberList: [
|
|
|
+ "①",
|
|
|
+ "②",
|
|
|
+ "③",
|
|
|
+ "④",
|
|
|
+ "⑤",
|
|
|
+ "⑥",
|
|
|
+ "⑦",
|
|
|
+ "⑧",
|
|
|
+ "⑨",
|
|
|
+ "⑩",
|
|
|
+ "⑪",
|
|
|
+ "⑫",
|
|
|
+ "⑬",
|
|
|
+ "⑭",
|
|
|
+ "⑮",
|
|
|
+ "⑯",
|
|
|
+ "⑰",
|
|
|
+ "⑱",
|
|
|
+ "⑲",
|
|
|
+ "⑳",
|
|
|
+ ],
|
|
|
newWords: ["鱼", "辩礼义"],
|
|
|
oldHz: "",
|
|
|
hz: "",
|
|
@@ -272,6 +365,12 @@ export default {
|
|
|
screenHeight: 0,
|
|
|
cardHeight: 0,
|
|
|
contentWidth: 732,
|
|
|
+ noteNum: "",
|
|
|
+ curNoteCon: null,
|
|
|
+ isNoteShow: false,
|
|
|
+ oldNoteNum: "",
|
|
|
+ clientY: 0,
|
|
|
+ clickType: "",
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -303,6 +402,34 @@ export default {
|
|
|
// 深度观察监听
|
|
|
deep: true,
|
|
|
},
|
|
|
+ noteNum: {
|
|
|
+ handler: function (val, oldVal) {
|
|
|
+ let _this = this;
|
|
|
+ if (val) {
|
|
|
+ _this.handleNote(val);
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 深度观察监听
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
+ isNoteShow: {
|
|
|
+ handler: function (val, oldVal) {
|
|
|
+ let _this = this;
|
|
|
+ if (val) {
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.cardHeight = _this.$refs.notecard.offsetHeight;
|
|
|
+ if (_this.screenHeight - _this.clientY > _this.cardHeight) {
|
|
|
+ _this.top = _this.clientY + 20;
|
|
|
+ } else {
|
|
|
+ _this.top = _this.clientY - _this.cardHeight - 30;
|
|
|
+ }
|
|
|
+ }, 50);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 深度观察监听
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
@@ -388,7 +515,8 @@ export default {
|
|
|
// wItem.chs = "<a>" + wItem.chs + "</a><a>" + chs + "</a>";
|
|
|
// wItem.pinyin = "<a>" + wItem.pinyin + "</a><a>" + pinyin + "</a>";
|
|
|
// }
|
|
|
- if (this.chsFhList.indexOf(wItem.chs) > -1) {
|
|
|
+ if (this.chsFhList.indexOf(wItem.chs) > -1 ||
|
|
|
+ this.NumberList.indexOf(wItem.chs) > -1) {
|
|
|
wItem.isShow = false;
|
|
|
} else {
|
|
|
wItem.isShow = true;
|
|
@@ -508,6 +636,55 @@ export default {
|
|
|
console.log(this.curQue.Bookanswer);
|
|
|
}
|
|
|
},
|
|
|
+ viewNotes(e, noteNum) {
|
|
|
+ let _this = this;
|
|
|
+ _this.clickType = "note";
|
|
|
+ let noteIndex = "";
|
|
|
+ if (_this.NumberList.indexOf(noteNum) > -1) {
|
|
|
+ for (let i = 0; i < _this.NumberList.length; i++) {
|
|
|
+ if (_this.NumberList[i] == noteNum) {
|
|
|
+ noteIndex = "" + i + "";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.showNoteDetail(e, noteIndex);
|
|
|
+ },
|
|
|
+ showNoteDetail(e, noteNum) {
|
|
|
+ let _this = this;
|
|
|
+ if (_this.oldNoteNum != noteNum) {
|
|
|
+ this.isNoteShow = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ _this.noteNum = noteNum;
|
|
|
+ }, 50);
|
|
|
+ }
|
|
|
+ _this.clientY = e.clientY;
|
|
|
+ let left = e.clientX;
|
|
|
+ let width = 642;
|
|
|
+ if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
+ _this.left = left - width + 10;
|
|
|
+ } else {
|
|
|
+ _this.left = left - 200;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理注释数据
|
|
|
+ handleNote(val) {
|
|
|
+ let _this = this;
|
|
|
+ _this.isNoteShow = true;
|
|
|
+ _this.oldNoteNum = val;
|
|
|
+ let noteIndex = Number(val);
|
|
|
+ if (_this.NNPEAnnotationList && _this.NNPEAnnotationList.length > 0) {
|
|
|
+ _this.curNoteCon = _this.NNPEAnnotationList[noteIndex]
|
|
|
+ ? _this.NNPEAnnotationList[noteIndex]
|
|
|
+ : null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeCard(isShow) {
|
|
|
+ let _this = this;
|
|
|
+ _this.isNoteShow = isShow;
|
|
|
+ _this.oldNoteNum = "";
|
|
|
+ _this.noteNum = "";
|
|
|
+ },
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|