|
@@ -21,6 +21,7 @@ import $ from "jquery";
|
|
|
</div>
|
|
|
</div>
|
|
|
`;
|
|
|
+ var dataOption = {};
|
|
|
/**line left 21
|
|
|
* node left 20
|
|
|
* label-content left 9
|
|
@@ -43,6 +44,7 @@ import $ from "jquery";
|
|
|
fishBone.init = function(container,option){
|
|
|
this.style = option.color?option.color:this.style;
|
|
|
this.dowload = option.dowload?option.dowload:this.dowload;
|
|
|
+ dataOption = option;
|
|
|
var data = option.data;
|
|
|
var len = data.length;
|
|
|
var tpl = '';
|
|
@@ -109,6 +111,10 @@ import $ from "jquery";
|
|
|
var color = this.style;
|
|
|
$(".fish-bone-block").on("click",function(){
|
|
|
// $(".fish-bone-content").css({"background-color":"#f5f5f5"});
|
|
|
+ var length = dataOption.data.length;
|
|
|
+ $(".fish-bone-block").each(function(index,ele){
|
|
|
+ $(".fish-bone-block").eq(index).find('.fish-bone-content').css({"background-color":dataOption.data[index].backgroundColor});
|
|
|
+ })
|
|
|
$(".fish-bone-node").removeClass("active-node");
|
|
|
$(this).find(".fish-bone-content").css({"background-color":color});
|
|
|
$(this).find(".fish-bone-node").addClass("active-node");
|