Parcourir la source

修改关系列表显示

zhangxc il y a 5 ans
Parent
commit
354f75d6fd
2 fichiers modifiés avec 9 ajouts et 3 suppressions
  1. 1 1
      src/css/participle.less
  2. 8 2
      src/js/participle.js

+ 1 - 1
src/css/participle.less

@@ -205,7 +205,6 @@
                 }
                 
                 background: #EFF0F9;
-                position: sticky;
                 top: 0;
                 width: 1160px;
                 display:table;
@@ -229,6 +228,7 @@
         tr,td{
             border: 1px solid #E6E8F0;
             line-height: 36px;
+            height: 37px;
         }
         .tableTitle{
             width: 100%;

+ 8 - 2
src/js/participle.js

@@ -97,6 +97,7 @@ function getEntityPredict(){
             let content = result.content
             if((JSON.stringify(entryList)!='[""]')&&(JSON.stringify(relationList)!='[""]')){
                 // getRelationList(relationList,entryList)
+                const relationListCopy = JSON.parse(JSON.stringify(relationList))
                 let enter = chageEnter(entryList)
                 let rela = chageRelation(relationList)
                 svgData = Object.assign(enter,rela,{"content":content})
@@ -104,7 +105,7 @@ function getEntityPredict(){
                     showSvg(svgData)
                 }
                 getSchema(content,entryList)
-                getRelationList(relationList,entryList)
+                getRelationList(relationListCopy,entryList)
                 $('#analy').removeClass('disabled')
             }else{
                 // $('#analy').addClass('disabled')
@@ -196,6 +197,7 @@ function getSchema(content, entryList){
     $('#resultBoxInfo').html(content)
 }
 function getRelationList(relationList,entryList){
+   
     let str = ''
     for(let i = 1; i < relationList.length; i++){
         const relationItem = relationList[i]
@@ -212,7 +214,11 @@ function getRelationList(relationList,entryList){
         $('.empty').css("display","none");
         $('.analying').css("display","none")
         $('table').css("display","table")
-        $('.tableTitle').css("display","table")
+        $('.tableTitle').css("display","block")
+    }else{
+        $('.tableTitle').css("display","none")
+        $('.tableBox .empty').css("display","block");
+        $('.analying').css("display","none")
     }
     $('.relationBody').html(str)
 }