Quellcode durchsuchen

重新解析 词表取消词头文本 增加排序,

qinpeng vor 2 Jahren
Ursprung
Commit
10b9838031

+ 33 - 15
src/views/Textanalysis/WordTable.vue

@@ -17,10 +17,10 @@
               >词汇</span
             >
           </div>
-          <el-radio-group v-model="headText">
+          <!-- <el-radio-group v-model="headText">
             <el-radio :label="1">词头</el-radio>
             <el-radio :label="2">文本</el-radio>
-          </el-radio-group>
+          </el-radio-group> -->
         </div>
         <div class="right">
           <div class="seek">
@@ -88,11 +88,11 @@
           </el-table-column>
           <el-table-column prop="freq" label="频数" width="108" sortable>
           </el-table-column>
-          <el-table-column prop="" label="比例" width="110" sortable>
-            <template slot-scope="item">
+          <el-table-column prop="textRatio" label="比例" width="110" sortable>
+            <!-- <template slot-scope="item">
               <span v-if="headText == 1">{{ item.row.wordRatio }}%</span>
               <span v-else>{{ item.row.textRatio }}%</span>
-            </template>
+            </template> -->
           </el-table-column>
           <el-table-column prop="" label="备注">
             <template slot-scope="item">
@@ -103,8 +103,10 @@
                   class="beizhu"
                   style="margin-right: 10px"
                 >
-                  <span style="font-size: 18px; font-weight: 400">
-                    {{ items.word }}
+                  <span
+                    style="font-size: 18px; font-weight: 400"
+                    v-html="items.word"
+                  >
                   </span>
                   <span
                     :style="{
@@ -168,6 +170,8 @@ export default {
       searchType: null,
       levelMap: null,
       loading: false,
+      sortType: null,
+      sortField: null,
     };
   },
   //计算属性 类似于data概念
@@ -176,11 +180,6 @@ export default {
   watch: {},
   //方法集合
   methods: {
-    handleSizeChange(val) {
-      this.page = 1;
-      this.pageSize = val;
-      this.getlist();
-    },
     handleCurrentChange(val) {
       this.page = val;
       this.getlist();
@@ -195,8 +194,8 @@ export default {
           partitionKey: this.partitionKey,
           searchType: this.typeIndex,
           word: this.keyword,
-          sortField: null,
-          sortType: null,
+          sortField: this.sortField,
+          sortType: this.sortType,
         },
       })
         .then((res) => {
@@ -218,7 +217,26 @@ export default {
       this.page = 1;
       this.getlist();
     },
-    sort_change(column) {},
+    sort_change(column) {
+      console.log(column);
+      if (column.prop == "pinyin") {
+        this.sortField = "pin_yin";
+      } else if (column.prop == "gradeName") {
+        this.sortField = "grade_id";
+      } else if (column.prop == "levelName") {
+        this.sortField = "level_id";
+      } else if (column.prop == "textRatio") {
+        this.sortField = "text_ratio";
+      } else {
+        this.sortField = column.prop;
+      }
+      if (column.order == "descending") {
+        this.sortType = 1;
+      } else {
+        this.sortType = 0;
+      }
+      this.getlist();
+    },
     cutType(index) {
       this.typeIndex = index;
       this.page1getdata();

+ 1 - 0
src/views/Textanalysis/index.vue

@@ -476,6 +476,7 @@ export default {
       _this.searchVal = "";
       _this.searchWord = [];
       _this.currentcolorValue = [];
+      _this.SearchwordNumber = [];
     },
     cutHeaderText(type) {
       this.headerText = type;

+ 22 - 5
src/views/teacher-dev/TextAnalysis.vue

@@ -102,10 +102,24 @@ export default {
         });
     },
     anewSubmit(item) {
-      this.txt = item.firstSentence;
+      this.loading = true;
+
+      postapi({
+        url: "GCLSTRCServer/tools/TS/reparse",
+        data: {
+          partitionKey: item.partitionKey,
+        },
+      })
+        .then((res) => {
+          this.getlist(true);
+          // this.loading = false;
+        })
+        .catch((res) => {
+          this.loading = false;
+        });
     },
     // 分析
-    submit() {
+    submit(msg) {
       if (this.txt == "") {
         this.$message.warning("请先输入内容");
         return;
@@ -120,14 +134,14 @@ export default {
       })
         .then((res) => {
           this.txt = "";
-          this.getlist();
-          this.loading = false;
+          this.getlist(true);
+          // this.loading = false;
         })
         .catch((res) => {
           this.loading = false;
         });
     },
-    getlist() {
+    getlist(msg) {
       this.loading = true;
       postapi({
         url: "GCLSTRCServer/tools/TS/analysis/record/list",
@@ -143,6 +157,9 @@ export default {
             num++;
           });
           this.data = res.data.result;
+          if (msg) {
+            this.$message.success(res.msg);
+          }
           this.loading = false;
         })
         .catch((res) => {