优化代码

This commit is contained in:
xiaoshi 2024-12-12 21:31:34 +08:00
parent de4a2d76a6
commit 7eb7bc216b
1 changed files with 21 additions and 16 deletions

View File

@ -18,24 +18,29 @@ public class ResourceFilterExtPlugin extends ResourceItemListPlugin {
FormShowParameter formShowParameter = this.getView().getFormShowParameter(); FormShowParameter formShowParameter = this.getView().getFormShowParameter();
Map<String, Object> customParams = formShowParameter.getCustomParams(); Map<String, Object> customParams = formShowParameter.getCustomParams();
Object contractType = customParams.get("contractType"); Object contractType = customParams.get("contractType");
if (contractType != null) { String firstOpen = this.getPageCache().get("firstOpen");
if (contractType.toString().equals("wzcg")) {//物资采购 if (firstOpen != null) {
this.getView().setVisible(true, new String[]{"flexpanelmaterial"}); this.getPageCache().put("firstOpen", "false");
this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelturnover","flexpanelother"}); if (contractType != null) {
this.setResourceTypeStyle("material"); if (contractType.toString().equals("wzcg")) {//物资采购
this.afterSelectedTag("material"); this.getView().setVisible(true, new String[]{"flexpanelmaterial"});
} else if (contractType.toString().equals("cs2")) {//设备采购 this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelturnover","flexpanelother"});
this.getView().setVisible(true, new String[]{"flexpanelequipment"}); this.setResourceTypeStyle("material");
this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelmaterial", "flexpanelturnover","flexpanelother"}); this.afterSelectedTag("material");
this.setResourceTypeStyle("equipment"); } else if (contractType.toString().equals("cs2")) {//设备采购
this.afterSelectedTag("equipment"); this.getView().setVisible(true, new String[]{"flexpanelequipment"});
}else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")) {//产出物 this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelmaterial", "flexpanelturnover","flexpanelother"});
this.getView().setVisible(true, new String[]{"flexpanelturnover"}); this.setResourceTypeStyle("equipment");
this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelmaterial","flexpanelother"}); this.afterSelectedTag("equipment");
this.setResourceTypeStyle("turnover"); }else if (contractType.toString().equals("qtcc") || contractType.toString().equals("lwlcc")) {//产出物
this.afterSelectedTag("turnover"); this.getView().setVisible(true, new String[]{"flexpanelturnover"});
this.getView().setVisible(false, new String[]{"flexpanelsub", "flexpanellabour", "flexpanelcomposite", "flexpanelequipment", "flexpanelmaterial","flexpanelother"});
this.setResourceTypeStyle("turnover");
this.afterSelectedTag("turnover");
}
} }
} }
System.out.println(); System.out.println();
} }