export const loadingOptions = {
    text: '加载中...',
    color: '#c23531',
    textColor: '#fff',
    maskColor: 'rgba(0, 0, 0, 0.1)',
    spinnerRadius: 10,
    fontSize: 14,
}
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];
        },
    },
]