Bläddra i källkod

教材语料库

natasha 1 år sedan
förälder
incheckning
568c37d547
2 ändrade filer med 43 tillägg och 26 borttagningar
  1. 4 8
      src/views/Textanalysis/index.vue
  2. 39 18
      src/views/corpus/seekPage.vue

+ 4 - 8
src/views/Textanalysis/index.vue

@@ -236,9 +236,7 @@
                   <span class="line"></span>
                   <span>{{ base.pinyinCount }} / {{ base.pinyinTextCount }}</span>
                 </div>
-                <div class="twoline">
-                  <span class="line"></span>
-                </div>
+                <div class="twoline"></div>
                 <div title="采用TTR公式衡量文本丰富度,汉字丰富度指不同汉字数量与总数量的比值。">
                   <span
                     >汉字丰富度
@@ -249,9 +247,7 @@
                   <span class="line"></span>
                   <span>{{ base.wordCount }} / {{ base.wordTextCount }}</span>
                 </div>
-                <div class="twoline">
-                  <span class="line"></span>
-                </div>
+                <div class="twoline"></div>
                 <div title="采用TTR公式衡量文本丰富度,词汇丰富度指不同词汇数量与总数量的比值。">
                   <span
                     >词汇丰富度
@@ -1071,14 +1067,14 @@ export default {
         this.base.pinyinCount +
         '/' +
         this.base.pinyinTextCount +
-        '  |  ' +
+        '    ' +
         '汉字丰富度 ' +
         (this.difficulty.wordDifficulty * 1).toFixed(2) +
         ' | ' +
         this.base.wordCount +
         '/' +
         this.base.wordTextCount +
-        '  |  ' +
+        '    ' +
         '词汇丰富度 ' +
         (this.difficulty.vocabularyDifficulty * 1).toFixed(2) +
         ' | ' +

+ 39 - 18
src/views/corpus/seekPage.vue

@@ -570,29 +570,50 @@ export default {
           item.name = item.book_name + ' ' + percent.toFixed(2) + '%';
         }
       });
-      if (this.rightTopIndex === 1 && this.corpus.scope.length > 0) {
+      if (this.rightTopIndex === 1) {
         let data = [];
         let tempdata = {};
-        this.corpus.scope.forEach((str) => {
-          if (!tempdata[str[0]]) {
+        if (this.corpus.scope.length === 0) {
+          this.levelList.forEach((item) => {
             let obj = {
-              name: str[0],
+              name: item.label,
               children: [],
             };
-            tempdata[str[0]] = obj;
-          }
-          let childObj = {
-            name: '',
-            value: 0,
-          };
-          if (this.bookSourceObj[str[1]]) {
-            childObj.name = this.bookSourceObj[str[1]].book_name + ' ' + this.bookSourceObj[str[1]].percent + '%';
-            childObj.value = this.bookSourceObj[str[1]].count;
+            item.children.forEach((items) => {
+              let childObj = {
+                name: '',
+                value: 0,
+              };
+              if (this.bookSourceObj[items.id]) {
+                childObj.name = items.name + ' ' + this.bookSourceObj[items.id].percent + '%';
+                childObj.value = this.bookSourceObj[items.id].count;
+              }
+              obj.children.push(childObj);
+            });
+            data.push(obj);
+          });
+        } else {
+          this.corpus.scope.forEach((str) => {
+            if (!tempdata[str[0]]) {
+              let obj = {
+                name: str[0],
+                children: [],
+              };
+              tempdata[str[0]] = obj;
+            }
+            let childObj = {
+              name: '',
+              value: 0,
+            };
+            if (this.bookSourceObj[str[1]]) {
+              childObj.name = this.bookSourceObj[str[1]].book_name + ' ' + this.bookSourceObj[str[1]].percent + '%';
+              childObj.value = this.bookSourceObj[str[1]].count;
+            }
+            tempdata[str[0]].children.push(childObj);
+          });
+          for (const key in tempdata) {
+            data.push(tempdata[key]);
           }
-          tempdata[str[0]].children.push(childObj);
-        });
-        for (const key in tempdata) {
-          data.push(tempdata[key]);
         }
         option = {
           title: {
@@ -845,7 +866,7 @@ export default {
             if (this.rightTopIndex === 0) {
               this.rightList = res.stat_list_word_definition;
             } else {
-              this.rightList = res.stat_list_sentence_source_book_series_code;
+              this.rightList = res.stat_list_sentence_source_book;
             }
             this.getrightListdata();
             if (this.patternIndex === 0) {