/**
 * 数据类型常量定义
 * 集中管理所有数据类型相关的常量，避免硬编码
 */

// 数据类型代码
export const DATA_TYPE = {
  // 餐饮油烟相关
  RESTAURANT_OIL: {
    OIL_SMOKE_EVENT: '10127',    // 餐饮油烟事件
    OIL_SMOKE_ALERT: '20102',    // 餐饮油烟告警
    RESTAURANT_FACILITY: '399',  // 餐饮企业
  },
  
  // 环卫行业相关
  ENVIRONMENT: {
    SANITATION_EVENT: '20201',   // 环卫事件
    SANITATION_ALERT: '20202',   // 环卫告警
    SANITATION_FACILITY: '499',  // 环卫设施
  },
  
  // 市政设施相关
  MUNICIPAL: {
    MUNICIPAL_EVENT: '20301',    // 市政设施事件
    MUNICIPAL_ALERT: '20302',    // 市政设施告警
    MUNICIPAL_FACILITY: '599',   // 市政设施
  },
  
  // 景观照明相关
  LANDSCAPE_LIGHTING: {
    LIGHTING_EVENT: '20401',     // 景观照明事件
    LIGHTING_ALERT: '20402',     // 景观照明告警
    LIGHTING_FACILITY: '699',    // 景观照明设施
  },
  
  // 执法管理相关
  LAW_ENFORCEMENT: {
    ENFORCEMENT_EVENT: '20501',  // 执法管理事件
    ENFORCEMENT_ALERT: '20502',  // 执法管理告警
    ENFORCEMENT_RECORD: '799',   // 执法记录
    
    // 细分执法管理页面
    PUNISHMENT: '20511',         // 行政处罚
    COORDINATION: '20512',       // 市区协同
    PATROL: '20513',             // 日常巡查
  },
  
  // 生活垃圾相关
  DOMESTIC_WASTE: {
    WASTE_EVENT: '20601',        // 生活垃圾事件
    WASTE_ALERT: '20602',        // 生活垃圾告警
    WASTE_FACILITY: '899',       // 生活垃圾设施
  },
  
  // 建筑垃圾相关
  CONSTRUCTION_WASTE: {
    CONSTRUCTION_EVENT: '20701', // 建筑垃圾事件
    CONSTRUCTION_ALERT: '20702', // 建筑垃圾告警
    CONSTRUCTION_SITE: '999',    // 建筑垃圾场所
  },
  
  // 市容秩序相关
  CITY_APPEARANCE: {
    APPEARANCE_EVENT: '20801',   // 市容秩序事件
    APPEARANCE_ALERT: '20802',   // 市容秩序告警
    APPEARANCE_RECORD: '1099',   // 市容秩序记录
  },
};

// 网格类型常量
export const GRID_TYPE = {
  // 餐饮油烟相关
  RESTAURANT_OIL: {
    OIL_SMOKE_EVENT: '02',       // 油烟事件网格类型
    RESTAURANT_FACILITY: '09',   // 餐饮企业网格类型
  },
  
  // 环卫行业相关
  ENVIRONMENT: {
    SANITATION_EVENT: '03',      // 环卫事件网格类型
    SANITATION_FACILITY: '10',   // 环卫设施网格类型
  },
  
  // 市政设施相关
  MUNICIPAL: {
    MUNICIPAL_EVENT: '04',       // 市政设施事件网格类型
    MUNICIPAL_FACILITY: '11',    // 市政设施网格类型
  },
  
  // 景观照明相关
  LANDSCAPE_LIGHTING: {
    LIGHTING_EVENT: '05',        // 景观照明事件网格类型
    LIGHTING_FACILITY: '12',     // 景观照明设施网格类型
  },
  
  // 执法管理相关
  LAW_ENFORCEMENT: {
    ENFORCEMENT_EVENT: '06',     // 执法管理事件网格类型
    ENFORCEMENT_RECORD: '13',    // 执法记录网格类型
  },
  
  // 生活垃圾相关
  DOMESTIC_WASTE: {
    WASTE_EVENT: '07',           // 生活垃圾事件网格类型
    WASTE_FACILITY: '14',        // 生活垃圾设施网格类型
  },
  
  // 建筑垃圾相关
  CONSTRUCTION_WASTE: {
    CONSTRUCTION_EVENT: '08',    // 建筑垃圾事件网格类型
    CONSTRUCTION_SITE: '15',     // 建筑垃圾场所网格类型
  },
  
  // 市容秩序相关
  CITY_APPEARANCE: {
    APPEARANCE_EVENT: '09',      // 市容秩序事件网格类型
    APPEARANCE_RECORD: '16',     // 市容秩序记录网格类型
  },
};

