import type { TableColumnProps } from '@/types/basic-table';
// 基础表格样式配置
export const TABLE_MAX_HEIGHT_DEFAULT = 'calc(70vh - 100px)';
export const TABLE_MAX_HEIGHT_PERMISSION = 'calc(70vh - 150px)';
const TABLE_OPTIONS = {
  emptyText: '暂无数据',
  loading: true,
};

const BASIC_TABLE_COLUMNS = {
  INDEX: {
    label: '序号',
    type: 'index',
    width: '80px',
    align: 'center',
  },
  PLAN_NAME: {
    label: '预案名称',
    prop: 'planName',
    minWidth: '120px',
  },
  PLAN_TYPE: {
    label: '预案类型',
    slot: 'planType',
    minWidth: '120px',
  },
  ENENT_TYPE: {
    label: '事件类型',
    slot: 'eventType',
    minWidth: '120px',
  },
  DEPT_NAME: {
    label: '制定部门',
    prop: 'deptName',
    minWidth: '120px',
  },
  ACTION: {
    label: '操作',
    slot: 'action',
    fixed: 'right',
    align: 'center',
    width: '200px',
  },
};
/**
 * 预案管理表格配置
 */
export const EMERGENCY_PLAN_MANAGEMENT_TABLE_OPTIONS = {
  ...TABLE_OPTIONS,
};

export const EMERGENCY_PLAN_APPROVAL_TABLE_OPTIONS = {
  ...TABLE_OPTIONS,
  maxHeight: 'calc(70vh - 50px)',
};

export const APPROVAL_PROCESS_TABLE_OPTIONS = {
  maxHeight: '500px',
};

export const EMERGENCY_PLAN_MANAGEMENT_TABLE_COLUMNS: TableColumnProps[] = [
  BASIC_TABLE_COLUMNS.INDEX,
  BASIC_TABLE_COLUMNS.PLAN_NAME,
  BASIC_TABLE_COLUMNS.PLAN_TYPE,
  BASIC_TABLE_COLUMNS.ENENT_TYPE,
  BASIC_TABLE_COLUMNS.DEPT_NAME,
  {
    label: '试验专业场所',
    prop: 'professionalTestSite',
    minWidth: '160px',
  },
  {
    label: '状态',
    slot: 'status',
    minWidth: '120px',
  },
  {
    label: '启停',
    slot: 'isDisabled',
    minWidth: '60px',
    align: 'center',
  },
  BASIC_TABLE_COLUMNS.ACTION,
];

export const EMERGENCY_PLAN_APPROVAL_TABLE_COLUMNS: TableColumnProps[] = [
  BASIC_TABLE_COLUMNS.INDEX,
  BASIC_TABLE_COLUMNS.PLAN_NAME,
  BASIC_TABLE_COLUMNS.PLAN_TYPE,
  BASIC_TABLE_COLUMNS.ENENT_TYPE,
  BASIC_TABLE_COLUMNS.DEPT_NAME,
  {
    label: '审批状态',
    slot: 'approvalStatus',
    minWidth: '120px',
  },
  {
    label: '公示文件',
    slot: 'appendix',
    width: '120px',
    align: 'center',
  },
  {
    label: '预案审批描述',
    prop: 'approvalDescription',
    minWidth: '120px',
  },
  {
    label: '提交人',
    prop: 'createdByName',
    minWidth: '120px',
  },
  {
    label: '提交时间',
    prop: 'createdAt',
    minWidth: '200px',
  },
  BASIC_TABLE_COLUMNS.ACTION,
];

export const APPROVAL_PROCESS_TABLE_COLUMNS: TableColumnProps[] = [
  {
    label: '流程步骤',
    prop: 'approvalOrder',
    align: 'center',
    width: '120px',
  },
  {
    label: '节点描述',
    prop: 'nodeDescription',
  },
  {
    label: '审批人',
    prop: 'approverName',
  },
  {
    label: '审批方式',
    slot: 'approvalType',
    align: 'center',
    width: '120px',
  },
  {
    label: '状态',
    slot: 'approvalStatus',
    align: 'center',
    width: '100px',
  },
  {
    label: '审批时间',
    prop: 'approvalTime',
    width: '200px',
    slot: 'approvalTime',
  },
  {
    label: '审批内容',
    prop: 'approvalContent',
  },
];
