/**
 * 灾害处置的常量
 */
import { PAGE_SIZE_CONFIG } from '@/constant/pagination';
// 任务阶段
export enum TASK_STAGE {
  TO_BE_RELEASED = 1,
  TO_BE_REPORTED,
  REPORTED_LOSS,
  REPORTED_NO_LOSS,
  OVERDUE,
}

export enum FIX_STATUS {
  TO_BE_RECTIFIED = 1,
  RESPONDED,
  UPDATED,
  COMPLETED,
  TEMPORARY_CLOSED,
}

export enum IS_LOSS {
  NO_LOSS = 0,
  LOSS,
}

const TASK_STAGE_OPTIONS_BASIC = [
  {
    label: '待上报',
    value: TASK_STAGE.TO_BE_REPORTED,
  },
  {
    label: '已上报，有损失',
    value: TASK_STAGE.REPORTED_LOSS,
  },
  {
    label: '已上报，无损失',
    value: TASK_STAGE.REPORTED_NO_LOSS,
  },
  {
    label: '超期未上报',
    value: TASK_STAGE.OVERDUE,
  },
];

export const TASK_STAGE_OPTIONS_DISPOSAL_MANAGEMENT = [
  {
    label: '待发布',
    value: TASK_STAGE.TO_BE_RELEASED,
  },
  ...TASK_STAGE_OPTIONS_BASIC,
];

export const TASK_STAGE_OPTIONS_REPORT_TASK = [...TASK_STAGE_OPTIONS_BASIC];

const FIX_STATUS_OPTIONS_BASIC = {
  RECTIFIED: {
    label: '待整改',
    value: FIX_STATUS.TO_BE_RECTIFIED,
  },
  RESPONDED: {
    label: '已响应',
    value: FIX_STATUS.RESPONDED,
  },
  UPDATED: {
    label: '已更新',
    value: FIX_STATUS.UPDATED,
  },
  COMPLETED: {
    label: '已完成',
    value: FIX_STATUS.COMPLETED,
  },
  TEMPORARY_CLOSED: {
    label: '暂时关闭',
    value: FIX_STATUS.TEMPORARY_CLOSED,
  },
};

export const FIX_STATUS_OPTIONS = [
  FIX_STATUS_OPTIONS_BASIC.RECTIFIED,
  FIX_STATUS_OPTIONS_BASIC.RESPONDED,
  FIX_STATUS_OPTIONS_BASIC.UPDATED,
  FIX_STATUS_OPTIONS_BASIC.COMPLETED,
  FIX_STATUS_OPTIONS_BASIC.TEMPORARY_CLOSED,
];

export const FIX_STATUS_OPTIONS_DISPOSAL_RECTIFICATION = [
  FIX_STATUS_OPTIONS_BASIC.RESPONDED,
  FIX_STATUS_OPTIONS_BASIC.UPDATED,
  FIX_STATUS_OPTIONS_BASIC.COMPLETED,
  FIX_STATUS_OPTIONS_BASIC.TEMPORARY_CLOSED,
];

export const DEFAULT_PAGE_SIZE = 10;
export const DISASTER_CONTROL_PAGE_SIZE_CONFIG = [DEFAULT_PAGE_SIZE, ...PAGE_SIZE_CONFIG];

export const LOSS_REPORT_TABS = [
  {
    label: '上报任务',
    value: 'reportTask',
  },
  {
    label: '损失记录',
    value: 'lossRecord',
  },
];
