Forráskód Böngészése

修改词表跳转高量问题

qinpeng 2 éve
szülő
commit
66ba0eb7eb
2 módosított fájl, 29 hozzáadás és 11 törlés
  1. 26 8
      src/views/Textanalysis/WordTable.vue
  2. 3 3
      src/views/Textanalysis/index.vue

+ 26 - 8
src/views/Textanalysis/WordTable.vue

@@ -93,7 +93,7 @@
               </div>
             </th>
           </tr>
-          <tr v-for="(item, i) in dataList.list" :key="i + 'td'">
+          <tr v-for="(item, index) in dataList.list" :key="index + 'td'">
             <td class="sort-td">{{ item.number }}</td>
             <td :class="['sort-td', typeIndex == 0 ? 'pinyin' : '']">
               <span
@@ -139,7 +139,12 @@
               class="sort-td"
               style="cursor: pointer"
               @click="
-                backHighlight(item, levelMap[item.levelName].color, 'all')
+                backHighlight(
+                  item,
+                  levelMap[item.levelName].color,
+                  'all',
+                  index
+                )
               "
             >
               {{ item.freq }}
@@ -149,7 +154,12 @@
               <div style="display: flex; flex-wrap: wrap">
                 <span
                   @click="
-                    backHighlight(items, levelMap[item.levelName].color, 'one')
+                    backHighlight(
+                      items,
+                      levelMap[item.levelName].color,
+                      'one',
+                      index
+                    )
                   "
                   v-for="(items, i) in item.remarks"
                   :key=""
@@ -448,15 +458,23 @@ export default {
   //方法集合
   methods: {
     // 返回并高亮对应数据
-    backHighlight(item, color, type) {
+    backHighlight(item, color, type, index) {
       let data = JSON.parse(JSON.stringify(this.routerData));
       let arr = [];
       if (type == "all") {
-        item.remarks.forEach((items) => {
-          arr.push(items.word);
-        });
+        if (this.typeIndex == 0) {
+          item.remarks.forEach((items) => {
+            arr.push(items.word);
+          });
+        } else {
+          arr.push(this.dataList.list[index].word);
+        }
       } else {
-        arr.push(item.word);
+        if (this.typeIndex == 0) {
+          arr.push(item.word);
+        } else {
+          arr.push(this.dataList.list[index].word);
+        }
       }
       data.remarks = JSON.stringify(arr);
       data.color = color;

+ 3 - 3
src/views/Textanalysis/index.vue

@@ -508,13 +508,13 @@ export default {
     // 取消搜索高亮
     closeSearchhighlight() {
       this.ArticelData.forEach((item) => {
-        item.forEach((items) => {
-          items.forEach((itemss) => {
+        // item.forEach((items) => {
+          item.forEach((itemss) => {
             itemss.text.forEach((itemsss) => {
               itemsss.color = null;
             });
           });
-        });
+        // });
       });
     },
     // 取消等级高亮