很多错误,很多控件没有,你也写进去了
按你的模板语句改成如下就行了
var yearWidget = _g().getParameterContainer().getWidgetByName("year");//获取year控件的值
var monthWidget = _g().getParameterContainer().getWidgetByName("month");//获取month控件的值
var LabelyearWidget = _g().getParameterContainer().getWidgetByName("Labelyear");//获取Labelyear控件的值
var Labelmonth = _g().getParameterContainer().getWidgetByName("Labelmonth");//获取Labelyear控件的值
var value = this.getValue(); //获取当前控件即type控件的值
//判断当前控件的值,根据判断结果显示或隐藏其他控件
if (value == "年报") {
yearWidget.setVisible(true);
LabelyearWidget.setVisible(true);
monthWidget.setVisible(false);
Labelmonth.setVisible(false);
} else {
yearWidget.setVisible(false);
LabelyearWidget.setVisible(false);
monthWidget.setVisible(true);
Labelmonth.setVisible(true);
}

