package com.vci.ubcs.codeapply.enums; import com.vci.ubcs.starter.web.enumpck.BaseEnum; /** * 参照配置中用到的——窗口类型 * @author ludc * @date 2023/5/24 14:09 */ public enum CodeReferConfigTypeEnum implements BaseEnum { /** * 默认样式 */ DEFAULT("default","默认样式"), /** * 平台配置 */ STAND("stand","平台配置"), /** * 树形 */ TREE("tree","树形"), /** * 树形 */ GRID("grid","列表"), /** * 部门树 */ ORGDEPARTMENTREFER("refer/OrgDepartmentRefer","部门树"), /** * 部门列表 */ ORGDEPARTMENTGRIDREFERS("refer/OrgDepartmentGridRefers","部门列表"), /** * 用户 */ SMUSERREFER("refer/SmUserRefer","用户"), /** * 用户列表 */ SMUSERGRIDREFER("refer/SmUserGridRefer","用户列表"), /** * 角色列表 */ SMROLEREFER("refer/SmRoleRefer","角色列表"), /** * 职务 */ ORGDUTYREFER("refer/OrgDutyRefer","职务"), /** * 工种 */ SMWORKTYPEREFER("refer/SmWorkTypeRefer","工种"), /** * 流程模板 */ WFPROCESSTEMPLATEREFER("refer/WfProcessTemplateRefer","流程模板"); /** * 枚举的值 */ private String value; /** * 枚举显示文本 */ private String text; /** * 获取枚举值 * * @return 枚举值 */ @Override public String getValue() { return value; } /** * 设置枚举值 * * @param value 枚举值 */ public void setValue(String value) { this.value = value; } /** * 获取枚举显示文本 * * @return 显示文本 */ @Override public String getText() { return text; } /** * 设置显示文本 * * @param text 显示文本 */ public void setText(String text) { this.text = text; } /** * 构造函数 * * @param value 值 * @param text 显示文本 */ private CodeReferConfigTypeEnum(String value, String text) { this.value = value; this.text = text; } /** * 根据名称获取对应的枚举值 * * @param text 名称 * @return 枚举值 */ public static String getValueByText(String text) { for (CodeReferConfigTypeEnum wenum : CodeReferConfigTypeEnum.values()) { if (wenum.getText().equalsIgnoreCase(text)) { return wenum.getValue(); } } return ""; } /** * 根据枚举值获取名称 * * @param value 枚举值 * @return 名称 */ public static String getTextByValue(String value) { for (CodeReferConfigTypeEnum wenum : CodeReferConfigTypeEnum.values()) { if (wenum.getValue().equalsIgnoreCase(value)) { return wenum.getText(); } } return ""; } /** * 根据枚举值获取枚举对象 * * @param value 枚举值 * @return 枚举对象,不存在时候返回null */ public static CodeReferConfigTypeEnum forValue(String value) { for (CodeReferConfigTypeEnum wenum : CodeReferConfigTypeEnum.values()) { if (wenum.getValue().equalsIgnoreCase(value)) { return wenum; } } return null; } }