|
@@ -44,6 +44,7 @@
|
|
|
<template v-if="pItem.isShow">
|
|
|
<template
|
|
|
v-if="
|
|
|
+ item.wordsList[pIndex + 1] &&
|
|
|
item.wordsList[pIndex + 1].chs &&
|
|
|
chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1
|
|
|
"
|
|
@@ -97,9 +98,11 @@
|
|
|
pItem.padding ? 'padding' : '',
|
|
|
pItem.className ? pItem.className : '',
|
|
|
]"
|
|
|
+ @click.stop="viewNotes($event, pItem.pinyin)"
|
|
|
>{{ pItem.pinyin }}</span
|
|
|
>
|
|
|
<span
|
|
|
+ v-if="pItem.chs != '#'"
|
|
|
class="NNPE-chs"
|
|
|
:class="[
|
|
|
newWordList.indexOf(pItem.chs) > -1
|
|
@@ -159,6 +162,15 @@
|
|
|
<Wordcard :word="word" :changeWordCard="changeWordCard" />
|
|
|
</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>
|
|
|
|
|
@@ -166,18 +178,26 @@
|
|
|
import { timeStrToSen } from "@/utils/index";
|
|
|
import AudioLine from "../AudioLine.vue";
|
|
|
import Wordcard from "../components/Wordcard.vue"; // 卡片
|
|
|
+import Notecard from "../components/Notecard.vue"; // 注释
|
|
|
import RoleChs from "./RoleChs.vue";
|
|
|
import RemarkChs from "./RemarkChs.vue";
|
|
|
import Soundrecord from "../Soundrecord.vue";
|
|
|
export default {
|
|
|
name: "PhraseModelChs",
|
|
|
- props: ["curQue", "bodyLeft", "NNPENewWordList", "colorBox"],
|
|
|
+ props: [
|
|
|
+ "curQue",
|
|
|
+ "bodyLeft",
|
|
|
+ "NNPENewWordList",
|
|
|
+ "NNPEAnnotationList",
|
|
|
+ "colorBox",
|
|
|
+ ],
|
|
|
components: {
|
|
|
AudioLine,
|
|
|
Wordcard,
|
|
|
RoleChs,
|
|
|
RemarkChs,
|
|
|
Soundrecord,
|
|
|
+ Notecard,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -185,6 +205,28 @@ export default {
|
|
|
curTime: 0, //单位s
|
|
|
chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
|
|
|
enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
|
|
|
+ NumberList: [
|
|
|
+ "①",
|
|
|
+ "②",
|
|
|
+ "③",
|
|
|
+ "④",
|
|
|
+ "⑤",
|
|
|
+ "⑥",
|
|
|
+ "⑦",
|
|
|
+ "⑧",
|
|
|
+ "⑨",
|
|
|
+ "⑩",
|
|
|
+ "⑪",
|
|
|
+ "⑫",
|
|
|
+ "⑬",
|
|
|
+ "⑭",
|
|
|
+ "⑮",
|
|
|
+ "⑯",
|
|
|
+ "⑰",
|
|
|
+ "⑱",
|
|
|
+ "⑲",
|
|
|
+ "⑳",
|
|
|
+ ],
|
|
|
newWords: ["鱼", "辩礼义"],
|
|
|
oldHz: "",
|
|
|
hz: "",
|
|
@@ -197,6 +239,11 @@ export default {
|
|
|
screenHeight: 0,
|
|
|
cardHeight: 0,
|
|
|
isHasRemark: false,
|
|
|
+ clickType: "",
|
|
|
+ isNoteShow: false,
|
|
|
+ noteNum: "",
|
|
|
+ oldNoteNum: "",
|
|
|
+ curNoteCon: null,
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -228,6 +275,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) {
|
|
|
+ debugger;
|
|
|
+ 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: {
|
|
@@ -249,7 +324,7 @@ export default {
|
|
|
dItem.wordsList.forEach((sItem, sIndex) => {
|
|
|
sItem.forEach((wItem, wIndex) => {
|
|
|
//this.judgePad(sItem, wItem, wIndex);
|
|
|
- this.mergeWordSymbol(sItem, wItem, wIndex);
|
|
|
+ this.mergeWordSymbol(wItem);
|
|
|
let obj = {
|
|
|
paraIndex: dIndex, //段落索引
|
|
|
sentIndex: sIndex, //在段落中句子索引
|
|
@@ -287,26 +362,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//词和标点合一起
|
|
|
- mergeWordSymbol(sItem, wItem, curIndex) {
|
|
|
- let leg = sItem.length;
|
|
|
- if (curIndex < leg - 1) {
|
|
|
- let nextIndex = curIndex + 1;
|
|
|
- let chs = sItem[nextIndex].chs;
|
|
|
- let pinyin = sItem[nextIndex].pinyin;
|
|
|
- // if (this.chsFhList.indexOf(chs) > -1) {
|
|
|
- // 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) {
|
|
|
- wItem.isShow = false;
|
|
|
- } else {
|
|
|
- wItem.isShow = true;
|
|
|
- }
|
|
|
+ mergeWordSymbol(wItem) {
|
|
|
+ if (this.chsFhList.indexOf(wItem.chs) > -1) {
|
|
|
+ wItem.isShow = false;
|
|
|
+ } else {
|
|
|
+ wItem.isShow = true;
|
|
|
}
|
|
|
-
|
|
|
- // if (this.enFhList.indexOf(wItem.pinyin) > -1) {
|
|
|
- // wItem.className = "textLeft";
|
|
|
- // }
|
|
|
},
|
|
|
//获取角色
|
|
|
getRole(dItem) {
|
|
@@ -357,10 +418,14 @@ export default {
|
|
|
this.curTime = time;
|
|
|
this.$refs.audioLine.onTimeupdateTime(time);
|
|
|
},
|
|
|
+
|
|
|
handleNewword() {
|
|
|
let NewWordList = [];
|
|
|
this.NNPENewWordList.forEach((item) => {
|
|
|
- NewWordList.push(item.new_word);
|
|
|
+ item.forEach((wItem) => {
|
|
|
+ console.log(wItem.new_word);
|
|
|
+ NewWordList.push(wItem.new_word);
|
|
|
+ });
|
|
|
});
|
|
|
this.newWordList = JSON.parse(JSON.stringify(NewWordList));
|
|
|
},
|
|
@@ -376,6 +441,7 @@ export default {
|
|
|
_this.top = e.clientY + 20;
|
|
|
let left = e.clientX;
|
|
|
let width = 0;
|
|
|
+
|
|
|
if (word.length == 1 || word.length == 2) {
|
|
|
width = 304;
|
|
|
} else if (word.length == 3 || word.length == 4) {
|
|
@@ -383,6 +449,7 @@ export default {
|
|
|
} else if (word.length > 3) {
|
|
|
width = 560;
|
|
|
}
|
|
|
+
|
|
|
if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
_this.left = left - width + 10;
|
|
|
} else {
|
|
@@ -402,15 +469,68 @@ export default {
|
|
|
this.isShow = true;
|
|
|
this.word = null;
|
|
|
for (let i = 0; i < this.NNPENewWordList.length; i++) {
|
|
|
- let item = this.NNPENewWordList[i];
|
|
|
- if (item.new_word.trim() == val.trim()) {
|
|
|
- let wordlist = val.split("");
|
|
|
- this.word = { list: wordlist, detail: item, top: top, left: left };
|
|
|
- break;
|
|
|
+ let pItem = this.NNPENewWordList[i];
|
|
|
+ for (let j = 0; j < pItem.length; j++) {
|
|
|
+ let item = pItem[j];
|
|
|
+ if (item.new_word.trim() == val.trim()) {
|
|
|
+ let wordlist = val.split("");
|
|
|
+ this.word = { list: wordlist, detail: item, top: top, left: left };
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
this.oldHz = val;
|
|
|
},
|
|
|
+ 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 = 442;
|
|
|
+
|
|
|
+ if (left - this.bodyLeft > this.contentWidth / 2) {
|
|
|
+ _this.left = left - width + 10;
|
|
|
+ } else {
|
|
|
+ _this.left = left;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 处理注释数据
|
|
|
+ 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 = "";
|
|
|
+ },
|
|
|
getScreenHeight() {
|
|
|
this.screenHeight = window.innerHeight;
|
|
|
},
|