/*
 * @Description: 常量管理
 */

/**
 * 常用时间选择
 * @param
 */
export const shortcuts = [
    {
        text: '近一周',
        value: () => {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            return [start, end];
        },
    },
    {
        text: '近一个月',
        value: () => {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            return [start, end];
        },
    },
    {
        text: '上季度',
        value: () => {
            let oDate = new Date();
            let thisYear = oDate.getFullYear();
            let thisMonth = oDate.getMonth() + 1;
            let n = Math.ceil(thisMonth / 3); // 季度
            let Month = n * 3 - 1;
            let start = new Date(thisYear, Month - 2, 1);
            let end = new Date();
            return [start, end];
        },
    },
    {
        text: '本季度',
        value: () => {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            return [start, end];
        },
    },
    {
        text: '去年',
        value: ()=> {
            let oDate = new Date();
            let prevYear = oDate.getFullYear() - 1;
            const end = new Date();
            const start = new Date();
            start.setFullYear(prevYear);
            start.setMonth(0);
            start.setDate(1);
            end.setFullYear(prevYear);
            end.setMonth(11);
            end.setDate(31);
            return [start, end];
        }
    },{
        text: '今年',
        value: ()=> {
            const end = new Date();
            const start = new Date();
            start.setMonth(0);
            start.setDate(1);
            return [start, end];
        }
    },
];

/**
 * @description 常用意见
 * @param  {number}  Seat 坐席  1
 * @param  {number}  Rest 休息  2
 * @param  {number} OrderCirculation 工单流转  3
 * @param  {number} KnowledgeL 知识库  4
 * @param  {number} RestReason 休息原因  5
 * @param  {number} HandleAgain 办理意见  6
 * @param  {number} Supervise 督办意见  7
 * @param  {number} Return 退回意见  8
 * @param  {number} Archive 归档意见  9
 * @param  {number} Teti 特提  10
 * @param  {number} Discriminate 甄别  11
 * @param  {number} ReturnVisit 回访  12
 * @param  {number} Delay 延期  13
 */
export const commonEnum = {
    Seat: 1,
    Rest: 2,
    OrderCirculation: 3,
    KnowledgeL: 4,
    RestReason: 5,
    HandleAgain: 6,
    Supervise: 7,
    Return: 8,
    Archive: 9,
    Teti: 10,
    Discriminate: 11,
    ReturnVisit: 12,
    Delay: 13,
};