// 面板激活规则
export const PANEL_ACTIVATION = {
  // 哪些数据类型会激活左侧面板
  ACTIVATE_LEFT: [
    DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_ALERT,
    DATA_TYPE.RESTAURANT_OIL.RESTAURANT_FACILITY,
    DATA_TYPE.ENVIRONMENT.SANITATION_ALERT,
    DATA_TYPE.ENVIRONMENT.SANITATION_FACILITY,
    DATA_TYPE.MUNICIPAL.MUNICIPAL_ALERT,
    DATA_TYPE.MUNICIPAL.MUNICIPAL_FACILITY,
    DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_ALERT,
    DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_FACILITY,
    DATA_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_ALERT,
    DATA_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_RECORD,
    DATA_TYPE.DOMESTIC_WASTE.WASTE_ALERT,
    DATA_TYPE.DOMESTIC_WASTE.WASTE_FACILITY,
    DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_ALERT,
    DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_SITE,
    DATA_TYPE.CITY_APPEARANCE.APPEARANCE_ALERT,
    DATA_TYPE.CITY_APPEARANCE.APPEARANCE_RECORD,
  ],
  
  // 哪些数据类型会激活右侧面板
  ACTIVATE_RIGHT: [
    DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT,
    DATA_TYPE.ENVIRONMENT.SANITATION_EVENT,
    DATA_TYPE.MUNICIPAL.MUNICIPAL_EVENT,
    DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_EVENT,
    DATA_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_EVENT,
    DATA_TYPE.DOMESTIC_WASTE.WASTE_EVENT,
    DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_EVENT,
    DATA_TYPE.CITY_APPEARANCE.APPEARANCE_EVENT,
  ],
  
  // 哪些数据类型不改变激活状态
  PRESERVE_ACTIVE: [
    // 已移除，分配到ACTIVATE_LEFT
  ],
};

// 数据类型到网格类型的映射
export const DATA_TO_GRID_TYPE_MAP: Record<string, string> = {
  [DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT]: GRID_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT,
  [DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_ALERT]: GRID_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT, // 告警使用相同的网格类型
  [DATA_TYPE.RESTAURANT_OIL.RESTAURANT_FACILITY]: GRID_TYPE.RESTAURANT_OIL.RESTAURANT_FACILITY,
  
  [DATA_TYPE.ENVIRONMENT.SANITATION_EVENT]: GRID_TYPE.ENVIRONMENT.SANITATION_EVENT,
  [DATA_TYPE.ENVIRONMENT.SANITATION_ALERT]: GRID_TYPE.ENVIRONMENT.SANITATION_EVENT,
  [DATA_TYPE.ENVIRONMENT.SANITATION_FACILITY]: GRID_TYPE.ENVIRONMENT.SANITATION_FACILITY,
  
  [DATA_TYPE.MUNICIPAL.MUNICIPAL_EVENT]: GRID_TYPE.MUNICIPAL.MUNICIPAL_EVENT,
  [DATA_TYPE.MUNICIPAL.MUNICIPAL_ALERT]: GRID_TYPE.MUNICIPAL.MUNICIPAL_EVENT,
  [DATA_TYPE.MUNICIPAL.MUNICIPAL_FACILITY]: GRID_TYPE.MUNICIPAL.MUNICIPAL_FACILITY,
  
  [DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_EVENT]: GRID_TYPE.LANDSCAPE_LIGHTING.LIGHTING_EVENT,
  [DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_ALERT]: GRID_TYPE.LANDSCAPE_LIGHTING.LIGHTING_EVENT,
  [DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_FACILITY]: GRID_TYPE.LANDSCAPE_LIGHTING.LIGHTING_FACILITY,
  
  [DATA_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_EVENT]: GRID_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_EVENT,
  [DATA_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_ALERT]: GRID_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_EVENT,
  [DATA_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_RECORD]: GRID_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_RECORD,
  
  [DATA_TYPE.DOMESTIC_WASTE.WASTE_EVENT]: GRID_TYPE.DOMESTIC_WASTE.WASTE_EVENT,
  [DATA_TYPE.DOMESTIC_WASTE.WASTE_ALERT]: GRID_TYPE.DOMESTIC_WASTE.WASTE_EVENT,
  [DATA_TYPE.DOMESTIC_WASTE.WASTE_FACILITY]: GRID_TYPE.DOMESTIC_WASTE.WASTE_FACILITY,
  
  [DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_EVENT]: GRID_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_EVENT,
  [DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_ALERT]: GRID_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_EVENT,
  [DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_SITE]: GRID_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_SITE,
  
  [DATA_TYPE.CITY_APPEARANCE.APPEARANCE_EVENT]: GRID_TYPE.CITY_APPEARANCE.APPEARANCE_EVENT,
  [DATA_TYPE.CITY_APPEARANCE.APPEARANCE_ALERT]: GRID_TYPE.CITY_APPEARANCE.APPEARANCE_EVENT,
  [DATA_TYPE.CITY_APPEARANCE.APPEARANCE_RECORD]: GRID_TYPE.CITY_APPEARANCE.APPEARANCE_RECORD,
};

