package org.example.Enums;

/**
 * 系统枚举集合
 * 包含控件类型、消息表类型、模块类型等多种枚举
 * 创 建 者：zyw
 * 创建日期：2016-06-28 15:50:32
 */
public class SystemEnums {
    /**
     * 控件类型
     */
    public enum ControlType {
        LabText(0, "文本框"),
        LabComboxValue(1, "下拉框 获取Value值"),
        LabComboxText(2, "下拉框 获取Text值"),
        LabTreeType(3, "树"),
        LabDate(4, "日期(年-月-日)"),
        LabDateTime(44, "日期和时间(年-月-日 时-分-秒)"),
        LabDateTimeShort(444, "日期短时间(年-月-日 时-分)"),
        LabTime(4444, "时间(时-分-秒)"),
        LabShortTime(44444, "短时间(时-分)"),
        LabYearTime(444444, "时间（年-月）"),
        LabAutoCompleteValue(5, "自动搜索 获取Value值"),
        LabAutoCompleteText(6, "自动搜索 获取Text值"),
        LabTextInt(7, "数字控件"),
        LabPassword(8, "密码框"),
        LabRemark(9, "备注"),
        LabWWW(10, "网址"),
        LabQQ(11, "QQ"),
        LabPhone(12, "电话拨号(手机端拨号)"),
        LabVPhone(200, "如果是web端，那么就带发短信验证码功能"),
        LabMultiSelectValue(13, "多选，获取Value"),
        LabMultiSelectText(14, "多选，获取Text"),
        LabAutoCompleteValueParam(15, "自动搜索 获取Value值,需要带参数"),
        LabAutoCompleteTextParam(16, "自动搜索 获取Text值,需要带参数"),
        LabCheckBox(17, "复选框"),
        LabComboxCheckListValue(18, ""),
        LabComboxCheckListText(19, ""),
        LabMemoEdit(20, "Memo控件"),
        LabCheckComboxValue(21, ""),
        LabCheckComboxText(22, ""),
        LabComboxInputParam(23, "Combox获取Text值,需要带参数 宜宾项目为36"),
        LabCheckDateEx(24, ""),
        LabCheckAutoSeacherValue(25, ""),
        LabCheckAutoSeacherText(26, ""),
        LabCalcText(27, "计算器"),
        LabMultiSelectValueParam(33, "多选 获取Value值,需要带参数"),
        LabMultiSelectTextParam(34, "多选 获取Text值,需要带参数"),
        LabComboxValueParam(35, "Combox获取Value值,需要带参数"),
        LabComboxTextParam(36, "下拉列表框(带参数) 保存Value值,显示Text值"),
        LabRichEdit(37, "富文本编辑框"),
        LabSmartQueryReturnID(38, "智能搜索返回ID"),
        LabSmartQueryReturnName(39, "智能搜索返回Name"),
        LabSmartQueryReturnIDWithParam(40, "智能搜索返回ID 带参数"),
        LabSmartQueryReturnNameWithParam(41, "智能搜索返回Name 带参数"),
        LabProgress(96, "进度条"),
        LabMap(97, "地图(手机端)"),
        LabOSacn(98, "扫码(手机端) 条码"),
        LabPic(99, "图片"),
        LabPicEx(100, "图片，存地址"),
        LabTSacn(101, "扫码(手机端) 二维码"),
        LabWinBtnsValue(102, ""),
        LabWinBtnsText(103, ""),
        LabWinMultiBtnsValue(104, ""),
        LabWinMultiBtnsText(105, ""),
        LabRadioGroupValue(106, "单选框组"),
        LabRadioGroupText(107, "单选框组"),
        LabWinGridValue(109, ""),
        LabWinGridText(110, ""),
        LabWinMultiGridValue(111, ""),
        LabWinMultiGridText(112, ""),
        LabModuleSelectValues(42, "弹出模块选行数据，根据行数据自动填充表单字段"),
        LabModuleMultiSelectValues(43, "弹出模块多选行数据，根据行数据自动填充表单字段"),
        LabComboxModuleValueParam(116, "弹窗模块选择value"),
        LabComboxModuleTextParam(117, "弹窗模块选择text"),
        LabComTreeboxValue(118, "下拉树返回value"),
        LabComTreeboxText(119, "下拉树返回text"),
        LabComTreeboxValueParam(120, "下拉树返回value带参数"),
        LabComTreeboxTextParam(121, "下拉树返回text带参数"),
        LabComTreeboxLeafValue(122, "下拉树返回value带参数"),
        LabComTreeboxLeafText(123, "下拉树返回text带参数"),
        LabComTreeboxLeafValueParam(124, "下拉树返回value带参数"),
        LabComTreeboxLeafTextParam(125, "下拉树返回text带参数"),
        LabComStarValueParam(126, "下拉树返回value带参数"),
        LabComStarTextParam(127, "下拉树返回text带参数"),
        LabSignature(128, "签字框"),
        LabJointRemark(129, "签字框"),
        CheckboxGroupValue(130, "多选框组"),
        CheckboxGroupText(131, "多选框组"),
        LabMultiComTreeboxLeafValue(132, "下拉树返回value"),
        LabMultiComTreeboxLeafText(133, "下拉树返回text"),
        LabMultiComTreeboxLeafValueParam(134, "下拉树多选返回末级value带参数"),
        LabMultiComTreeboxLeafTextParam(135, "下拉树多选返回末级text带参数"),
        LabMultiComTreeboxValue(136, "下拉树多选返回value"),
        LabMultiComTreeboxText(137, "下拉树多选返回text"),
        LabMultiComTreeboxValueParam(138, "下拉树多选返回value带参数"),
        LabMultiComTreeboxTextParam(139, "下拉树多选返回text带参数"),
        ApiLabText(140, "调用接口的文本"),


