Browse Source

修改提示(3348,3350,3356)

zhangxc 5 years ago
parent
commit
dcfeea5a12
4 changed files with 18 additions and 6 deletions
  1. 7 3
      src/css/knowledgeMap.less
  2. 1 0
      src/html/knowledgeGraph.html
  3. 1 1
      src/js/graphMap.js
  4. 9 2
      src/js/index.js

+ 7 - 3
src/css/knowledgeMap.less

@@ -26,7 +26,7 @@
         width: 1200px;
         left: 50%;
         margin-left: -600px;
-        cursor: pointer;
+        cursor: default;
         height: 100%;
     }
     .left{
@@ -116,7 +116,8 @@
                     color: #ccc;
                 }
                 .searchBtn{
-                    position: absolute;;
+                    position: absolute;
+                    cursor: pointer;
                     display: inline-block;
                     width:60px;
                     height:40px;
@@ -126,7 +127,7 @@
                     border-radius:0px 4px 4px 0px;
                     color: #fff;
                 }
-                .tabNameList{
+                .tabNameList,.tabNameListNoSearch{
                     position: relative;
                     top: 5px;
                     display: none;
@@ -147,6 +148,9 @@
                     li:hover{
                         background: #E2ECFF;
                     }
+                    .nodeItem{
+                        cursor: pointer;
+                    }
                 }
             }
         }

+ 1 - 0
src/html/knowledgeGraph.html

@@ -33,6 +33,7 @@
             <div class="search">
                 <input type="text" id="searchInp" placeholder="搜索疾病名称" name="" autocomplete="off" ><span class="searchBtn" id="searchBtn">搜索</span>
                 <ul class="tabNameList"></ul>
+                <ul class="tabNameListNoSearch"><li class="ellipsis">请输入内容</li></ul>
             </div>
           </div>
           <div class="bottom">

+ 1 - 1
src/js/graphMap.js

@@ -258,7 +258,7 @@ function getNode(val, type){
             let nodeStr =''
             if(data.length > 0){
                 for(let i = 0; i < data.length; i++){
-                    nodeStr +=`<li class="ellipsis" title=${data[i].name}>${data[i].name}</li>`
+                    nodeStr +=`<li class="ellipsis nodeItem" title=${data[i].name}>${data[i].name}</li>`
                 }
             }else{
                 nodeStr = '<li class="ellipsis">暂无符合数据</li>'

+ 9 - 2
src/js/index.js

@@ -66,11 +66,14 @@ $("#searchInp").bind("input propertychange",function(event){
 
 
 //搜索
-$('#searchBtn').click(function(){
+$('#searchBtn').click(function(e){
+    e.stopPropagation()
     const val = $('#searchInp').val()
     if(val){
         getGraph(val,'diagnose')
         updateTree(val)
+    }else{
+       $('.tabNameListNoSearch').show()
     }
 })
 
@@ -93,7 +96,8 @@ $('.tabList .tab').click(function(){
 $('html').click(function(){
     const selectListShow = $('.selectList').css('display')
     const tabNameListShow = $('.tabNameList').css('display')
-   
+    const tabNameListNoSearchShow = $('.tabNameListNoSearch').css('display')
+
     if(selectListShow == 'block'){
         $('.selectList').hide()
         $('.iconSlide').attr('src','./images/iconSlideDown.png')
@@ -101,6 +105,9 @@ $('html').click(function(){
     if(tabNameListShow == 'block'){
         $('.tabNameList').hide()
     }
+    if(tabNameListNoSearchShow == 'block'){
+        $('.tabNameListNoSearch').hide()
+    }
 })