@Override
public void afterBindData(EventObject e) {
super.afterBindData(e);
//标准界面控件与数据绑定之后,初始化个性化控件绑定数据显示
IFormView view = this.getView();//界面
IDataModel model = this.getModel();//数据
//标准界面控件与数据绑定之后,初始化个性化控件绑定数据显示
//根据数据初始化界面控件颜色
String billstatus = (String) model.getValue("billstatus");
switch (billstatus) {
case "A":
HashMap<String,Object> fieldMap = new HashMap<>();
//设置前景色 保存(蓝色)
fieldMap.put(ClientProperties.ForeColor,"#3987ed");
//同步指定元数据到控件
this.getView().updateControlMetadata("billstatus",fieldMap);
break;
case "B": //已提交(橙色)
HashMap<String,Object> fieldMap = new HashMap<>();
fieldMap.put(ClientProperties.ForeColor,"#ff991c");
this.getView().updateControlMetadata("billstatus",fieldMap);
break;
case "C": //审核中(紫色)
HashMap<String,Object> fieldMap = new HashMap<>();
fieldMap.put(ClientProperties.ForeColor,"#701df0");
this.getView().updateControlMetadata("billstatus",fieldMap);
break;
case "D": //已审核(绿色)
HashMap<String,Object> fieldMap = new HashMap<>();
fieldMap.put(ClientProperties.ForeColor,"#1ba854");
this.getView().updateControlMetadata("billstatus",fieldMap);
break;
case "E": //入库中(青色)
HashMap<String,Object> fieldMap = new HashMap<>();
fieldMap.put(ClientProperties.ForeColor,"#16b0f1");
this.getView().updateControlMetadata("billstatus",fieldMap);
case "F": //已完成入库 (黄色)
HashMap<String,Object> fieldMap = new HashMap<>();
fieldMap.put(ClientProperties.ForeColor,"#ffd52e");
this.getView().updateControlMetadata("billstatus",fieldMap);
break;
case "H": //废弃(红色)
HashMap<String,Object> fieldMap = new HashMap<>();
fieldMap.put(ClientProperties.ForeColor,"#fb2323");
this.getView().updateControlMetadata("billstatus",fieldMap);
break;
default:
break;
}
}
推荐阅读