0
|
Z4u3z1Lv6专家互助发布于2023-6-1 17:23
|
把你的JS贴出来 大概率加个延时就可以了 setTimeout(function() { //SetInterval:每100毫秒执行一次,setTimeout:100毫秒后执行一次 你现在的JS }, 100);
|
-
y2578788147(提问者)
- //获取下拉框控件area
var gh = this.options.form.getWidgetByName(\"gh\");
//获取下拉框控件xl
var xm = this.options.form.getWidgetByName(\"xm\");
//获取下拉框控件cplx
var bm = this.options.form.getWidgetByName(\"bm\");
//获取下拉框控件cp
var xl = this.options.form.getWidgetByName(\"xl\");
//获取下拉框控件ywjc
var zw = this.options.form.getWidgetByName(\"zw\");
//获取下拉框控件xsy
var zc = this.options.form.getWidgetByName(\"zc\");
var xb = this.options.form.getWidgetByName(\"xb\");
var zzlb = this.options.form.getWidgetByName(\"zzlb\");
//获取下拉框选中值
var a = this.getValue();
//判断a中是否包含对应的字段,返回true或false
var a1 = a.includes(\"工号\");
var a2 = a.includes(\"姓名\");
var a3 = a.includes(\"部门\");
var a4 = a.includes(\"学历\");
var a5 = a.includes(\"职务\");
var a6 = a.includes(\"职称\");
var a7 = a.includes(\"性别\");
var a8 = a.includes(\"在职类别\");
//alert(a1,a2,a3,a4,a5,a6);
//对不同的控件设置隐藏显示
if(a1) {
gh.setVisible(true);
this.options.form.getWidgetByName(\"Labelarea\").setVisible(true);
} else {
gh.setVisible(false);
this.options.form.getWidgetByName(\"Labelarea\").setVisible(false);
}
if(a2) {
xm.setVisible(true);
this.options.form.getWidgetByName(\"Labelxl\").setVisible(true);
} else {
xm.setVisible(false);
this.options.form.getWidgetByName(\"Labelxl\").setVisible(false);
}
if(a3) {
bm.setVisible(true);
this.options.form.getWidgetByName(\"Labelcplx\").setVisible(true);
} else {
bm.setVisible(false);
this.options.form.getWidgetByName(\"Labelcplx\").setVisible(false);
}
if(a4) {
xl.setVisible(true);
this.options.form.getWidgetByName(\"Labelcp\").setVisible(true);
} else {
xl.setVisible(false);
this.options.form.getWidgetByName(\"Labelcp\").setVisible(false);
}
if(a5) {
zw.setVisible(true);
this.options.form.getWidgetByName(\"Labelywjc\").setVisible(true);
} else {
zw.setVisible(false);
this.options.form.getWidgetByName(\"Labelywjc\").setVisible(false);
}
if(a6) {
zc.setVisible(true);
this.options.form.getWidgetByName(\"Labelxsy\").setVisible(true);
} else {
zc.setVisible(false);
this.options.form.getWidgetByName(\"Labelxsy\").setVisible(false);
}
if(a7) {
xb.setVisible(true);
this.options.form.getWidgetByName(\"Labelxsy\").setVisible(true);
} else {
xb.setVisible(false);
this.options.form.getWidgetByName(\"Labelxsy\").setVisible(false);
}
if(a8) {
zzlb.setVisible(true);
this.options.form.getWidgetByName(\"Labelxsy\").setVisible(true);
} else {
zzlb.setVisible(false);
this.options.form.getWidgetByName(\"Labelxsy\").setVisible(false);
}
|
|