import {
  enableFilter,
  serviceUnitStatusFilter,
  warnFlowStatusFilter,
  violationFlowStatusFilter,
  publishStatusFilter,
  attendanceResultFilter,
  crmStatusFilter,
  runningStatusFilter,
} from '@/utils/filter';

const configs = {
  enable: {
    themeDict: { true: 'success', false: 'danger' },
    valFilter: enableFilter,
  },
  serviceUnit: {
    themeDict: {
      NEW: 'primary',
      PUBLISH: 'success',
      FINISH: 'danger',
      CANCEL: 'danger',
    },
    valFilter: serviceUnitStatusFilter,
  },
  warnFlow: {
    themeDict: {
      NOT_START: 'warning',
      FOLLOW: 'success',
      CLOSE: 'default',
      RESTART: 'primary',
    },
    valFilter: warnFlowStatusFilter,
  },
  violationFlow: {
    themeDict: {
      NOT_START: 'warning',
      FOLLOW: 'success',
      CLOSE: 'default',
      RESTART: 'primary',
    },
    valFilter: violationFlowStatusFilter,
  },
  notice: {
    themeDict: {
      PUBLISH: 'success',
      UN_PUBLISH: 'danger',
    },
    valFilter: publishStatusFilter,
  },
  crmStatus: {
    themeDict: {
      PUBLISH: 'success',
      UN_PUBLISH: 'danger',
      FINISH: 'primary',
    },
    valFilter: crmStatusFilter,
  },
  attendanceResult: {
    themeDict: {
      NORMAL: 'success',
      EXCEPTION: 'danger',
    },
    valFilter: attendanceResultFilter,
  },
  runningStatus: {
    themeDict: {
      NORMAL: 'success',
      BREAK_DOWN: 'danger',
    },
    valFilter: runningStatusFilter,
  },
  taskStatus: {
    themeDict: {
      已完成: 'success',
      进行中: 'primary',
      未开始: 'default',
    },
    valFilter: (val) => val,
  },
};
export function getConfig(type) {
  return configs[type] || { themeDict: {}, valFilter: (val) => val };
}