        LabLink(164,"超链接"),//超链接
        LabModuleLink(165,"超链接"),//超链接

        LabEleScale(170,""),
        LabCheckDateTimeEx(244, ""),
        LabCheckDateTimeShort(2444, ""),
        LabCheckTime(24444, ""),
        LabCheckShortTime(244444, ""),
        LabLabYearTime(2444444, "");

        private final int value;
        private final String description;

        ControlType(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static ControlType fromValue(int value) {
            for (ControlType type : ControlType.values()) {
                if (type.value == value) {
                    return type;
                }
            }
            throw new IllegalArgumentException("未知的ControlType值: " + value);
        }
    }

    /**
     * 消息表类型
     */
    public enum MsgTableType {
        WX(3),
        YunZhiJia(4);

        private final int value;

        MsgTableType(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static MsgTableType fromValue(int value) {
            for (MsgTableType type : MsgTableType.values()) {
                if (type.value == value) {
                    return type;
                }
            }
            throw new IllegalArgumentException("未知的MsgTableType值: " + value);
        }
    }

    /**
     * 模块类型枚举
     */
    public enum ModuleTypeEnum {
        Bill,
        Module,
        Report,
        Accraditation,
        Other
    }

    /**
     * 模块类型
     */
    public enum ModuleType {
        BaseModule,
        ReportModule,
        BillModule
    }

    /**
     * 单据菜单枚举
     */
    public enum BillMenuEnum {
        BillSource,
        BillSourceDetail,
        BillDetail
    }

    /**
     * 目标类型
     */
    public enum TargetType {
        ALL(0),
        CS(1),
        MOBILE(2),
        WEB(3);

        private final int value;

        TargetType(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static TargetType fromValue(int value) {
            for (TargetType type : TargetType.values()) {
                if (type.value == value) {
                    return type;
                }
            }
            throw new IllegalArgumentException("未知的TargetType值: " + value);
        }
    }

    /**
     * 图表模块类型
     */
    public enum ChartType {
        Line(1, "折线"),
        Bar(2, "柱状图"),
        Pie(3, "饼图"),
        Map(4, "地图 一般为混搭模式"),
        Radar(5, "雷达"),
        Candlestick(6, "k线图"),
        Boxplot(7, "箱线图"),
        Heatmap(8, "热力图"),
        Graph(9, "关系图"),
        Treemap(10, "矩形树图"),
        Parallel(11, "平行坐标"),
        Sankey(12, "桑基图"),
        Funnel(13, "漏斗"),
        Gauge(14, "仪表盘"),
        PictorialBar(15, "象形柱图"),
        ThemeRiver(16, "主体河流"),
        Scatter(17, "散点图");

        private final int value;
        private final String description;

        ChartType(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static ChartType fromValue(int value) {
            for (ChartType type : ChartType.values()) {
                if (type.value == value) {
                    return type;
                }
            }
            throw new IllegalArgumentException("未知的ChartType值: " + value);
        }
    }

    /**
     * 单据状态
     */
    public enum BillState {
        Canceled(-1, "作废"),
        Draft(0, "草稿"),
        Applied(1, "提交未审核"),
        Aduit(2, "审核中"),
        Backed(3, "已退回"),
        Over(4, "已完成");

        private final int value;
        private final String description;

        BillState(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static BillState fromValue(int value) {
            for (BillState state : BillState.values()) {
                if (state.value == value) {
                    return state;
                }
            }
            throw new IllegalArgumentException("未知的BillState值: " + value);
        }
    }

    /**
     * 程序事件类型
     */
    public enum OperateEvent {
        BeforeModuleDataLoad(1),
        BeforeModuleDataChange(3),
        AfterModuleDataChange(4),
        BeforeModuleStateChange(5),
        AfterModuleStateChange(6),
        BeforeModuleAuditStateChange(7),
        AfterModuleAuditStateChange(8),
        BeforeModuleContextMenu(9),
        AfterModuleContextMenu(10),
        BeforeModuleDataDelete(11),
        AfterModuleDataDelete(12),
        BeforeUploadFile(13),
        AfterUploadFile(14),
        Loop(99),
        Timer(100);

        private final int value;

        OperateEvent(int value) {
            this.value = value;
        }

        public int getValue() {
            return value;
        }

        public static OperateEvent fromValue(int value) {
            for (OperateEvent event : OperateEvent.values()) {
                if (event.value == value) {
                    return event;
                }
            }
            throw new IllegalArgumentException("未知的OperateEvent值: " + value);
        }
    }

    /**
     * 操作类型
     */
    public enum ActionType {
        None(-1, "未设置"),
        Load(0, "加载数据"),
        Add(1, "添加"),
        Update(2, "修改"),
        Delete(3, "删除"),
        Obsolete(4, "作废"),
        EscObsolete(5, "取消作废"),
        Submit(21, "提交"),
        EscSubmit(22, "取消提交"),
        Audit(31, "审核"),
        AuditBack(32, "反退"),
        AuditClose(33, "关闭审核"),
        AuditPress(34, "审核催办"),
        AuditPause(35, "审核暂停待办"),
        AuditForward(36, "审核转发"),
        AuditHand(37, "审核转交");

        private final int value;
        private final String description;

        ActionType(int value, String description) {
            this.value = value;
            this.description = description;
        }

        public int getValue() {
            return value;
        }

        public String getDescription() {
            return description;
        }

        public static ActionType fromValue(int value) {
            for (ActionType type : ActionType.values()) {
                if (type.value == value) {
                    return type;
                }
            }
            throw new IllegalArgumentException("未知的ActionType值: " + value);
        }
    }
}
