|
@@ -213,14 +213,14 @@
|
|
|
style="margin-right: 12px"
|
|
|
inactive-text="分词"
|
|
|
/>
|
|
|
- <el-switch
|
|
|
+ <!-- <el-switch
|
|
|
v-if="fenci"
|
|
|
v-model="cixing"
|
|
|
active-color="#735CFF"
|
|
|
:width="26"
|
|
|
style="margin-right: 12px"
|
|
|
inactive-text="词性"
|
|
|
- />
|
|
|
+ /> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="right_main">
|
|
@@ -265,7 +265,7 @@
|
|
|
<span>{{ base.vocabularyCount }} / {{ base.vocabularyTextCount }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <span class="edit-btn" @click="editArticle()"><i class="el-icon-edit"></i>修改文本</span>
|
|
|
+ <!-- <span class="edit-btn" @click="editArticle()"><i class="el-icon-edit"></i>修改文本</span> -->
|
|
|
</div>
|
|
|
<div class="articel">
|
|
|
<div v-for="(items, index) in ArticelData" :key="index + 'paragraph'" class="paragraph">
|
|
@@ -1002,13 +1002,14 @@ export default {
|
|
|
ArticelData: null,
|
|
|
seleLevelMapList: [],
|
|
|
difficulty: {},
|
|
|
- textContent: '',
|
|
|
+ textContent: [],
|
|
|
routerData: null,
|
|
|
id: null,
|
|
|
userID: this.$route.query.userID,
|
|
|
cixing: false, // 词性开关
|
|
|
editArticleFlag: false, // 修改文本
|
|
|
noPosContent: '',
|
|
|
+ cixing_ttr_list: [],
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -1331,11 +1332,12 @@ export default {
|
|
|
// 找出对应字符的索引
|
|
|
calculateIndex(txt, key) {
|
|
|
return new Promise((reslove) => {
|
|
|
- // 去除标点
|
|
|
- let keylength = key.length;
|
|
|
+ // 去除标点]
|
|
|
+ const regex = /[\u4e00-\u9fa5]/g;
|
|
|
+ let keylength = regex.test(key) ? key.length : key.split(' ').length;
|
|
|
let arr = [];
|
|
|
for (let i = 0; i < txt.length; i++) {
|
|
|
- if (txt[i] === key[0]) {
|
|
|
+ if (txt[i] === (regex.test(key) ? key[0] : key)) {
|
|
|
arr.push(i);
|
|
|
}
|
|
|
}
|
|
@@ -1343,7 +1345,7 @@ export default {
|
|
|
arr.forEach((item) => {
|
|
|
let arr = [];
|
|
|
for (let i = 0; i < keylength; i++) {
|
|
|
- if (txt[item + i] === key[i]) {
|
|
|
+ if (txt[item + i] === (regex.test(key) ? key[i] : key)) {
|
|
|
arr.push(item + i);
|
|
|
} else {
|
|
|
arr = [];
|
|
@@ -1809,7 +1811,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
this.ArticelData = newdata;
|
|
|
- let str = '';
|
|
|
+ let str = [];
|
|
|
// 合并标点
|
|
|
this.ArticelData.forEach((item) => {
|
|
|
item.forEach((items) => {
|
|
@@ -1846,7 +1848,7 @@ export default {
|
|
|
itemsss.isShow = true;
|
|
|
}
|
|
|
}
|
|
|
- str += itemsss.word;
|
|
|
+ str.push(itemsss.word);
|
|
|
});
|
|
|
if (itemss.pinyin_lt) {
|
|
|
itemss.wordStr = wordStr;
|