var NODE_CODE = {
  common: [
    { nodeName: '获取运单', nodeCode: 'NEW' },
    { nodeName: '获取运单', nodeCode: 'FWB' },
    { nodeName: '收运核单', nodeCode: 'DEH' },
    { nodeName: '查验', nodeCode: 'ACC_CHECK' },
    { nodeName: '加货', nodeCode: 'ACC_BUP' },
    { nodeName: '预配载', nodeCode: 'LS_CARGO' },
    { nodeName: '预配载', nodeCode: 'FSUDEP' },
    { nodeName: '预配载', nodeCode: 'FSU_DEP' },
    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_02' },
    { nodeName: '交接复核', nodeCode: 'CARGOS_HANDOVER_STATUS_03' },
    { nodeName: '机下交接', nodeCode: '出港货邮' },
    { nodeName: '装机完成', nodeCode: '装载完成' },
    { nodeName: '关货舱门', nodeCode: '货舱关闭' },
    { nodeName: '拉下登记', nodeCode: 'CARGOS_OFFLOAD' },
    { nodeName: '拉下确认', nodeCode: 'OFFLOAD_CONFIRM' },
    { nodeName: '退运', nodeCode: 'BILL_RETURN' },
    { nodeName: '卸机', nodeCode: 'CARGOS_ARR_HANDOVER' },
    { nodeName: '机下交接', nodeCode: 'CARGOS_HANDOVER_STATUS_01' },
    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_99' },
    { nodeName: '理货', nodeCode: 'IMP_TALLY' },
    { nodeName: '出库', nodeCode: 'FSU_DLV' },
    { nodeName: '出库', nodeCode: 'FSUDLV' },
    { nodeName: '入园', nodeCode: 'EPORTREL' },
    { nodeName: '运抵货站', nodeCode: 'FOH' },
    { nodeName: '海关放行', nodeCode: 'MTREL_out' },
    { nodeName: '收运核单', nodeCode: 'RCS' },
    { nodeName: '海关放行', nodeCode: 'MTREL_in' },
    { nodeName: '海关放行', nodeCode: 'MTREL' },
    { nodeName: '出库', nodeCode: 'EIMS_Y02' },
    { nodeName: '出库', nodeCode: 'DLV' },
    { nodeName: '理货', nodeCode: 'RCF报' },
    { nodeName: '理货', nodeCode: 'CARTON_LIST' },
    { nodeName: '发起货站交接', nodeCode: 'CARGOS_DEP_ULD_HANDOVER' },
    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS99' },
  ],
  departure: [
    { nodeName: '收运核单', nodeCode: 'DEH' },
    // { nodeName: '收运核查', nodeCode: 'ACC_CHECK' },
    {
      nodeName: '安检',
      nodeCode: 'DOM_REH',
      // nodeCode: 'SECURITY', // 临时-复制加货
    },
    {
      nodeName: '加货',
      nodeCode: 'ACC_BUP',
      sync: true, // sync为true时与前一个节点并列显示
    },
    { nodeName: '预配载', nodeCode: 'LS_CARGO' },
    // { nodeName: '待运区', nodeCode: 'WAT_LOC' },
    // { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_02' },
    { nodeName: '交接复核', nodeCode: 'CARGOS_HANDOVER_STATUS_03' },
    { nodeName: '机下交接', nodeCode: '出港货邮' },
    { nodeName: '装机', nodeCode: '装载完成' },
    { nodeName: '关闭舱门', nodeCode: '关闭舱门' },
    { nodeName: '拉下登记', nodeCode: 'CARGOS_OFFLOAD', defaultDisabled: true },
    { nodeName: '拉回确认', nodeCode: 'OFFLOAD_CONFIRM', defaultDisabled: true },
    // { nodeName: '起飞', nodeCode: 'TAKEOFF', // 待定 },
    { nodeName: '退运', nodeCode: 'BILL_RETURN', defaultDisabled: true },
  ],
  arrival: [
    { nodeName: '卸机', nodeCode: 'CARGOS_ARR_HANDOVER' },
    { nodeName: '库区到达', nodeCode: 'CARGOS_HANDOVER_STATUS_01' },
    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_99' },
    { nodeName: '理货', nodeCode: 'IMP_TALLY' },
    { nodeName: '出库', nodeCode: 'FSU_DLV' },
  ],
  internationalDeparture: [
    { nodeName: '入园', nodeCode: 'MTEXDEC' },
    { nodeName: '海关', nodeCode: 'MTREL' },
    { nodeName: '运抵', nodeCode: 'FOH' },
    { nodeName: '安检', nodeCode: 'REH' },
    { nodeName: '收运核单', nodeCode: 'RCS' },
    { nodeName: '理货', nodeCode: 'CARTON_LIST' },
    { nodeName: '实配', nodeCode: 'LS_CARGO' },
    // { nodeName: '待运区', nodeCode: 'WAT_LOC' },
    // { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_02' },
    { nodeName: '交接复核', nodeCode: 'CARGOS_HANDOVER_STATUS_03' },
    { nodeName: '机下交接', nodeCode: '出港货邮' },
    { nodeName: '装机', nodeCode: '装载完成' },
    { nodeName: '拉下', nodeCode: 'CARGOS_OFFLOAD', defaultDisabled: true },
    // { nodeName: '退运', nodeCode: '' },
  ],
  internationalArrival: [
    { nodeName: '卸机', nodeCode: 'FFM' },
    { nodeName: '机下交接', nodeCode: 'CARGOS_HANDOVER_STATUS_01' },
    { nodeName: '货站交接', nodeCode: 'CARGOS_HANDOVER_STATUS_99' },
    { nodeName: '理货', nodeCode: 'RCF' },
    { nodeName: '海关放行', nodeCode: 'MTREL_in' },
    { nodeName: '出库', nodeCode: 'DLV' },
  ],
  internationalDepartureTransfer: [
    { nodeName: '入园', nodeCode: 'MTEXDEC' },
    { nodeName: '海关', nodeCode: 'MTREL' },
    { nodeName: '运抵', nodeCode: 'FOH' },
    { nodeName: '安检', nodeCode: 'REH' },
    { nodeName: '收运核单', nodeCode: 'RCS' },
    { nodeName: '理货', nodeCode: 'CARTON_LIST' },
    { nodeName: '实配', nodeCode: 'LS_CARGO' },
  ],
}

