Browse Source

修改切换bug

zhangxc 5 years ago
parent
commit
097b54143c
4 changed files with 107 additions and 13 deletions
  1. 28 7
      src/js/graphMap.js
  2. 26 2
      src/js/index.js
  3. 26 3
      src/js/knowledgeTree.js
  4. 27 1
      src/js/schemaMap.js

+ 28 - 7
src/js/graphMap.js

@@ -148,12 +148,9 @@ function dataClick(param){
                 getGraph(data.label,select_type);
               
             }else {
-                if(data.type != "疾病"){
-                    $(".radioList").hide()
-                }else{
-                    $(".radioList").show()
-                }
+               
                 if(data.type == "疾病"){
+                    $(".radioList").show()
                     select_type_noSearch = data.type
                     select_type = data.type
                     $('.selectedName').html(select_type)
@@ -166,6 +163,7 @@ function dataClick(param){
                     getTree(1,1,data.label);
                     getGraph(data.label,select_type);
                 }else if(data.type == "药品通用名"){
+                    $(".radioList").hide()
                     select_type_noSearch = data.type
                     select_type = data.type
                     $('.selectedName').html("药品")
@@ -288,10 +286,33 @@ function getNode(val, type){
             $(".tabNameList").show()
             $(".tabNameList li").click(function(){
                 const txt = $(this).text()
+                const clientHei = $(window).height()
+                const contentHei = clientHei - 80
                 $(".tabNameList").hide()
-
+                if(select_type_noSearch != select_type){
+                    select_type = select_type_noSearch
+                  
+                    if(select_type == '疾病'){
+                        $(".radioList").show()
+                        $(".activeTab").removeClass("activeTab")
+                        $(".diagnose").addClass("activeTab")
+                        $(".ztree").css("height",contentHei-80-43-60-20+'px')
+                        // $('#searchInp').val("高血压3级")
+                        $('.iconRadio').attr('src','/images/radioUnSelect.png')
+                        $('.ICD10 img').attr('src','/images/radioSelect.png')
+                        getTree(1,1,txt);
+                    }else if(select_type == '药品通用名'){
+                        $(".radioList").hide()
+                        $(".ztree").css("height",contentHei-80-43-20+'px')
+                        $(".activeTab").removeClass("activeTab")
+                        $(".drug").addClass("activeTab")
+                        getTree(0,2,txt);
+                    }
+                }else{
+                    updateTree(txt)
+                }
                 getGraph(txt,select_type)
-                updateTree(txt)
+               
             })
         }
     })

+ 26 - 2
src/js/index.js

@@ -83,9 +83,33 @@ $('#searchBtn').click(function(e){
     e.stopPropagation()
     const val = $('#searchInp').val()
     if(val){
-        select_type=select_type_noSearch
+        const clientHei = $(window).height()
+        const contentHei = clientHei - 80
+        $(".tabNameList").hide()
+        if(select_type_noSearch != select_type){
+            select_type = select_type_noSearch
+            
+            if(select_type == '疾病'){
+                $(".radioList").show()
+                $(".activeTab").removeClass("activeTab")
+                $(".diagnose").addClass("activeTab")
+                $(".ztree").css("height",contentHei-80-43-60-20+'px')
+                // $('#searchInp').val("高血压3级")
+                $('.iconRadio').attr('src','/images/radioUnSelect.png')
+                $('.ICD10 img').attr('src','/images/radioSelect.png')
+                getTree(1,1,val);
+            }else if(select_type == '药品通用名'){
+                $(".radioList").hide()
+                $(".ztree").css("height",contentHei-80-43-20+'px')
+                $(".activeTab").removeClass("activeTab")
+                $(".drug").addClass("activeTab")
+                getTree(0,2,val);
+            }
+        }else{
+            updateTree(val)
+        }
         getGraph(val,select_type)
-        updateTree(val)
+       
     }else{
        $('.tabNameListNoSearch').show()
     }

+ 26 - 3
src/js/knowledgeTree.js

@@ -80,9 +80,32 @@ $('#searchBtn').click(function(e){
     e.stopPropagation()
     const val = $('#searchInp').val()
     if(val){
-        select_type=select_type_noSearch
-        getGraph(val,select_type)
-        updateTree(val)
+        const clientHei = $(window).height()
+        const contentHei = clientHei - 80
+        $(".tabNameList").hide()
+        if(select_type_noSearch != select_type){
+            select_type = select_type_noSearch
+            
+            if(select_type == '疾病'){
+                $(".radioList").show()
+                $(".activeTab").removeClass("activeTab")
+                $(".diagnose").addClass("activeTab")
+                $(".ztree").css("height",contentHei-80-43-60-20+'px')
+                // $('#searchInp').val("高血压3级")
+                $('.iconRadio').attr('src','/images/radioUnSelect.png')
+                $('.ICD10 img').attr('src','/images/radioSelect.png')
+                getTree(1,1,val);
+            }else if(select_type == '药品通用名'){
+                $(".radioList").hide()
+                $(".ztree").css("height",contentHei-80-43-20+'px')
+                $(".activeTab").removeClass("activeTab")
+                $(".drug").addClass("activeTab")
+                getTree(0,2,val);
+            }
+        }else{
+            updateTree(val)
+        }
+        getSchema(val,select_type)
     }else{
        $('.tabNameListNoSearch').show()
     }

+ 27 - 1
src/js/schemaMap.js

@@ -104,9 +104,35 @@ function getNode(val, type){
             $(".tabNameList").show()
             $(".tabNameList li").click(function(){
                 const txt = $(this).text()
+                const clientHei = $(window).height()
+                const contentHei = clientHei - 80
                 $(".tabNameList").hide()
+                if(select_type_noSearch != select_type){
+                    select_type = select_type_noSearch
+                  
+                    if(select_type == '疾病'){
+                        $(".radioList").show()
+                        $(".activeTab").removeClass("activeTab")
+                        $(".diagnose").addClass("activeTab")
+                        $(".ztree").css("height",contentHei-80-43-60-20+'px')
+                        // $('#searchInp').val("高血压3级")
+                        $('.iconRadio').attr('src','/images/radioUnSelect.png')
+                        $('.ICD10 img').attr('src','/images/radioSelect.png')
+                        getTree(1,1,txt);
+                    }else if(select_type == '药品通用名'){
+                        $(".radioList").hide()
+                        $(".ztree").css("height",contentHei-80-43-20+'px')
+                        $(".activeTab").removeClass("activeTab")
+                        $(".drug").addClass("activeTab")
+                        getTree(0,2,txt);
+                    }
+                }else{
+                    updateTree(txt)
+                }
                 getSchema(txt,select_type)
-                updateTree(txt)
+
+
+               
             })
         }
     })