zhangxc преди 5 години
родител
ревизия
adecb1f361
променени са 4 файла, в които са добавени 49 реда и са изтрити 44 реда
  1. 42 33
      src/js/graphMap.js
  2. 4 8
      src/js/index.js
  3. 2 2
      src/js/knowledgeTree.js
  4. 1 1
      src/js/schemaMap.js

+ 42 - 33
src/js/graphMap.js

@@ -168,15 +168,12 @@ function dataClick(param){
                 }
                 if(data.type == "疾病"){
                     $(".radioList").show()
-                    $(".ztree").css("height",contentHei-80-43-60-20+'px')
                     $('.iconRadio').attr('src','/images/radioUnSelect.png')
                     $('.ICD10 img').attr('src','/images/radioSelect.png')
+                    setTabBottomHei(1)
                 }else{
                     $(".radioList").hide()
-                    $(".ztree").css("height",contentHei-80-43-20-20+'px')
-                    $(".ztree").css({
-                        margin: '20 0 0 0px'
-                    })
+                    setTabBottomHei(2)
                 }
                 select_type_noSearch = data.type
                 select_type = data.type
@@ -353,15 +350,12 @@ function getNode(val, type){
                     }
                     if(select_type == '疾病'){
                         $(".radioList").show()
-                        $(".ztree").css("height",contentHei-80-43-60-20+'px')
                         $('.iconRadio').attr('src','/images/radioUnSelect.png')
                         $('.ICD10 img').attr('src','/images/radioSelect.png')
+                        setTabBottomHei(1)
                     }else{
                         $(".radioList").hide()
-                        $(".ztree").css("height",contentHei-80-43-20-20+'px')
-                        $(".ztree").css({
-                            margin: '20 0 0 0px'
-                        })
+                        setTabBottomHei(2)
                     }
                 }else{
                     updateTree(txt)
@@ -434,7 +428,7 @@ function getKeyEvent(evt) {
 
 function getTab(tabName){
     console.log('tabName', tabName)
-    let tabList = ["疾病","药品通用名","症状","手术和操作","实验室检查","辅助检查","辅助检查1","辅助检查2","辅助检查3","辅助检查4"]
+    let tabList = ["疾病","药品通用名","症状","手术和操作","实验室检查","辅助检查"]
     let tabListCopy = tabList.slice()
     const index = tabList.findIndex(item => item == tabName)
   
@@ -515,13 +509,10 @@ function bindTabClick(){
         if(id != select_type){
             if(id != "疾病"){
                 $(".radioList").hide()
-                $(".ztree").css("height",contentHei-80-43-20-20+'px')
-                $(".ztree").css({
-                    margin: '20 0 0 0px'
-                })
+                setTabBottomHei(2)
             }else{
-                $(".ztree").css("height",contentHei-80-43-60-20+'px')
                 $(".radioList").show()
+                setTabBottomHei(1)
             }
             select_type_noSearch = id
             select_type = id
@@ -546,26 +537,25 @@ function bindTabClick(){
                 getGraph("高血压3级",select_type);
             
             }else if(id=="药品通用名"){
-                $('#searchInp').val("氟康唑注射液")
-                getTree(0,2,"氟康唑注射液");
-                getGraph("氟康唑注射液",select_type);
-              
+                $('#searchInp').val("地高辛(XC01AAD072A001010100372)")
+                getTree(0,2,"地高辛(XC01AAD072A001010100372)");
+                getGraph("地高辛(XC01AAD072A001010100372)",select_type);
             }else if(id == "症状"){
-                $('#searchInp').val("")
-                getTree(0,3,"");
-                getGraph("",select_type);
+                $('#searchInp').val("背痛")
+                getTree(0,3,"背痛");
+                getGraph("背痛",select_type);
             }else if(id == "手术和操作"){
-                $('#searchInp').val("")
-                getTree(0,4,"");
-                getGraph("",select_type);
+                $('#searchInp').val("动脉缝合术")
+                getTree(0,4,"动脉缝合术");
+                getGraph("动脉缝合术",select_type);
             }else if(id == "实验室检查"){
-                $('#searchInp').val("")
-                getTree(0,5,"");
-                getGraph("",select_type);
+                $('#searchInp').val("白细胞计数(WBC)")
+                getTree(0,5,"白细胞计数(WBC)");
+                getGraph("白细胞计数(WBC)",select_type);
             }else if(id == "辅助检查"){
-                $('#searchInp').val("")
-                getTree(0,6,"");
-                getGraph("",select_type);
+                $('#searchInp').val("肝彩超")
+                getTree(0,6,"肝彩超");
+                getGraph("肝彩超",select_type);
             }
            
             // getTree(1,1,"");  //切换tab重新画菜单树
@@ -575,6 +565,24 @@ function bindTabClick(){
     })
 }
 
+function setTabBottomHei(type){
+    const clientHei = $(window).height()
+    const contentHei = clientHei - 80
+    if(type==1){
+        $(".tabBottom").css({
+            'margin': '0px 0px 0px 0px'
+        })
+        $(".tabBottom").css("height",contentHei-80-43-10+'px')
+        $(".ztree").css("height",contentHei-80-43-60-20+'px')
+
+    }else if(type == 2){
+        $(".tabBottom").css("height",contentHei-80-43-10-20+'px')
+        $(".tabBottom").css({
+            'margin': '20px 0px 0px 0px'
+        })
+        $(".ztree").css("height",contentHei-80-43-20-20-20+'px')
+    }
+ }
 
 module.exports ={
     drawGraph,
@@ -583,5 +591,6 @@ module.exports ={
     getTree,
     getNode,
     getTab,
-    renderTab
+    renderTab,
+    setTabBottomHei
 }

+ 4 - 8
src/js/index.js

@@ -23,7 +23,7 @@ const iconUp = require('./../resources/images/iconUp.png');
 const iconDown = require('./../resources/images/iconDown.png');
 const { post, api } = require('./api.js');
 const { mapData, zTreeData,mapData3,zTreeData3 } = require('./data.js');
-const { drawGraph,updateTree,getGraph,getTree,getNode,getTab,renderTab} = require('./graphMap.js');
+const { drawGraph,updateTree,getGraph,getTree,getNode,getTab,renderTab,setTabBottomHei} = require('./graphMap.js');
 
 window.select_type="疾病";
 window.select_type_noSearch="疾病";
@@ -35,8 +35,7 @@ window.refreshTree = true
     const contentHei = clientHei - 80
     $(".left").css("height",contentHei+'px')
     $(".right").css("height",contentHei+'px')
-    $(".tabBottom").css("height",contentHei-80-43-10+'px')
-    $(".ztree").css("height",contentHei-80-43-60-20+'px')
+    setTabBottomHei(1)
     $("#main").css("height",contentHei-20-20+'px')
  }
  $(window).resize(function(){
@@ -136,13 +135,10 @@ $('#searchBtn').click(function(e){
                     $('.iconRadio').attr('src','/images/radioUnSelect.png')
                     $('.ICD10 img').attr('src','/images/radioSelect.png')
                     $(".radioList").show()
-                    $(".ztree").css("height",contentHei-80-43-60-20+'px')
+                    setTabBottomHei(1)
                 }else{
                     $(".radioList").hide()
-                    $(".ztree").css("height",contentHei-80-43-20-20+'px')
-                    $(".ztree").css({
-                        margin: '20 0 0 0px'
-                    })
+                    setTabBottomHei(2)
                 }
                 let renderTabInfo = getTab("疾病") 
                 renderTab(renderTabInfo)

+ 2 - 2
src/js/knowledgeTree.js

@@ -127,9 +127,9 @@ $('#searchBtn').click(function(e){
                     $(".ztree").css("height",contentHei-80-43-60-20+'px')
                 }else{
                     $(".radioList").hide()
-                    $(".ztree").css("height",contentHei-80-43-20-20+'px')
+                    $(".ztree").css("height",contentHei-80-43-20-20-20+'px')
                     $(".ztree").css({
-                        margin: '20 0 0 0px'
+                        margin: '20px 0px 0px 0px'
                     })
                 }
                 let renderTabInfo = getTab("疾病") 

+ 1 - 1
src/js/schemaMap.js

@@ -316,7 +316,7 @@ function getSchema(val, type){
 
  function getTab(tabName){
     console.log('tabName', tabName)
-    let tabList = ["疾病","药品通用名","症状","手术和操作","实验室检查","辅助检查","辅助检查1","辅助检查2","辅助检查3","辅助检查4"]
+    let tabList = ["疾病","药品通用名","症状","手术和操作","实验室检查","辅助检查"]
     let tabListCopy = tabList.slice()
     const index = tabList.findIndex(item => item == tabName)