natasha 1 سال پیش
والد
کامیت
f8ebd9862f
1فایلهای تغییر یافته به همراه171 افزوده شده و 176 حذف شده
  1. 171 176
      public/ciyun/ciyunindex.html

+ 171 - 176
public/ciyun/ciyunindex.html

@@ -20,7 +20,7 @@
             text-decoration: underline;
             color: #FF0000;
         }
-
+        
         .shadow {
             position: absolute;
             width: 100%;
@@ -29,7 +29,7 @@
             top: 0;
             background: rgba(0, 0, 0, 0.3);
         }
-
+        
         .stop_word_table {
             width: 413px;
             position: fixed;
@@ -39,7 +39,7 @@
             border: 1px solid rgba(0, 0, 0, 0.1);
             padding: 24px;
         }
-
+        
         .stop_word_table .title {
             display: flex;
             justify-content: space-between;
@@ -49,28 +49,27 @@
             color: #000000;
             padding-bottom: 16px;
             border-bottom: 1px solid rgba(0, 0, 0, 0.06);
-
         }
-
+        
         .stop_word_table .title img {
             width: 24px;
             height: 24px;
             cursor: pointer;
         }
-
+        
         .stop_word_table .top {
             display: flex;
             align-items: center;
             margin-top: 16px;
         }
-
+        
         .stop_word_table .top input {
             width: 278px;
             height: 40px;
             border: 1px solid #000000;
             outline: none;
         }
-
+        
         .stop_word_table .top button {
             width: 87px;
             height: 40px;
@@ -83,14 +82,14 @@
             cursor: pointer;
             border: none;
         }
-
+        
         .stop_word_table .main {
             margin-top: 16px;
             max-height: 340px;
             overflow: hidden;
             overflow-y: scroll;
         }
-
+        
         .stop_word_table .one {
             display: flex;
             justify-content: space-between;
@@ -100,25 +99,25 @@
             line-height: 34px;
             padding: 0 8px;
         }
-
+        
         .stop_word_table .right span {
             cursor: pointer;
         }
-
+        
         .stop_word_table .main> :nth-child(2n) {
             background: #ffffff;
         }
-
+        
         .stop_word_table .main> :nth-child(2n-1) {
             background: #f8f8f8;
         }
-
+        
         .stop_word_table .bottom {
             display: flex;
             justify-content: space-between;
             margin-top: 16px;
         }
-
+        
         .stop_word_table .bottom button {
             width: 173.5px;
             height: 48px;
@@ -127,12 +126,12 @@
             border: none;
             cursor: pointer;
         }
-
+        
         .stop_word_table .bottom .close {
             background: #ebebeb;
             color: #000000;
         }
