表结构如图所示
下拉参数如图所示
下拉参数选中哪个指标就展示哪个指标列 其余指标列隐藏
参考类似案例我写了如下脚本,目前可以实现选中单个参数可以只展示选中参数的指标列其余列隐藏 ,但选中多个参数或者全选则所有列隐藏或者只展示总收入列
所以想请问一下永洪的大佬们,要实现我希望的功能该怎么写js脚本?
var arr = 下拉列表参数1.getSelectedObjects()[0;
if (arr == "总收入") {
var loc = new Locator(["药品收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["医疗收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["出院收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["门急诊收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["体检收入", COL, DETAIL);
图表1.setColWidth(loc,0);
}
else if (arr == "药品收入") {
var loc = new Locator(["总收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["医疗收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["出院收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["门急诊收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["体检收入", COL, DETAIL);
图表1.setColWidth(loc,0);
}
else if (arr == "医疗收入") {
var loc = new Locator(["药品收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["总收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["出院收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["门急诊收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["体检收入", COL, DETAIL);
图表1.setColWidth(loc,0);
}
else if (arr == "出院收入") {
var loc = new Locator(["药品收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["医疗收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["总收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["门急诊收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["体检收入", COL, DETAIL);
图表1.setColWidth(loc,0);
}
else if (arr == "门急诊收入") {
var loc = new Locator(["药品收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["医疗收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["总收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["出院收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["体检收入", COL, DETAIL);
图表1.setColWidth(loc,0);
}
else if (arr == "体检收入") {
var loc = new Locator(["药品收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["医疗收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["总收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["门急诊收入", COL, DETAIL);
图表1.setColWidth(loc,0);
var loc = new Locator(["出院收入", COL, DETAIL);
图表1.setColWidth(loc,0);
}
else {
var loc = new Locator(["药品收入", COL, DETAIL);
图表1.setColWidth(loc,100);
var loc = new Locator(["医疗收入", COL, DETAIL);
图表1.setColWidth(loc,100);
var loc = new Locator(["总收入", COL, DETAIL);
图表1.setColWidth(loc,100);
var loc = new Locator(["门急诊收入", COL, DETAIL);
图表1.setColWidth(loc,100);
var loc = new Locator(["出院收入", COL, DETAIL);
图表1.setColWidth(loc,100);
var loc = new Locator(["体检收入", COL, DETAIL);
图表1.setColWidth(loc,100);
}
|