"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getYear = exports.getTypeMap = exports.getStatusType = exports.getPopType = exports.getOkrTypes = exports.getMonthKeyValue = exports.getBimonthlyMonthKeyValue = void 0;

var _constant = require("../../utils/constant");

var _getLocale = require("../../utils/getLocale");

var getYear = function getYear() {
  var years = [{
    title: (0, _getLocale.getLocale)("OKR_MyO_Butt_Allyears"),
    value: -1
  }];

  for (var i = 2013; i < 2051; i++) {
    years.push({
      title: i + (_getLocale.isEn ? "" : "年"),
      value: i
    });
  }

  return years;
};

exports.getYear = getYear;

var getStatusType = function getStatusType() {
  return [{
    title: (0, _getLocale.getLocale)("OKR_MyO_Butt_AllStates"),
    value: 0
  }, {
    title: (0, _getLocale.getLocale)("Per_MyRe_text_Inprogress"),
    value: 1
  }, {
    title: (0, _getLocale.getLocale)("OKR_MyO_Butt_Hasended"),
    value: 2
  }];
};

exports.getStatusType = getStatusType;

var getOkrTypes = function getOkrTypes() {
  return [{
    title: (0, _getLocale.getLocale)("OKR_MyO_Butt_Alltypes"),
    value: -1
  }, {
    title: (0, _getLocale.getLocale)("OKR_MyO_Pop_Company"),
    value: 3
  }, {
    title: (0, _getLocale.getLocale)("Mod_Department"),
    value: 2
  }, {
    /**
        新增的团队 --- start
      */
    title: (0, _getLocale.getLocale)("OKR_MyO_Text_Team"),
    value: 4
    /**
        新增的团队 --- end
      */

  }, {
    title: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
    value: 1
  }];
};

exports.getOkrTypes = getOkrTypes;

var getPopType = function getPopType() {
  return {
    0: (0, _getLocale.getLocale)("OKR_OKRW_Butt_Switchobje"),
    1: (0, _getLocale.getLocale)("OKR_MyO_Pop_SetAlignment")
  };
};

exports.getPopType = getPopType;

var getTypeMap = function getTypeMap() {
  return {
    1: (0, _getLocale.getLocale)("OKR_MyO_Pop_Individual"),
    2: (0, _getLocale.getLocale)("Mod_Department"),
    3: (0, _getLocale.getLocale)("OKR_MyO_Pop_Company"),
    4: (0, _getLocale.getLocale)("OKR_MyO_Text_Team")
  };
};

exports.getTypeMap = getTypeMap;

var getBimonthlyMonthKeyValue = function getBimonthlyMonthKeyValue(startMonth) {
  var start = startMonth % 2 == 1 ? 1 : 2;
  var month = start;

  var getNextMonth = function getNextMonth(month) {
    var step = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
    return (month + step) % 12 || 12;
  };

  var datas = [];
  var monthLang = (0, _constant.getMonth)();

  if (!_getLocale.isEn) {
    datas.push({
      title: "".concat(start, " - ").concat(getNextMonth(start), "\u6708"),
      value: "4,".concat(start)
    });

    while (1) {
      month = getNextMonth(month, 2);
      if (month == start) break;
      datas.push({
        title: "".concat(month, " - ").concat(getNextMonth(month), "\u6708"),
        value: "4,".concat(month)
      });
    }
  } else {
    datas.push({
      title: "".concat(monthLang[start - 1], " - ").concat(monthLang[getNextMonth(start) - 1]),
      value: "4,".concat(start)
    });

    while (1) {
      month = getNextMonth(month, 2);
      if (month == start) break;
      datas.push({
        title: "".concat(monthLang[month - 1], " - ").concat(monthLang[getNextMonth(month) - 1]),
        value: "4,".concat(month)
      });
    }
  }

  return datas;
};

exports.getBimonthlyMonthKeyValue = getBimonthlyMonthKeyValue;

var getMonthKeyValue = function getMonthKeyValue() {
  var month = (0, _constant.getMonth)();
  return [{
    title: month[0],
    value: "3,1"
  }, {
    title: month[1],
    value: "3,2"
  }, {
    title: month[2],
    value: "3,3"
  }, {
    title: month[3],
    value: "3,4"
  }, {
    title: month[4],
    value: "3,5"
  }, {
    title: month[5],
    value: "3,6"
  }, {
    title: month[6],
    value: "3,7"
  }, {
    title: month[7],
    value: "3,8"
  }, {
    title: month[8],
    value: "3,9"
  }, {
    title: month[9],
    value: "3,10"
  }, {
    title: month[10],
    value: "3,11"
  }, {
    title: month[11],
    value: "3,12"
  }];
};

exports.getMonthKeyValue = getMonthKeyValue;