package com.engine.organization.util;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @description: MenuBtn工具类
 * @author:dxfeng
 * @createTime: 2022/05/09
 * @version: 1.0
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MenuBtn {
    private String isBatch;
    private String isTop;
    private String menuFun;
    private String menuIcon;
    private String menuName;
    private String type;

    /**
     * topMenu新增
     *
     * @return
     */
    public static MenuBtn topMenu_addNew() {
        return MenuBtn.builder().isBatch("1").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新增").type("BTN_Addnew").build();
    }

    /**
     * topMenu批量删除
     *
     * @return
     */
    public static MenuBtn topMenu_batchDelete() {
        return MenuBtn.builder().isBatch("1").isTop("1").menuFun("batchDelete").menuIcon("icon-coms-Batch-delete").menuName("批量删除").type( "BTN_BatchDelete").build();
    }

    /**
     * topMenu批量删除
     *
     * @return
     */
    public static MenuBtn topMenu_copy() {
        return MenuBtn.builder().isBatch("1").isTop("1").menuFun("copy").menuIcon("icon-coms-form-copy").menuName("批量复制").type( "BTN_Copy").build();
    }

    /**
     * rightMenu新增
     *
     * @return
     */
    public static MenuBtn rightMenu_addNew() {
        return MenuBtn.builder().isBatch("0").isTop("1").menuFun("new").menuIcon("icon-coms-New-Flow").menuName("新增").type("BTN_Addnew").build();
    }

    /**
     * rightMenu日志
     *
     * @return
     */
    public static MenuBtn rightMenu_btnLog() {
        return MenuBtn.builder().isBatch("0").isTop("0").menuFun("log").menuIcon("icon-coms-Print-log").menuName("日志").type("BTN_log").build();
    }

    /**
     * topMenu批量删除
     *
     * @return
     */
    public static MenuBtn rightMenu_copy() {
        return MenuBtn.builder().isBatch("0").isTop("0").menuFun("copy").menuIcon("icon-coms-form-copy").menuName("复制").type( "BTN_Copy").build();
    }

    /**
     * rightMenu显示列定制
     *
     * @return
     */
    public static MenuBtn rightMenu_btnColumn() {
        return MenuBtn.builder().isBatch("0").isTop("0").menuFun("custom").menuIcon("icon-coms-task-list").menuName("显示列定制").type("BTN_COLUMN").build();
    }

    /**
     * 获取常用按钮列表
     * @return
     */
    public static Map<String, List<MenuBtn>> getCommonBtnDatas() {
        Map<String, List<MenuBtn>> btnDatas = new HashMap<>();
        ArrayList<MenuBtn> topMenuList = new ArrayList<>();
        ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
        // 新增
        topMenuList.add(MenuBtn.topMenu_addNew());
        // 批量删除
        topMenuList.add(MenuBtn.topMenu_batchDelete());
        btnDatas.put("topMenu", topMenuList);
        // 新增
        rightMenuList.add(MenuBtn.rightMenu_addNew());
        // 日志
        rightMenuList.add(MenuBtn.rightMenu_btnLog());
        // 显示列定制
        rightMenuList.add(MenuBtn.rightMenu_btnColumn());
        btnDatas.put("rightMenu", rightMenuList);
        return btnDatas;
    }

    /**
     * 获取常用按钮列表
     * @return
     */
    public static Map<String, List<MenuBtn>> getDatasNoBtnColum() {
        Map<String, List<MenuBtn>> btnDatas = new HashMap<>();
        ArrayList<MenuBtn> topMenuList = new ArrayList<>();
        ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
        // 新增
        topMenuList.add(MenuBtn.topMenu_addNew());
        // 批量删除
        topMenuList.add(MenuBtn.topMenu_batchDelete());
        btnDatas.put("topMenu", topMenuList);
        // 新增
        rightMenuList.add(MenuBtn.rightMenu_addNew());
        // 日志
        rightMenuList.add(MenuBtn.rightMenu_btnLog());
        // 显示列定制
        // rightMenuList.add(MenuBtn.rightMenu_btnColumn());
        btnDatas.put("rightMenu", rightMenuList);
        return btnDatas;
    }

    /**
     * 获取常用按钮列表
     * @return
     */
    public static Map<String, List<MenuBtn>> getDatasHasCopy() {
        Map<String, List<MenuBtn>> btnDatas = new HashMap<>();
        ArrayList<MenuBtn> topMenuList = new ArrayList<>();
        ArrayList<MenuBtn> rightMenuList = new ArrayList<>();
        // 新增
        topMenuList.add(MenuBtn.topMenu_addNew());
        // 批量删除
        topMenuList.add(MenuBtn.topMenu_batchDelete());
        // 复制
        topMenuList.add(MenuBtn.topMenu_copy());
        btnDatas.put("topMenu", topMenuList);
        // 新增
        rightMenuList.add(MenuBtn.rightMenu_addNew());
        // 复制
        // rightMenuList.add(MenuBtn.rightMenu_copy());
        // 日志
        rightMenuList.add(MenuBtn.rightMenu_btnLog());
        btnDatas.put("rightMenu", rightMenuList);
        return btnDatas;
    }


}
