/**
 * 灾害预警信息表格配置
 */
import type { TableColumnProps } from '@/types/basic-table';

export const TABLE_HEIGHT_DEFAULT = 'calc(70vh - 50px)';
export const TABLE_HEIGHT_PREMISSION = 'calc(65vh - 50px)';
// 基础表格样式配置
export const TABLE_OPTIONS = {
  emptyText: '暂无数据',
  loading: true,
};

// 基础表格列配置
const BASIC_TABLE_COLUMNS = {
  DISASTER_TYPE: {
    prop: 'disasterType',
    label: '灾害类型',
    slot: 'disasterType',
    minWidth: '120px',
  },
  DISASTER_LEVEL: {
    prop: 'disasterLevel',
    label: '灾害等级',
    slot: 'disasterLevel',
    minWidth: '150px',
  },
  PUBLISH_TIME: {
    prop: 'pushTime',
    label: '发布时间',
    minWidth: '200px',
  },
  ACTIVE_STATUS: {
    prop: 'effectState',
    label: '生效状态',
    slot: 'effectState',
    width: '120px',
  },
  PUSH_STATUS: {
    prop: 'isPush',
    label: '推送',
    align: 'center',
    slot: 'isPush',
  },
  ACTION: {
    prop: 'action',
    label: '操作',
    align: 'center',
    slot: 'action',
    fixed: 'right',
    width: '250px',
  },
};

// 预警信息表格列配置
export const WARNING_INFO_TABLE_COLUMNS_DEFAULT: TableColumnProps[] = [
  {
    prop: 'warningIcon',
    label: '预警图标',
    align: 'center',
    slot: 'warningIcon',
    width: '150px',
  },
  {
    prop: 'disasterType',
    label: '预警类型',
    slot: 'disasterType',
    minWidth: '180px',
  },
  BASIC_TABLE_COLUMNS.DISASTER_LEVEL,
  {
    prop: 'warnTime',
    label: '预警时间',
    minWidth: '200px',
  },
  {
    prop: 'content',
    label: '发布内容',
    minWidth: '200px',
    slot: 'content',
  },
];

export const WARNING_INFO_TABLE_COLUMNS_PERMISSION: TableColumnProps[] = [
  ...WARNING_INFO_TABLE_COLUMNS_DEFAULT,
  BASIC_TABLE_COLUMNS.ACTIVE_STATUS,
  BASIC_TABLE_COLUMNS.ACTION,
];

// 防御通知表格列配置
const DEFENSE_NOTICE_TABLE_COLUMNS_COMMON: TableColumnProps[] = [
  {
    prop: 'title',
    label: '标题',
    minWidth: '200px',
  },
  {
    prop: 'disasterType',
    label: '灾害类型',
    slot: 'disasterType',
    minWidth: '120px',
  },
  BASIC_TABLE_COLUMNS.DISASTER_LEVEL,
];
export const DEFENSE_NOTICE_TABLE_COLUMNS_DEFAULT: TableColumnProps[] = [
  ...DEFENSE_NOTICE_TABLE_COLUMNS_COMMON,
  BASIC_TABLE_COLUMNS.PUBLISH_TIME,
  BASIC_TABLE_COLUMNS.ACTION,
];
export const DEFENSE_NOTICE_TABLE_COLUMNS_PERMISSION: TableColumnProps[] = [
  ...DEFENSE_NOTICE_TABLE_COLUMNS_COMMON,
  BASIC_TABLE_COLUMNS.ACTIVE_STATUS,
  {
    label: '创建时间',
    prop: 'createdAt',
    minWidth: '200px',
  },
  BASIC_TABLE_COLUMNS.ACTION,
];
