Browse Source

词云修改,

qinpeng 2 years ago
parent
commit
9865681b91
2 changed files with 40 additions and 8 deletions
  1. 39 8
      public/ciyun/ciyunindex.html
  2. 1 0
      src/views/Textanalysis/index.vue

+ 39 - 8
public/ciyun/ciyunindex.html

@@ -230,12 +230,12 @@
                             </div>
                             <div class="rule-item fl">
                                 <p class="fl">单位:</p>
-                                <input type="text" hidden="" id="danwei" value="1">
+                                <input type="text" hidden="" id="danwei" value="zi">
                                 <div class="rule-radio danwei fl">
-                                    <div name="danwei" class="radio-con radio-active fl" value='1'><i
+                                    <div name="danwei" class="radio-con radio-active fl" value='zi'><i
                                             class="radio-icon fl"></i>字
                                     </div>
-                                    <div name="danwei" class="radio-con fl" value='2'><i class="radio-icon fl"></i>词
+                                    <div name="danwei" class="radio-con fl" value='ci'><i class="radio-icon fl"></i>词
                                     </div>
                                 </div>
                             </div>
@@ -376,15 +376,23 @@
         let arr = query[1].split("&");
         var partitionKey = null;
         var searchType = null;
+        var old_searchType = null
+        var W_stopWordStatus = null
         arr.forEach((item) => {
             if (item.split("=")[0] == "partitionKey") {
                 partitionKey = item.split("=")[1];
             }
             if (item.split("=")[0] == "searchType") {
                 searchType = item.split("=")[1];
+                old_searchType = item.split("=")[1];
             }
         });
-        if (searchType == 0) {
+        // 如果是词汇  默认选中词
+        if (old_searchType == 2) {
+            $(".danwei div").removeClass("radio-active");
+            $(".danwei").find("div").eq(1).addClass("radio-active")
+        }
+        if (old_searchType == 0) {
             $("#font").attr("value", "FZPY");
             for (let i = 0; i < $("#fontSel").children().length; i++) {
                 if ($("#fontSel").children().eq(i)[0].value == "FZPY") {
@@ -403,11 +411,11 @@
                 }
             }
         }
-        function getdata(stopWordStatus) {
+        function getdata() {
             let data = {
                 searchType: searchType * 1,
                 partitionKey: partitionKey * 1,
-                stopWordStatus: stopWordStatus,
+                stopWordStatus: W_stopWordStatus,
             }
             $.ajax({
                 url: window.g.BASE_URL + "/GCLSTCServer/tools/TS/glossary/ciyun",
@@ -569,7 +577,29 @@
             $(".danwei div").removeClass("radio-active");
             $(this).addClass("radio-active");
             var value = $(this).attr("value");
-            console.log(value);
+            let newvalue = null
+            if (old_searchType == 0) {//拼音
+                if (value == 'zi') {
+                    newvalue = 0
+                } else {
+                    newvalue = 3
+
+                }
+            } else if (old_searchType == 2) {
+                if (value == 'zi') {
+                    newvalue = 1
+                } else {
+                    newvalue = 2
+                }
+            } else {
+                if (value == 'zi') {
+                    newvalue = 1
+                } else {
+                    newvalue = 4
+                }
+            }
+            searchType = newvalue
+            getdata()
         })
         $(".fontDriect div").click(function () {
             $(".fontDriect div").removeClass("radio-active");
@@ -684,7 +714,8 @@
             } else {
                 isSelectLemma = false;
             }
-            getdata(stopWordStatus)
+            W_stopWordStatus = stopWordStatus
+            getdata()
         }
         function replaceStop(words, stopWordList) {
             var text = "";

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

@@ -1167,6 +1167,7 @@ export default {
           partitionKey: this.partitionKey,
           statisticsType: this.xifen ? 0 : 1,
           base: base ? base : null,
+          textType: this.headerText == "wordCount" ? 0 : 1,
         },
       })
         .then((res) => {