var MESSAGE_TYPE = {
  FFM: 'FFM',
  IMP_TALLY: '理货',
  FSUDLV: '出库',
}

var LOAD_WARNING_MAP = {
  departure: {
    // 窄体
    B737: 105,
    B757: 105,
    A320: 105,
    A319: 105,
    B733: 105,
    B752: 105,
    B738: 105,
    B734: 105,
    'B752+': 105,
    // 宽体
    B767: 115,
    B777: 115,
    B747: 115,
    A330: 115,
    A340: 115,
    MD11: 115,
    IL76: 115,
    B777F: 115,
    'B763+': 115,
    B748: 115,
    B772: 115,
    A332: 115,
    B744: 115,
    B763: 115,
    B77L: 115,
    A333: 115,
  },
  internationalDeparture: {
    B737: 240,
    B757: 240,
    A320: 240,
    A319: 240,
    B733: 240,
    B752: 240,
    B738: 240,
    B734: 240,
    'B752+': 240,
    B767: 360,
    B777: 360,
    B747: 360,
    A330: 360,
    A340: 360,
    MD11: 360,
    IL76: 360,
    B777F: 360,
    'B763+': 360,
    B748: 360,
    B772: 360,
    A332: 360,
    B744: 360,
    B763: 360,
    B77L: 360,
    A333: 360,
  },
}

var HANDOVER_WARNING_MAP = {
  departure: {
    '380-391': {
      warning: 75,
      alarm: 60,
    },
    '51-139': {
      warning: 80,
      alarm: 70,
    },
  },
  internationalDeparture: {
    all: {
      warning: 195,
    },
  },
}
