luolei 4 rokov pred
rodič
commit
0bd6863e62
4 zmenil súbory, kde vykonal 83 pridanie a 7 odobranie
  1. 37 0
      src/css/participle.less
  2. 4 1
      src/html/participle.html
  3. 3 1
      src/js/api.js
  4. 39 5
      src/js/participle.js

+ 37 - 0
src/css/participle.less

@@ -407,4 +407,41 @@
 }
 #svg {
     display: none;
+}
+.showCheck {
+    display: none;
+    width: 700px;
+    // min-height: 100px;
+    border: 1px solid #ccc;
+    position: fixed;
+    top: 30%;
+    left: 50%;
+    margin-left: -350px;
+    background-color: #fff;
+    img {
+        width: 15px;
+        height: 15px;
+        position: absolute;
+        top: -7px;
+        right: -7px;
+        display: inline-block;
+        cursor: pointer;
+        background-color: #fff;
+    }
+    table {
+        width: 100%;
+        border-collapse: collapse;
+        .head {
+            background-color: #EFF0F9;
+        }
+        tr {
+
+        }
+        td {
+            border: 1px solid #ccc;
+            font-size: 14px;
+            text-align: center;
+            padding: 5px 10px;
+        }
+    }
 }

+ 4 - 1
src/html/participle.html

@@ -87,7 +87,10 @@
 		</div>
 	</div>
 	
-
+	<div class="showCheck">
+		<img src="./images/iconClose3.png" alt="">
+		<table class="table"></table>
+	</div>
 </body>
 
 </html>

+ 3 - 1
src/js/api.js

@@ -8,6 +8,7 @@ const api = {
   getMrInfo:'/api/ltkg/presetInfo/getMrInfo',
   getAnswer:'/api/ltkg/qa/charBot',
   getTerm:'/api/ltkg/term/getTerm',
+  check:'http://192.168.2.121:7010/test/testStandConvert',
 };
 
 const getUrlArgObject = function(name) {//
@@ -54,5 +55,6 @@ const post = function (url, data,pId) {
 
 module.exports ={
   post,
-  api
+  api,
+  getUrlArgObject
 }

+ 39 - 5
src/js/participle.js

@@ -2,7 +2,7 @@ const $ = require("jquery");
 require("babel-polyfill");
 require("./../css/participle.less");
 require("./../css/common.less");
-const { post, api } = require('./api.js');
+const { post, api,getUrlArgObject } = require('./api.js');
 require('./../resources/images/empty2.png');
 require('./../resources/images/iconUp.png');
 require('./../resources/images/iconDown.png');
@@ -10,6 +10,7 @@ require('./../resources/images/syflogo.png');
 require('./../resources/images/iconClose3.png');
 require('./../css/img/icon_tu.png');
 require('./../css/img/icon_wenzi.png');
+
 const {currentIIData} = require('./data.js')
 
 function appendCurrentII(currentIIList){
@@ -66,9 +67,6 @@ $(".pop-cover,.pop-close,.pop-cancel").click(()=>{
 })
 
 
-function insertStr(soure, start, newStr){   
-    return soure.slice(0, start) + newStr + soure.slice(start);
- }
  let svgData;
 function getEntityPredict(){
     $("#toggleImgs").css("display","none");
@@ -195,7 +193,11 @@ function chageRelation(data){
         "connections":data,
     }
 }
-function getSchema(content, entryList){
+
+function insertStr(soure, start, newStr){   
+    return soure.slice(0, start) + newStr + soure.slice(start);
+ }
+ function getSchema(content, entryList){
     let addNum = 0
     for(let i = 1; i < entryList.length; i++){
         content = insertStr(content, entryList[i].start+addNum, `<span class="star">* </span><span class="entryItem"><span class="type"><span class="trangle"></span>${entryList[i].name}</span>`)
@@ -211,6 +213,38 @@ function getSchema(content, entryList){
     $('#resultBoxInfo').html(content)
     $("#toggleImgs").css("display","block");
     $("#toggleImg").css("display","block");
+    $(".entryItem").click(function(){
+        let txt = ($(this).html()).replace(/<span[^>]*>(.|\n)*<\/span>/gi,"")
+        let curType = $(this).find(".type").text()
+        post(api.check, {
+            "number": getUrlArgObject("num"),
+            "word": txt,
+            "word_type": "vital"
+        }).then(res =>{
+            if(res.data.code == '0'){
+                let result = res.data.data.standard_words||[]
+                let str = '',head=`
+                <tr class="head">
+                    <td>实体名称</td>
+                    <td>类型</td>
+                    <td>标准词</td>
+                </tr>`
+                for(let i = 0;i < result.length;i++){
+                    str += `<tr>
+                    <td>${txt}</td>
+                    <td>${'vital'}</td>
+                    <td>${result[i].standard_word}</td>
+                    </tr>`
+                }
+                if(result.length>0){
+                    $(".showCheck").css("display","block").find(".table").html(head+str)
+                    $(".showCheck img").click(function(){
+                        $(this).parent().css("display","none")
+                    })
+                }
+            }
+        })
+    })
 }
 function getRelationList(relationList,entryList){