-
+        
         .stop_word_table .bottom .add {
             background: #000000;
             color: #ffffff;
@@ -186,11 +185,9 @@
                                 <p class="fl">样式:</p>
                                 <input type="text" hidden="" id="spiral" value="archimedean">
                                 <div class="rule-radio styleType fl">
-                                    <div name="radio" class="radio-con radio-active fl" value='archimedean'><i
-                                            class="radio-icon fl"></i>螺线
+                                    <div name="radio" class="radio-con radio-active fl" value='archimedean'><i class="radio-icon fl"></i>螺线
                                     </div>
-                                    <div name="radio" class="radio-con fl" value='rectangular'><i
-                                            class="radio-icon fl"></i>矩形</div>
+                                    <div name="radio" class="radio-con fl" value='rectangular'><i class="radio-icon fl"></i>矩形</div>
                                 </div>
                             </div>
                             <div class="rule-item fl">
@@ -220,21 +217,17 @@
                                 <p class="fl">文字方向:</p>
                                 <input type="text" hidden="" id="fontdir" value="1">
                                 <div class="rule-radio fontDriect fl">
-                                    <div name="orientations" class="radio-con radio-active fl" value='1'><i
-                                            class="radio-icon fl"></i>水平
+                                    <div name="orientations" class="radio-con radio-active fl" value='1'><i class="radio-icon fl"></i>水平
                                     </div>
-                                    <div name="orientations" class="radio-con fl" value='2'><i
-                                            class="radio-icon fl"></i>垂直</div>
-                                    <div name="orientations" class="radio-con fl" value='3'><i
-                                            class="radio-icon fl"></i>垂直和水平</div>
+                                    <div name="orientations" class="radio-con fl" value='2'><i class="radio-icon fl"></i>垂直</div>
+                                    <div name="orientations" class="radio-con fl" value='3'><i class="radio-icon fl"></i>垂直和水平</div>
                                 </div>
                             </div>
                             <div class="rule-item fl">
                                 <p class="fl">单位:</p>
                                 <input type="text" hidden="" id="danwei" value="zi">
                                 <div class="rule-radio danwei fl">
-                                    <div name="danwei" class="radio-con radio-active fl" value='zi'><i
-                                            class="radio-icon fl"></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='ci'><i class="radio-icon fl"></i>词
                                     </div>
@@ -270,10 +263,9 @@
                                 <p class="fl">缩放:</p>
                                 <input type="text" hidden="" id="scale" value="sqrt">
                                 <div class="rule-radio scaleSel  fl">
-                                    <div name="radio" class="radio-con fl" value="log"><i class="radio-icon fl"></i>log
-                                        n</div>
-                                    <div name="radio" class="radio-con radio-active fl" value="sqrt"><i
-                                            class="radio-icon fl"></i>✓n</div>
+                                    <div name="radio" class="radio-con fl" value="log"><i class="radio-icon fl"></i>log n
+                                    </div>
+                                    <div name="radio" class="radio-con radio-active fl" value="sqrt"><i class="radio-icon fl"></i>✓n</div>
                                     <div name="radio" class="radio-con fl" value="linear"><i class="radio-icon fl"></i>n
                                     </div>
                                 </div>
@@ -289,10 +281,8 @@
                             <div class="rule-item fl">
                                 <!-- <div class="checkbox-con checkbox-active fl hide"><i class="checkbox-icon fl"></i>区分大小写 -->
                                 <!-- </div> -->
-                                <div class="checkbox-con fl stop" style="margin-right: 0px;"><i
-                                        class="checkbox-icon fl"></i></div>
-                                <div class="checkbox-con fl stopWordList"><span id="stop"
-                                        style="color: #0079FF;">停用词表</span></div>
+                                <div class="checkbox-con fl stop" style="margin-right: 0px;"><i class="checkbox-icon fl"></i></div>
+                                <div class="checkbox-con fl stopWordList"><span id="stop" style="color: #0079FF;">停用词表</span></div>
                             </div>
                         </div>
                         <textarea rows="" cols="" id="text" name="text" hidden=""></textarea>
@@ -315,8 +305,7 @@
                 </div>
                 <p style="text-align: right; margin-top: 16px; font-size: 16px; color: #000000">
-                    <span id="allwordnumber"></span>
-                    词
+                    <span id="allwordnumber"></span> 词
                 </p>
 
                 <div class="main" id="stop_word_table">
@@ -366,10 +355,9 @@
     <script src="./js/d3.min.js"></script>
     <script src="./js/cloud.min.js"></script>
     <script type="text/javascript">
-
         var stopWordList = null;
         var oldstopWordList = [];
-        $(function () {
+        $(function() {
             initStopWords();
             jiekouData();
         })
@@ -424,13 +412,13 @@
                 stopWordStatus: W_stopWordStatus,
             }
             $.ajax({
-                url: window.g.BASE_URL + "/GCLSTCServer/tools/TS/glossary/ciyun",
+                url: window.location.origin + "/GCLSTCServer/tools/TS/glossary/ciyun",
                 // url: "/i21st-newspaper-management-test/api/article/detail/wordCloud",
                 data: JSON.stringify(data),
                 contentType: "application/json",
                 dataType: "json",
                 type: "post",
-                success: function (res) {
+                success: function(res) {
                     let str = ''
                     res.data.result.forEach(item => {
                         if (item.word.indexOf(" ") != -1) {
@@ -511,10 +499,10 @@
                 // }
                 let str = ''
                 data.arr.forEach(item => {
-                    str += item + " "
-                })
-                // text = replaceStop(words, stopWordLists);
-                // }
+                        str += item + " "
+                    })
+                    // text = replaceStop(words, stopWordLists);
+                    // }
                 text = str
                 $("#text").val(text);
                 $("#go").trigger("click");
@@ -537,13 +525,13 @@
 
         function initStopWords() {
             $.ajax({
-                url: window.g.BASE_URL + "/GCLSTCServer/tools/TS/stop/word/list",
+                url: window.location.origin + "/GCLSTCServer/tools/TS/stop/word/list",
                 // url: "/i21st-newspaper-management-test/api/user/stopVocab/get",
                 data: JSON.stringify({}),
                 contentType: "application/json;charset=UTF-8",
                 dataType: "json",
                 type: "post",
-                success: function (res) {
+                success: function(res) {
                     let arr = []
                     res.data.result.forEach(item => {
                         arr.push(item.word)
@@ -552,10 +540,11 @@
                     stopWordList = JSON.parse(JSON.stringify(arr))
                     $("#allwordnumber").text(oldstopWordList.length)
                     changeWordData()
-                }, error: function (jqXHR, textStatus, errorThrown) {
+                },
+                error: function(jqXHR, textStatus, errorThrown) {
                     if (jqXHR.status == 401) {
                         var url = jqXHR.responseText;
-                        layer.alert('会话已过期,请重新登陆。', function (index) {
+                        layer.alert('会话已过期,请重新登陆。', function(index) {
                             layer.close(index);
                             location.reload();
                         });
@@ -567,26 +556,26 @@
         }
 
 
-        $(".rule div").click(function () {
+        $(".rule div").click(function() {
             $(".rule div").removeClass("radio-active");
             $(this).addClass("radio-active");
             $("#rule").attr("value", $(this).attr("value"))
             initContent();
         })
 
-        $(".styleType div").click(function () {
-            $(".styleType div").removeClass("radio-active");
-            $(this).addClass("radio-active");
-            $("#spiral").attr("value", $(this).attr("value"));
-            $("#go").trigger("click");
-        })
-        // 切换单位
-        $(".danwei div").click(function () {
+        $(".styleType div").click(function() {
+                $(".styleType div").removeClass("radio-active");
+                $(this).addClass("radio-active");
+                $("#spiral").attr("value", $(this).attr("value"));
+                $("#go").trigger("click");
+            })
+            // 切换单位
+        $(".danwei div").click(function() {
             $(".danwei div").removeClass("radio-active");
             $(this).addClass("radio-active");
             var value = $(this).attr("value");
             let newvalue = null
-            if (old_searchType == 0) {//拼音
+            if (old_searchType == 0) { //拼音
                 if (value == 'zi') {
                     newvalue = 0
                 } else {
@@ -609,7 +598,7 @@
             searchType = newvalue
             getdata()
         })
-        $(".fontDriect div").click(function () {
+        $(".fontDriect div").click(function() {
             $(".fontDriect div").removeClass("radio-active");
             $(this).addClass("radio-active");
             var value = $(this).attr("value");
@@ -638,7 +627,7 @@
         })
 
 
-        $(".scaleSel div").click(function () {
+        $(".scaleSel div").click(function() {
 
             $(".scaleSel div").removeClass("radio-active");
             $(this).addClass("radio-active");
@@ -649,13 +638,13 @@
 
 
 
-        $("#fontSel").change(function () {
+        $("#fontSel").change(function() {
             var value = $(this).children('option:selected').val();
             $("#font").attr("value", value);
             $("#go").trigger("click");
         })
 
-        $("#download-png").click(function () {
+        $("#download-png").click(function() {
             var el = d3.select("#cloudDiv").node().children[0];
             saveSvgAsPng(el, "词云.png");
         })
@@ -672,14 +661,14 @@
         //     });
         //     initStopWords();
         // })
-        $("#dataTypeSel").change(function () {
+        $("#dataTypeSel").change(function() {
             var selvalue = $(this).children('option:selected').val();
             // var ruleVlue = $("#rule").attr("value");
             // $("#dataType").attr("value", selvalue);
             // initContent();
             jiekouData()
         });
-        $(".stop").click(function () {
+        $(".stop").click(function() {
             var $stop = $(".stop");
             if ($stop.hasClass("checkbox-active")) {
                 $stop.removeClass("checkbox-active");
@@ -689,7 +678,7 @@
             jiekouData()
 
         })
-        $(".biglittle").click(function () {
+        $(".biglittle").click(function() {
             var $stop = $(".biglittle");
             if ($stop.hasClass("checkbox-active")) {
                 $stop.removeClass("checkbox-active");
@@ -698,6 +687,7 @@
             }
             jiekouData()
         })
+
         function jiekouData() {
             var $biglittle = $(".biglittle");
             var $stop = $(".stop");
@@ -706,14 +696,12 @@
             let stopWordStatus = false
             if ($biglittle.hasClass("checkbox-active")) {
                 isSelectCaseSensitive = true
-            }
-            else {
+            } else {
                 isSelectCaseSensitive = false
             }
             if ($stop.hasClass("checkbox-active")) {
                 stopWordStatus = 1
-            }
-            else {
+            } else {
                 stopWordStatus = 0
             }
             var selvalue = $("#dataTypeSel").children('option:selected').val();
@@ -725,6 +713,7 @@
             W_stopWordStatus = stopWordStatus
             getdata()
         }
+
         function replaceStop(words, stopWordList) {
             var text = "";
             var wordListLow = new Array();
@@ -772,12 +761,13 @@
             return text;
         }
         // 停用词表
-        $("#stop").click(function () {
-            $("#shadow").show()
-            changeWordData()
-        })
-        // 处理词表数据
+        $("#stop").click(function() {
+                $("#shadow").show()
+                changeWordData()
+            })
+            // 处理词表数据
         var editOldVal = ""
+
         function changeWordData(msg, arr) {
             if (arr) {
                 stopWordList = JSON.parse(JSON.stringify(arr));
@@ -794,13 +784,13 @@
                         </div>
                     </div>`
                 $("#stop_word_table").append(node)
-                $(`#edit${i}`).click(function () {
+                $(`#edit${i}`).click(function() {
                     $("#editwordDom").show()
                     $("#wordTable").hide()
                     $("#editwordContent").val(stopWordList[i])
                     editOldVal = stopWordList[i]
                 })
-                $(`#delete${i}`).click(function () {
+                $(`#delete${i}`).click(function() {
                     oldstopWordList.forEach((item, i) => {
                         if (stopWordList[i] == item) {
                             oldstopWordList.splice(i, 1)
@@ -813,16 +803,20 @@
                 layer.msg("成功")
             }
         }
+
         function updatawordData() {
             let userStopVocab = JSON.parse(JSON.stringify(oldstopWordList));
             $.ajax({
-                url: window.g.BASE_URL + "/GCLSTCServer/tools/TS/stop/word/save",
+                url: window.location.origin + "/GCLSTCServer/tools/TS/stop/word/save",
                 // url: "/i21st-newspaper-management-test/api/user/stopVocab/update",
-                data: JSON.stringify({ tenantId: "", wordList: userStopVocab }),
+                data: JSON.stringify({
+                    tenantId: "",
+                    wordList: userStopVocab
+                }),
                 contentType: "application/json;charset=UTF-8",
                 dataType: "json",
                 type: "post",
-                success: function (data) {
+                success: function(data) {
                     let val = $("#wordContent").val()
                     if (val != "") {
                         $("#seekWordBtn").click()
@@ -830,10 +824,11 @@
                         changeWordData("msg")
 
                     }
-                }, error: function (jqXHR, textStatus, errorThrown) {
+                },
+                error: function(jqXHR, textStatus, errorThrown) {
                     if (jqXHR.status == 401) {
                         var url = jqXHR.responseText;
-                        layer.alert('会话已过期,请重新登陆。', function (index) {
+                        layer.alert('会话已过期,请重新登陆。', function(index) {
                             layer.close(index);
                             location.reload();
                         });
@@ -844,110 +839,110 @@
             })
         }
         // 搜索 
-        $("#seekWordBtn").click(function () {
-            let val = $("#wordContent").val()
-            let arr = []
-            if (val == "") {
-                stopWordList = JSON.parse(JSON.stringify(oldstopWordList))
-                changeWordData("msg")
+        $("#seekWordBtn").click(function() {
+                let val = $("#wordContent").val()
+                let arr = []
+                if (val == "") {
+                    stopWordList = JSON.parse(JSON.stringify(oldstopWordList))
+                    changeWordData("msg")
 
-            } else {
-                oldstopWordList.forEach((item, i) => {
-                    if (item.indexOf(val) != -1) {
-                        arr.push(item);
-                    }
-                })
-                // stopWordList = JSON.parse(JSON.stringify(arr))
-                changeWordData("msg", arr)
-            }
-        })
-        // 清空
-        $("#emptyWord").click(function () {
-            oldstopWordList = []
-            updatawordData()
-        })
-        // 关闭
-        $("#closeWord").click(function () {
-            $("#shadow").hide()
-            getdata()
-        })
-        // 新增 addWord
-        $("#addWord").click(function () {
-            $("#addwordDom").show()
-            $("#wordTable").hide()
-            $("#addwordContent").val("")
-        })
-        // 确定新增 addSubmit
-        $("#addSubmit").click(function () {
-            let val = $("#addwordContent").val()
-            if (val == '') {
-                layer.msg("请输入内容")
-                return
-            } else {
-                let flag = false;
-                oldstopWordList.forEach(item => {
-                    if (item == val) {
-                        flag = true
-                    }
-                })
-                if (flag) {
-                    layer.msg("该词已经存在,请勿重复添加")
-                    return
+                } else {
+                    oldstopWordList.forEach((item, i) => {
+                            if (item.indexOf(val) != -1) {
+                                arr.push(item);
+                            }
+                        })
+                        // stopWordList = JSON.parse(JSON.stringify(arr))
+                    changeWordData("msg", arr)
                 }
-                oldstopWordList.unshift(val)
-                stopWordList.unshift(val)
-                $("#wordTable").show()
-                $("#addwordDom").hide()
+            })
+            // 清空
+        $("#emptyWord").click(function() {
+                oldstopWordList = []
                 updatawordData()
-            }
-        })
-        // 确定修改
-        $('#editSubmit').click(function () {
-            let val = $("#editwordContent").val()
-            if (val == '') {
-                layer.msg("请输入内容")
-                return
-            } else {
-                let flag = false;
-                oldstopWordList.forEach(item => {
-                    if (item == val) {
-                        flag = true
-                    }
-                })
-                if (flag) {
-                    layer.msg("该词已经存在,请勿重复添加")
+            })
+            // 关闭
+        $("#closeWord").click(function() {
+                $("#shadow").hide()
+                getdata()
+            })
+            // 新增 addWord
+        $("#addWord").click(function() {
+                $("#addwordDom").show()
+                $("#wordTable").hide()
+                $("#addwordContent").val("")
+            })
+            // 确定新增 addSubmit
+        $("#addSubmit").click(function() {
+                let val = $("#addwordContent").val()
+                if (val == '') {
+                    layer.msg("请输入内容")
                     return
+                } else {
+                    let flag = false;
+                    oldstopWordList.forEach(item => {
+                        if (item == val) {
+                            flag = true
+                        }
+                    })
+                    if (flag) {
+                        layer.msg("该词已经存在,请勿重复添加")
+                        return
+                    }
+                    oldstopWordList.unshift(val)
+                    stopWordList.unshift(val)
+                    $("#wordTable").show()
+                    $("#addwordDom").hide()
+                    updatawordData()
                 }
-                let arr = JSON.parse(JSON.stringify(oldstopWordList))
-                let index = null
-                arr.forEach((item, i) => {
-                    if (item == editOldVal) {
-                        index = i
+            })
+            // 确定修改
+        $('#editSubmit').click(function() {
+                let val = $("#editwordContent").val()
+                if (val == '') {
+                    layer.msg("请输入内容")
+                    return
+                } else {
+                    let flag = false;
+                    oldstopWordList.forEach(item => {
+                        if (item == val) {
+                            flag = true
+                        }
+                    })
+                    if (flag) {
+                        layer.msg("该词已经存在,请勿重复添加")
+                        return
                     }
-                })
-                arr[index] = val
-                oldstopWordList = JSON.parse(JSON.stringify(arr))
-                stopWordList = JSON.parse(JSON.stringify(arr))
-                $("#wordTable").show()
-                $("#editwordDom").hide()
-                updatawordData()
-            }
-        })
-        // 关闭新增词
-        $("#closeWordadd").click(function () {
-            $("#wordTable").show()
-            $("#addwordDom").hide()
-        })
-        $("#canceladd").click(function () {
+                    let arr = JSON.parse(JSON.stringify(oldstopWordList))
+                    let index = null
+                    arr.forEach((item, i) => {
+                        if (item == editOldVal) {
+                            index = i
+                        }
+                    })
+                    arr[index] = val
+                    oldstopWordList = JSON.parse(JSON.stringify(arr))
+                    stopWordList = JSON.parse(JSON.stringify(arr))
+                    $("#wordTable").show()
+                    $("#editwordDom").hide()
+                    updatawordData()
+                }
+            })
+            // 关闭新增词
+        $("#closeWordadd").click(function() {
             $("#wordTable").show()
             $("#addwordDom").hide()
         })
-        // 关闭编辑
-        $("#closeWordedit").click(function () {
+        $("#canceladd").click(function() {
+                $("#wordTable").show()
+                $("#addwordDom").hide()
+            })
+            // 关闭编辑
+        $("#closeWordedit").click(function() {
             $("#wordTable").show()
             $("#editwordDom").hide()
         })
-        $("#canceledit").click(function () {
+        $("#canceledit").click(function() {
             $("#wordTable").show()
             $("#editwordDom").hide()
         })