/**
 * 灾害处置表格配置
 */
import type { TableColumnProps } from '@/types/basic-table';
// 基础表格样式配置
const TABLE_OPTIONS = {
  emptyText: '暂无数据',
  loading: true,
};

// 处置管理表格配置
export const DISPOSAL_MANAGEMENT_TABLE_OPTIONS = {
  ...TABLE_OPTIONS,
};

// 损失上报-上报任务表格配置
export const LOSS_REPORT_REPORT_TASK_TABLE_OPTIONS = {
  ...TABLE_OPTIONS,
};

// 整改信息明细表格配置
export const RECTIFICATION_INFO_TABLE_OPTIONS = {
  ...TABLE_OPTIONS,
};

// 灾后评估及重建表格配置
export const POST_DISASTER_TABLE_OPTIONS = {
  ...TABLE_OPTIONS,
  maxHeight: 'calc(70vh - 30px)',
};

// 基础表格列配置项
const BASIC_TABLE_COLUMNS = {
  INDEX: {
    type: 'index',
    label: '序号',
    prop: 'index',
    align: 'center',
    width: '80px',
  },
  DEPT_NAME: {
    label: '上报部门',
    prop: 'deptName',
    minWidth: '120px',
  },
  DUE_COMPLETE_TIME: {
    label: '应完成上报时间',
    prop: 'dueCompleteTime',
    minWidth: '200px',
  },
  TASK_STAGE: {
    label: '任务阶段',
    prop: 'taskStage',
    slot: 'taskStage',
    minWidth: '120px',
  },
  ACTION: {
    prop: 'action',
    label: '操作',
    align: 'center',
    slot: 'action',
    fixed: 'right',
    width: '300px',
  },
};

// 处置管理表格列配置
export const DISPOSAL_MANAGEMENT_TABLE_COLUMNS: TableColumnProps[] = [
  BASIC_TABLE_COLUMNS.INDEX,
  BASIC_TABLE_COLUMNS.DEPT_NAME,
  BASIC_TABLE_COLUMNS.DUE_COMPLETE_TIME,
  {
    label: '任务状态',
    prop: 'status',
    slot: 'status',
    width: '120px',
  },
  BASIC_TABLE_COLUMNS.TASK_STAGE,
  {
    label: '上报责任人',
    prop: 'reportPrincipals',
    slot: 'reportPrincipals',
    minWidth: '300px',
  },
  BASIC_TABLE_COLUMNS.ACTION,
];

// 损失上报-上报任务表格列配置
export const LOSS_REPORT_REPORT_TASK_TABLE_COLUMNS: TableColumnProps[] = [
  BASIC_TABLE_COLUMNS.INDEX,
  {
    label: '任务名称',
    prop: 'taskName',
    minWidth: '120px',
  },
  BASIC_TABLE_COLUMNS.DEPT_NAME,
  BASIC_TABLE_COLUMNS.DUE_COMPLETE_TIME,
  BASIC_TABLE_COLUMNS.TASK_STAGE,
  BASIC_TABLE_COLUMNS.ACTION,
];

export const LOSS_RECORD_TABLE_COLUMNS: TableColumnProps[] = [
  BASIC_TABLE_COLUMNS.INDEX,
  {
    label: '受灾地点',
    prop: 'affectedArea',
    slot: 'affectedArea',
    minWidth: '200px',
  },
  {
    label: '受灾物品',
    prop: 'affectedItems',
    slot: 'affectedItems',
    width: '200px',
  },
  {
    label: '上报时间',
    prop: 'updatedAt',
    minWidth: '200px',
  },
  {
    label: '整改部门',
    prop: 'responsibleDeptName',
    slot: 'responsibleDeptName',
    minWidth: '120px',
  },
  {
    label: '优先级',
    prop: 'priority',
    slot: 'priority',
    minWidth: '120px',
  },
  {
    label: '整改进度',
    prop: 'fixStatus',
    slot: 'fixStatus',
    minWidth: '120px',
  },
  BASIC_TABLE_COLUMNS.ACTION,
];

export const RECTIFICATION_INFO_TABLE_COLUMNS: TableColumnProps[] = [
  {
    label: '整改次序',
    prop: 'index',
    type: 'index',
    align: 'center',
    width: '120px',
  },
  {
    label: '整改措施',
    prop: 'fixMethod',
    slot: 'fixMethod',
    width: '200px',
  },
  {
    label: '整改图片',
    prop: 'fixImages',
    slot: 'fixImages',
    align: 'center',
    width: '200px',
  },
  {
    label: '整改时限',
    prop: 'fixDeadline',
    minWidth: '200px',
  },
  {
    label: '整改时间',
    prop: 'createdAt',
    minWidth: '200px',
  },
  {
    label: '整改状态',
    prop: 'fixStatus',
    slot: 'fixStatus',
    minWidth: '120px',
  },
  {
    label: '整改人',
    prop: 'createdByName',
    minWidth: '200px',
  },
  {
    label: '整改材料',
    prop: 'fixMaterials',
    slot: 'fixMaterials',
    align: 'center',
    width: '200px',
  },
  {
    label: '备注',
    prop: 'remark',
    slot: 'remark',
    width: '200px',
    fixed: 'right',
  },
];

// 灾后评估及重建表格列配置
export const POST_DISASTER_TABLE_COLUMNS: TableColumnProps[] = [
  BASIC_TABLE_COLUMNS.INDEX,
  {
    label: '灾害处置任务名称',
    prop: 'taskName',
    minWidth: '240px',
  },
  {
    label: '创建时间',
    prop: 'createdAt',
    width: '200px',
  },
  {
    label: '灾后评估材料',
    prop: 'disasterAssessMaterials',
    slot: 'disasterAssessMaterials',
    minWidth: '300px',
  },
  {
    label: '灾后重建方案',
    prop: 'disasterReconstructMaterials',
    slot: 'disasterReconstructMaterials',
    minWidth: '300px',
  },
  {
    label: '操作',
    prop: 'action',
    slot: 'action',
    align: 'center',
    width: '80px',
    fixed: 'right',
  },
];
