|
@@ -54,7 +54,7 @@ function drawGraph(data,resultShowId) {
|
|
|
{
|
|
|
type: 'graph',
|
|
|
layout: 'force',
|
|
|
- cursor:'default',
|
|
|
+ cursor:'pointer',
|
|
|
categories: categories,
|
|
|
symbolSize: 80,
|
|
|
roam: 'move',
|
|
@@ -107,7 +107,7 @@ function drawGraph(data,resultShowId) {
|
|
|
normal: {
|
|
|
show: true,
|
|
|
textStyle: {
|
|
|
- // cursor:'pointer',
|
|
|
+ cursor:'pointer',
|
|
|
},
|
|
|
color:'#1E1E1E', //label字体颜色
|
|
|
formatter: function (x) {
|
|
@@ -125,38 +125,59 @@ function drawGraph(data,resultShowId) {
|
|
|
}
|
|
|
]
|
|
|
};
|
|
|
+ myChart.on('click',dataClick);
|
|
|
myChart.setOption(option);
|
|
|
|
|
|
}
|
|
|
|
|
|
function dataClick(param){
|
|
|
var data = param.data;
|
|
|
+ const clientHei = $(window).height()
|
|
|
+ const contentHei = clientHei - 80
|
|
|
+ // console.log('data', data,select_type)
|
|
|
// var nodes = option.series[0].nodes;
|
|
|
- if(data.source !== undefined && data.target !== undefined)
|
|
|
- {
|
|
|
- // myChart.setOption(option);
|
|
|
- }else {
|
|
|
- if(data.category == 1)
|
|
|
- {
|
|
|
- myChart.setOption(option);
|
|
|
- }
|
|
|
-
|
|
|
- // else if(data.parent == -1){
|
|
|
- // var img = data.symbol;
|
|
|
- // img = img.substring(8);
|
|
|
- // showImg(img);
|
|
|
- // }else if(data.parent == -2){
|
|
|
- // window.open(data.video);
|
|
|
- // }
|
|
|
- else if(data.label.indexOf("http") != -1){
|
|
|
- window.open(data.label);
|
|
|
- }
|
|
|
- else if(data.symbol == "rect"){
|
|
|
- return;
|
|
|
- }else {
|
|
|
- // showKnowledgeGraph(data.label, 'graph',3);
|
|
|
+ if(data.category == 0){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ if(data.symbol != "circle"){
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ if(data.type == select_type){
|
|
|
+ $('#searchInp').val(data.label)
|
|
|
+ updateTree(data.label)
|
|
|
+ getGraph(data.label,select_type);
|
|
|
+
|
|
|
+ }else {
|
|
|
+ if(data.type != "疾病"){
|
|
|
+ $(".radioList").hide()
|
|
|
+ }else{
|
|
|
+ $(".radioList").show()
|
|
|
+ }
|
|
|
+ if(data.type == "疾病"){
|
|
|
+ select_type_noSearch = data.type
|
|
|
+ select_type = data.type
|
|
|
+ $('.selectedName').html(select_type)
|
|
|
+ $(".activeTab").removeClass("activeTab")
|
|
|
+ $(".diagnose").addClass("activeTab")
|
|
|
+ $(".ztree").css("height",contentHei-80-43-60-20+'px')
|
|
|
+ $('#searchInp').val(data.label)
|
|
|
+ $('.iconRadio').attr('src','/images/radioUnSelect.png')
|
|
|
+ $('.ICD10 img').attr('src','/images/radioSelect.png')
|
|
|
+ getTree(1,1,data.label);
|
|
|
+ getGraph(data.label,select_type);
|
|
|
+ }else if(data.type == "药品通用名"){
|
|
|
+ select_type_noSearch = data.type
|
|
|
+ select_type = data.type
|
|
|
+ $('.selectedName').html("药品")
|
|
|
+ $(".activeTab").removeClass("activeTab")
|
|
|
+ $(".drug").addClass("activeTab")
|
|
|
+ $(".ztree").css("height",contentHei-80-43-20+'px')
|
|
|
+ $('#searchInp').val(data.label)
|
|
|
+ getTree(0,2,data.label);
|
|
|
+ getGraph(data.label,select_type);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|