// 弹窗组件统一数据配置

// 行政区域选项
export const regionOptions = [
  { label: "重庆市", value: "重庆市" },
  { label: "万州区", value: "万州区" },
  { label: "沙坪坝区", value: "沙坪坝区" },
  { label: "渝中区", value: "渝中区" },
  { label: "巫溪县", value: "巫溪县" },
  { label: "涪陵区", value: "涪陵区" },
  { label: "合川区", value: "合川区" },
  { label: "万盛区", value: "万盛区" },
  { label: "长寿区", value: "长寿区" },
  { label: "城口区", value: "城口区" },
  { label: "柏梓镇", value: "柏梓镇" },
  { label: "江北区", value: "江北区" },
];

// 类型选项
export const typeOptions = [
  { label: "边坡坍塌", value: "边坡坍塌" },
  { label: "路面塌陷", value: "路面塌陷" },
  { label: "桥梁损坏", value: "桥梁损坏" },
  { label: "隧道事故", value: "隧道事故" },
  { label: "交通主管部门", value: "交通主管部门" },
  { label: "公路机构", value: "公路机构" },
  { label: "养护站", value: "养护站" },
  { label: "护路员", value: "护路员" },
];

// 管控措施选项
export const controlMeasureOptions = [
  { label: "全幅封闭", value: "全幅封闭" },
  { label: "半幅通行", value: "半幅通行" },
  { label: "限速", value: "限速" },
  { label: "告警阻拦", value: "告警阻拦" },
];

// 风险等级选项
export const riskLevelOptions = [
  { label: "一级", value: "一级" },
  { label: "二级", value: "二级" },
  { label: "三级", value: "三级" },
  { label: "四级", value: "四级" },
];

// 影响点类型选项
export const pointTypeOptions = [
  { label: "全部", value: "" },
  { label: "边坡", value: "slope" },
  { label: "桥梁", value: "bridge" },
  { label: "隧道", value: "tunnel" },
  { label: "路面", value: "road" },
];

// 影响点等级选项
export const pointLevelOptions = [
  { label: "全部", value: "" },
  { label: "一般隐患", value: "normal" },
  { label: "重大隐患", value: "serious" },
];

// 是否回应选项
export const isRespondedOptions = [
  { label: "全部", value: "" },
  { label: "是", value: "yes" },
  { label: "否", value: "no" },
];

// 预警等级选项
export const warningLevelOptions = [
  { label: "全部", value: "" },
  { label: "红色预警", value: "红色预警" },
  { label: "橙色预警", value: "橙色预警" },
  { label: "黄色预警", value: "黄色预警" },
  { label: "蓝色预警", value: "蓝色预警" },
];

// 是否结束选项
export const isEndedOptions = [
  { label: "全部", value: "" },
  { label: "是", value: true },
  { label: "否", value: false },
];

// 行政区域选项（带全部）
export const regionOptionsWithAll = [
  { label: "全部", value: "" },
  { label: "万州区", value: "wanzhou" },
  { label: "涪陵区", value: "fuling" },
  { label: "合川区", value: "hechuan" },
  { label: "万盛区", value: "wansheng" },
  { label: "长寿区", value: "changshou" },
  { label: "城口区", value: "chengkou" },
];

// 格式化日期时间为接口所需格式
export const formatDateTime = (date) => {
  if (!date) return "";
  const d = new Date(date);
  const year = d.getFullYear();
  const month = String(d.getMonth() + 1).padStart(2, "0");
  const day = String(d.getDate()).padStart(2, "0");
  const hours = String(d.getHours()).padStart(2, "0");
  const minutes = String(d.getMinutes()).padStart(2, "0");
  const seconds = String(d.getSeconds()).padStart(2, "0");
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
};

// 默认导出所有选项
export default {
  regionOptions,
  typeOptions,
  controlMeasureOptions,
  riskLevelOptions,
  pointTypeOptions,
  pointLevelOptions,
  isRespondedOptions,
  warningLevelOptions,
  isEndedOptions,
  regionOptionsWithAll,
  formatDateTime,
};