// 行业默认页面IDs
export const INDUSTRY_PAGE_IDS = {
  RESTAURANT_OIL: 'restaurantOil',
  ENVIRONMENT: 'environment',
  MUNICIPAL: 'municipal',
  LANDSCAPE_LIGHTING: 'landscapeLighting',
  LAW_ENFORCEMENT: 'lawEnforcement',
  LAW_ENFORCEMENT_PUNISHMENT: 'lawEnforcementPunishment',
  LAW_ENFORCEMENT_COORDINATION: 'lawEnforcementCoordination',
  LAW_ENFORCEMENT_PATROL: 'lawEnforcementPatrol',
  DOMESTIC_WASTE: 'domesticWaste',
  CONSTRUCTION_WASTE: 'constructionWaste',
  CITY_APPEARANCE: 'cityAppearance',
  // 新增视频监控相关页面
  VIDEO_KEY_AREAS: 'videoKeyAreas',
  VIDEO_BACK_STREETS: 'videoBackStreets',
  VIDEO_FARMERS_MARKET: 'videoFarmersMarket',
  VIDEO_SUBWAY_ENTRANCES: 'videoSubwayEntrances',
  // 整体概况页面
  OVERALL_SITUATION: 'overallSituation',
};

// 页面默认数据类型
export const PAGE_DEFAULT_DATA_TYPES: Record<string, string> = {
  'home': DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT,
  'restaurantOil': DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT,
  'environment': DATA_TYPE.ENVIRONMENT.SANITATION_EVENT,
  'municipal': DATA_TYPE.MUNICIPAL.MUNICIPAL_EVENT,
  'landscapeLighting': DATA_TYPE.LANDSCAPE_LIGHTING.LIGHTING_EVENT,
  'lawEnforcement': DATA_TYPE.LAW_ENFORCEMENT.ENFORCEMENT_EVENT,
  'lawEnforcementPunishment': DATA_TYPE.LAW_ENFORCEMENT.PUNISHMENT,
  'lawEnforcementCoordination': DATA_TYPE.LAW_ENFORCEMENT.COORDINATION,
  'lawEnforcementPatrol': DATA_TYPE.LAW_ENFORCEMENT.PATROL,
  'domesticWaste': DATA_TYPE.DOMESTIC_WASTE.WASTE_EVENT,
  'constructionWaste': DATA_TYPE.CONSTRUCTION_WASTE.CONSTRUCTION_EVENT,
  'cityAppearance': DATA_TYPE.CITY_APPEARANCE.APPEARANCE_EVENT,
  // 新增视频监控相关页面
  'videoKeyAreas': DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT, // 暂用餐饮油烟事件类型，后续需更新
  'videoBackStreets': DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT, // 暂用餐饮油烟事件类型，后续需更新
  'videoFarmersMarket': DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT, // 暂用餐饮油烟事件类型，后续需更新
  'videoSubwayEntrances': DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT, // 暂用餐饮油烟事件类型，后续需更新
  // 整体概况页面
  'overallSituation': DATA_TYPE.RESTAURANT_OIL.OIL_SMOKE_EVENT, // 暂用餐饮油烟事件类型，后续需更新
};

// 区域代码
export const REGION_CODES = {
  CHENGDU: '5101',
  // 其他常用区域代码
}; 