/**
 * 对外公开单位常量，包含单位名称以及单位体量
 * 同类型单位标记为x_units:[a,b,...],数组对象为对应单位对象名称，按单位体量从小到大排序
 * 单位对象标记为x:{key:'x',name:'X',carryIndex:i,decimal:j,type:'x_units'}其中：
 * key:单位标示符，和单位对象同名
 * name:单位显示值
 * carryIndex:同组单位体量指数固有系数，应为连续整数
 * carry:单位体量指数常量，可理解为单位进制转换为10的decimal次幂
 * type：单位所属同类单位组对象名称
 * @constant 单位_Units
 */
export var Units = {
  // 秒，毫秒
  s_units: {
    keys: ['ms', 's'],
    carry: 1000
  },
  ms: {
    key: 'ms',
    name: 'ms',
    carryIndex: 0,
    type: 's_units'
  },
  s: {
    key: 's',
    name: 's',
    carryIndex: 1,
    type: 's_units'
  },
  // 流量
  b_units: {
    keys: ['b', 'kb', 'mb', 'gb', 'tb'],
    carry: 1000
  },
  b: {
    key: 'b',
    name: 'b',
    carryIndex: 0,
    type: 'b_units'
  },
  kb: {
    key: 'kb',
    name: 'Kb',
    carryIndex: 1,
    type: 'b_units'
  },
  mb: {
    key: 'mb',
    name: 'Mb',
    carryIndex: 2,
    type: 'b_units'
  },
  gb: {
    key: 'gb',
    name: 'Gb',
    carryIndex: 3,
    type: 'b_units'
  },
  tb: {
    key: 'tb',
    name: 'Tb',
    carryIndex: 4,
    type: 'b_units'
  },
  // 流量B
  B_units: {
    keys: ['B', 'KB', 'MB', 'GB', 'TB'],
    carry: 1000
  },
  B: {
    key: 'B',
    name: 'B',
    carryIndex: 0,
    type: 'B_units'
  },
  KB: {
    key: 'KB',
    name: 'KB',
    carryIndex: 1,
    type: 'B_units'
  },
  MB: {
    key: 'MB',
    name: 'MB',
    carryIndex: 2,
    type: 'B_units'
  },
  GB: {
    key: 'GB',
    name: 'GB',
    carryIndex: 3,
    type: 'B_units'
  },
  TB: {
    key: 'TB',
    name: 'TB',
    carryIndex: 4,
    type: 'B_units'
  },
  // 流速
  bps_units: {
    keys: ['bps', 'kbps', 'mbps', 'gbps', 'tbps'],
    carry: 1000
  },
  bps: {
    key: 'bps',
    name: 'bps',
    carryIndex: 0,
    type: 'bps_units'
  },
  kbps: {
    key: 'kbps',
    name: 'Kbps',
    carryIndex: 1,
    type: 'bps_units'
  },
  mbps: {
    key: 'mbps',
    name: 'Mbps',
    carryIndex: 2,
    type: 'bps_units'
  },
  gbps: {
    key: 'gbps',
    name: 'Gbps',
    carryIndex: 3,
    type: 'bps_units'
  },
  tbps: {
    key: 'tbps',
    name: 'Tbps',
    carryIndex: 4,
    type: 'bps_units'
  },
  // 流速B
  Bps_units: {
    keys: ['Bps', 'KBps', 'MBps', 'GBps', 'TBps'],
    carry: 1000
  },
  Bps: {
    key: 'Bps',
    name: 'Bps',
    carryIndex: 0,
    type: 'Bps_units'
  },
  KBps: {
    key: 'KBps',
    name: 'KBps',
    carryIndex: 1,
    type: 'Bps_units'
  },
  MBps: {
    key: 'MBps',
    name: 'MBps',
    carryIndex: 2,
    type: 'Bps_units'
  },
  GBps: {
    key: 'GBps',
    name: 'GBps',
    carryIndex: 3,
    type: 'Bps_units'
  },
  TBps: {
    key: 'TBps',
    name: 'TBps',
    carryIndex: 4,
    type: 'Bps_units'
  },
  // 百分号数字
  percent_units: {
    keys: ['num', '%'],
    carry: 100
  },
  num: {
    key: 'num',
    name: 'num',
    carryIndex: 0,
    type: 'percent_units'
  },
  '%': {
    key: '%',
    name: '%',
    carryIndex: -1,
    type: 'percent_units'
  },
  // 人，万人
  p_units: {
    keys: ['人', '万人'],
    carry: 10000
  },
  人: {
    key: '人',
    name: '人',
    carryIndex: 0,
    type: 'p_units'
  },
  万人: {
    key: '万人',
    name: '万人',
    carryIndex: 1,
    type: 'p_units'
  },
  // 个，万个
  a_units: {
    keys: ['个', '万个'],
    carry: 10000
  },
  个: {
    key: '个',
    name: '个',
    carryIndex: 0,
    type: 'a_units'
  },
  万个: {
    key: '万个',
    name: '万个',
    carryIndex: 1,
    type: 'a_units'
  },
  // 次，万次
  n_units: {
    keys: ['次', '万次'],
    carry: 10000
  },
  次: {
    key: '次',
    name: '次',
    carryIndex: 0,
    type: 'n_units'
  },
  万次: {
    key: '万次',
    name: '万次',
    carryIndex: 1,
    type: 'n_units'
  },
  // 时间戳
  ts: {
    key: 'ts',
    name: '时间戳'
  },
  // 空值
  empty: '-',
  // 默认时间转换模板
  dateFormat_default: 'YYYY-MM-DD HH:mm'
};