浏览代码

显示生词

guanchunjie 3 年之前
父节点
当前提交
6c851e0d85
共有 1 个文件被更改,包括 15 次插入8 次删除
  1. 15 8
      src/components/Adult/preview/ArticleViewChs/PhraseModelChs.vue

+ 15 - 8
src/components/Adult/preview/ArticleViewChs/PhraseModelChs.vue

@@ -335,7 +335,10 @@ export default {
     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));
     },
@@ -373,15 +376,18 @@ export default {
       this.hz = "";
     },
     // 处理分词数据
-    handleNewWords(val) {
+    handleNewWords(val, top, left) {
       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 };
-          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;
@@ -525,8 +531,9 @@ export default {
         clear: both;
       }
       > img {
-        width: 100%;
+        max-width: 100%;
         display: block;
+        margin: 0 auto;
       }
     }
   }