Browse Source

修改样式

zhangxc 5 years ago
parent
commit
509b18b7ad
4 changed files with 14 additions and 8 deletions
  1. 5 0
      src/css/common.css
  2. 1 1
      src/css/knowledgeMap.less
  3. 6 5
      src/js/graphMap.js
  4. 2 2
      src/js/index.js

+ 5 - 0
src/css/common.css

@@ -18,4 +18,9 @@ ul,li{
     overflow: hidden;
     width: 0;
     content: '';
+}
+.ellipsis{
+    overflow: hidden;
+    text-overflow:ellipsis;
+    white-space: nowrap;
 }

+ 1 - 1
src/css/knowledgeMap.less

@@ -129,7 +129,7 @@
                         color: #333;
                     }
                     li:hover{
-                        background: #abcdef;
+                        background: #E2ECFF;
                     }
                 }
             }

+ 6 - 5
src/js/graphMap.js

@@ -69,6 +69,7 @@ function getGraph(val, type){
         "labelName": type
     }).then(res=>{
         if(res.data.code == 0) {
+            select_type = select_type_noSearch
             $('#searchInp').val(val)
             drawGraph(res.data.data)
         }
@@ -81,7 +82,7 @@ function drawGraph(data,resultShowId) {
     var legends = categories.slice(2, categories.length);
     
     var option = {
-        title: { text: '关系图谱' },
+        title: { text: '医学知识图谱' },
         // color:colors,
         tooltip: {
             formatter: function (x) {
@@ -504,7 +505,7 @@ function drawTree(data, showNodeName){
                     const treeNodeName = treeNode.name
                     let index = treeNodeName.indexOf(' ')
                     const name = treeNodeName.substring(index+1)
-                    getGraph(name,'diagnose')
+                    getGraph(name,select_type)
                     const selectPId = $('.curSelectedNode').attr('id')
                     const selectId = selectPId.substring(0,selectPId.length-1) + 'ico'
                     $('#'+selectId + ' .iconSelect').remove()
@@ -535,10 +536,10 @@ function getNode(val, type){
             let nodeStr =''
             if(data.length > 0){
                 for(let i = 0; i < data.length; i++){
-                    nodeStr +=`<li>${data[i].name}</li>`
+                    nodeStr +=`<li class="ellipsis" title=${data[i].name}>${data[i].name}</li>`
                 }
             }else{
-                nodeStr = '<li>暂无符合数据</li>'
+                nodeStr = '<li class="ellipsis">暂无符合数据</li>'
             }
             $(".tabNameList").html(nodeStr)
             $(".tabNameList").show()
@@ -546,7 +547,7 @@ function getNode(val, type){
                 const txt = $(this).text()
                 $(".tabNameList").hide()
 
-                getGraph(txt,'diagnose')
+                getGraph(txt,select_type)
                 updateTree(txt)
             })
         }

+ 2 - 2
src/js/index.js

@@ -22,8 +22,8 @@ const { mapData, zTreeData,mapData3,zTreeData3 } = require('./data.js');
 const { drawGraph,updateTree,getGraph,getTree,getNode } = require('./graphMap.js');
 
 
-var select_type="diagnose";
-var select_type_noSearch="diagnose";
+window.select_type="diagnose";
+window.select_type_noSearch="diagnose";
  const clientHei = $(window).height()
  const contentHei = clientHei - 60
  $(".left").css("height",contentHei+'px')