|
|
@@ -586,7 +586,6 @@ export default {
|
|
|
type: 'notice',
|
|
|
paraIndex: 0,
|
|
|
sentences: [],
|
|
|
- segList: [],
|
|
|
seg_words: [],
|
|
|
wordsList: [],
|
|
|
timeList: [],
|
|
|
@@ -602,9 +601,11 @@ export default {
|
|
|
obj.roleIndex = null;
|
|
|
obj.notice = content;
|
|
|
obj.type = 'notice';
|
|
|
+ this.$set(obj, 'noticeSegList', []);
|
|
|
} else {
|
|
|
obj.para = content;
|
|
|
obj.type = 'text';
|
|
|
+ this.$set(obj, 'segList', []);
|
|
|
let role = this.data.property.role_list.find((items) => items.fullName === prefix);
|
|
|
if (!role) {
|
|
|
// 角色名不存在
|
|
|
@@ -625,6 +626,7 @@ export default {
|
|
|
obj.roleIndex = this.curRole;
|
|
|
obj.para = content;
|
|
|
obj.type = 'text';
|
|
|
+ this.$set(obj, 'segList', []);
|
|
|
}
|
|
|
this.data.detail.push(obj);
|
|
|
});
|
|
|
@@ -739,8 +741,11 @@ export default {
|
|
|
item.paraIndex = index;
|
|
|
if (item.type === 'text') {
|
|
|
textList += `${item.para}\n`;
|
|
|
+ } else if (item.type === 'notice') {
|
|
|
+ textList += `${item.notice}\n`;
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
BatchSegContent({
|
|
|
text: textList,
|
|
|
is_build_pinyin: 'true',
|
|
|
@@ -754,7 +759,7 @@ export default {
|
|
|
let i = 0;
|
|
|
this.data.detail.forEach((item, index) => {
|
|
|
item.paraIndex = index;
|
|
|
- if (item.type === 'text') {
|
|
|
+ if (item.type === 'text' || item.type === 'notice') {
|
|
|
let sentenceList = []; // 句子按段数组
|
|
|
let segList = []; // 句子分词结果
|
|
|
res.paragraph_list[i].forEach((items) => {
|
|
|
@@ -764,8 +769,12 @@ export default {
|
|
|
segList.push(seg);
|
|
|
});
|
|
|
this.data.detail[index].sentences = sentenceList;
|
|
|
- this.data.detail[index].segList = segList;
|
|
|
- this.setWordsList(res.paragraph_list[i], index);
|
|
|
+ if (item.type === 'text') {
|
|
|
+ this.data.detail[index].segList = segList;
|
|
|
+ } else {
|
|
|
+ this.data.detail[index].noticeSegList = segList;
|
|
|
+ }
|
|
|
+ this.setWordsList(res.paragraph_list[i], index, item.type);
|
|
|
i++;
|
|
|
}
|
|
|
});
|
|
|
@@ -833,12 +842,20 @@ export default {
|
|
|
this.data.detail.forEach((item) => {
|
|
|
item.sentences.forEach((items, indexs) => {
|
|
|
let word_list = [];
|
|
|
-
|
|
|
- item.segList[indexs].forEach((itemw) => {
|
|
|
- word_list.push({
|
|
|
- word: itemw,
|
|
|
+ if (item.type === 'text') {
|
|
|
+ item.segList[indexs].forEach((itemw) => {
|
|
|
+ word_list.push({
|
|
|
+ word: itemw,
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
+ } else if (item.type === 'notice') {
|
|
|
+ item.noticeSegList[indexs].forEach((itemw) => {
|
|
|
+ word_list.push({
|
|
|
+ word: itemw,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
let obj = {
|
|
|
sentence: items,
|
|
|
word_list,
|
|
|
@@ -847,7 +864,7 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- setWordsList(list, paraIndex) {
|
|
|
+ setWordsList(list, paraIndex, type) {
|
|
|
let wordsList = [];
|
|
|
list.forEach((item, index) => {
|
|
|
let sentArr = [];
|
|
|
@@ -868,7 +885,7 @@ export default {
|
|
|
pinyin: sItem.pinyin,
|
|
|
pinyin_up: sItem.pinyin_up,
|
|
|
pinyin_tone: sItem.pinyin_tone,
|
|
|
- fontFamily: '楷体',
|
|
|
+ fontFamily: type === 'text' ? '楷体' : '',
|
|
|
textDecoration: '',
|
|
|
fontWeight: '',
|
|
|
border: '',
|
|
|
@@ -883,7 +900,11 @@ export default {
|
|
|
});
|
|
|
wordsList.push(sentArr);
|
|
|
});
|
|
|
- this.data.detail[paraIndex].wordsList = wordsList;
|
|
|
+ if (type === 'text') {
|
|
|
+ this.data.detail[paraIndex].wordsList = wordsList;
|
|
|
+ } else {
|
|
|
+ this.$set(this.data.detail[paraIndex], 'noticeWordList', wordsList);
|
|
|
+ }
|
|
|
},
|
|
|
uploadAudioSuccess(fileList) {
|
|
|
if (fileList.length > 0) {
|
|
|
@@ -920,6 +941,8 @@ export default {
|
|
|
item.paraIndex = index;
|
|
|
if (item.type === 'text') {
|
|
|
textList += `${item.para}\n`;
|
|
|
+ } else if (item.type === 'notice') {
|
|
|
+ textList += `${item.notice}\n`;
|
|
|
}
|
|
|
});
|
|
|
BatchSegContent({
|
|
|
@@ -941,7 +964,7 @@ export default {
|
|
|
let sentence = items.reduce((acc, itemss) => `${acc + itemss.text}`, '');
|
|
|
let sentenceS = items.reduce((acc, itemss) => `${acc + itemss.text} `, '');
|
|
|
let seg = items.map((itemss) => itemss.text);
|
|
|
- para += items.map((itemss) => itemss.text);
|
|
|
+ para += items.map((itemss) => itemss.text).join('');
|
|
|
sentenceList.push(sentence);
|
|
|
sentenceStr.push(sentenceS);
|
|
|
segList.push(seg);
|
|
|
@@ -952,7 +975,7 @@ export default {
|
|
|
pinyin: sItem.pinyin,
|
|
|
pinyin_up: sItem.pinyin_up,
|
|
|
pinyin_tone: sItem.pinyin_tone,
|
|
|
- fontFamily: '楷体',
|
|
|
+ fontFamily: this.data.detail[index] && this.data.detail[index].type === 'notice' ? '' : '楷体',
|
|
|
textDecoration: '',
|
|
|
fontWeight: '',
|
|
|
border: '',
|
|
|
@@ -968,17 +991,36 @@ export default {
|
|
|
wordsList.push(sentArr);
|
|
|
});
|
|
|
if (this.data.detail[index]) {
|
|
|
- this.data.detail[index].segList = segList;
|
|
|
this.data.detail[index].para = para;
|
|
|
+
|
|
|
this.data.detail[index].sentenceStr = sentenceStr;
|
|
|
this.data.detail[index].sentences = sentenceList;
|
|
|
- this.data.detail[index].wordsList = wordsList;
|
|
|
+ if (this.data.detail[index].type === 'text') {
|
|
|
+ this.data.detail[index].wordsList = wordsList;
|
|
|
+ this.data.detail[index].segList = segList;
|
|
|
+ } else {
|
|
|
+ this.$set(this.data.detail[index], 'noticeWordList', wordsList);
|
|
|
+ this.$set(this.data.detail[index], 'noticeSegList', segList);
|
|
|
+ }
|
|
|
} else {
|
|
|
let obj = {
|
|
|
+ roleIndex: this.curRole,
|
|
|
paraIndex: index,
|
|
|
para,
|
|
|
+ type: 'text',
|
|
|
+
|
|
|
+ remark: {
|
|
|
+ chs: '',
|
|
|
+ en: '',
|
|
|
+ heightNumber: null,
|
|
|
+ img_list: [],
|
|
|
+ widthNumber: null,
|
|
|
+ chsBg: '#988ed6',
|
|
|
+ enBg: '#fff',
|
|
|
+ },
|
|
|
+ paraIndex: index,
|
|
|
sentences: sentenceList,
|
|
|
- segList: item,
|
|
|
+ segList: segList,
|
|
|
seg_words: [],
|
|
|
wordsList,
|
|
|
timeList: [],
|
|
|
@@ -1019,16 +1061,29 @@ export default {
|
|
|
img,
|
|
|
imgPosition,
|
|
|
) {
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].fontFamily = fontFamily;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].textDecoration = textDecoration;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].fontWeight = fontWeight;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].border = border;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].color = color;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].matchWords = matchWords;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].matchNotes = matchNotes;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].notesColor = notesColor;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].img = img;
|
|
|
- this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].imgPosition = imgPosition;
|
|
|
+ if (this.data.detail[paraIndex].type === 'notice') {
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].fontFamily = fontFamily;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].textDecoration = textDecoration;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].fontWeight = fontWeight;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].border = border;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].color = color;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].matchWords = matchWords;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].matchNotes = matchNotes;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].notesColor = notesColor;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].img = img;
|
|
|
+ this.data.detail[paraIndex].noticeWordList[sentenceIndex][wordIndex].imgPosition = imgPosition;
|
|
|
+ } else {
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].fontFamily = fontFamily;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].textDecoration = textDecoration;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].fontWeight = fontWeight;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].border = border;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].color = color;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].matchWords = matchWords;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].matchNotes = matchNotes;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].notesColor = notesColor;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].img = img;
|
|
|
+ this.data.detail[paraIndex].wordsList[sentenceIndex][wordIndex].imgPosition = imgPosition;
|
|
|
+ }
|
|
|
},
|
|
|
// 保存校对
|
|
|
saveCompare() {
|