DataViz V5.5.01之后的版本支持此种用法
参考:
http://www.idataviz.com/doc/userguide/story_resource.html?h=6.3.8.2.3%20%E7%BB%91%E5%AE%9A%E8%87%AA%E7%94%B1%E5%9D%97
mouseLeftClikEventCallBack = function(data){
if($rootScope.hasTrigger != data["字段名称"]){ //如果当前点击的省份与上次不同,就要进行tab的切换
if(data["字段名称"]== '省份1'){
scope.$emit("hide-layers-emit",
{
target:[ "02567c-94c-b76","abacd2-a92-5f3","400612-3bf-15c"], //要隐藏的自由块的wid,反向思考
tabWids:[ "9b7dce-407-dc6","1ecf82-8ec-db9","5e7fc3-1a1-f26","a122bf-752-b3f"] //N个TAB的wid
}
);
}
....
else if(data["字段名称"]== '省份N'){ //选择省份N,显示第N组自由块
scope.$emit("hide-layers-emit",
{
target:["592e69-2a5-f7b","abacd2-a92-5f3","400612-3bf-15c"],
tabWids:["9b7dce-407-dc6","1ecf82-8ec-db9","5e7fc3-1a1-f26","a122bf-752-b3f"]
}
);
}
$rootScope.hasTrigger = data["字段名称"];
} else { //如果当前点击的省份与上次相同,恢复默认tab显示
scope.$emit("hide-layers-emit",
{
target:["592e69-2a5-f7b","02567c-94c-b76","abacd2-a92-5f3"],
tabWids:["9b7dce-407-dc6","1ecf82-8ec-db9","5e7fc3-1a1-f26","a122bf-752-b3f"]
}
);
$rootScope.hasTrigger = undefined; //是否已触发的标记
}
$rootScope.$digest();//触发自由块的显隐
};
前述target与tabWids的获取需要浏览器调试,具体方法参考自定义函数控制tab切换。
isAppendLeftKeyCustom: true,