import { ServiceConfig } from '../hooks/useSpecialServices';
// 导入logo和标题资源
import logo1 from '@/assets/images/V-2504/url-logo-1.png';
import logo2 from '@/assets/images/V-2504/url-logo-2.png';
import logo3 from '@/assets/images/V-2504/url-logo-3.png';
import logo4 from '@/assets/images/V-2504/url-logo-4.png';
import logo5 from '@/assets/images/V-2504/url-logo-5.png';
import logo6 from '@/assets/images/V-2504/url-logo-6.png';
import logo7 from '@/assets/images/V-2504/url-logo-7.png';
import logo8 from '@/assets/images/V-2504/url-logo-8.png';

import title1 from '@/assets/images/V-2504/url-title-1.png';
import title2 from '@/assets/images/V-2504/url-title-2.png';
import title3 from '@/assets/images/V-2504/url-title-3.png';
import title4 from '@/assets/images/V-2504/url-title-4.png';
import title5 from '@/assets/images/V-2504/url-title-5.png';
import title6 from '@/assets/images/V-2504/url-title-6.png';
import title7 from '@/assets/images/V-2504/url-title-7.png';
import title8 from '@/assets/images/V-2504/url-title-8.png';

// 专项服务配置
export const SPECIAL_SERVICES: ServiceConfig[] = [
  {
    id: 'zhdd',
    logoSrc: logo1,
    titleSrc: title1,
    targetUrl: '',  // 将从API获取
    action: 'newTab',
    label: '指挥调度'
  },
  {
    id: 'zzcc',
    logoSrc: logo2,
    titleSrc: title2,
    targetUrl: '',  // 将从API获取
    action: 'refresh',
    label: '众智成城'
  },
  {
    id: 'cgtf',
    logoSrc: logo3,
    titleSrc: title3,
    targetUrl: '',  // 将从API获取
    action: 'newTab',
    label: '诚管24'
  },
  {
    id: 'tzzs',
    logoSrc: logo4,
    titleSrc: title4,
    targetUrl: '',  // 将从API获取
    action: 'newTab',
    label: '体征指数'
  },
  // {
  //   id: 'tzzs',
  //   logoSrc: logo4,
  //   titleSrc: title4,
  //   targetUrl: '',  // 将从API获取
  //   action: 'modal',
  //   modalKey: 'V2504DataBase',
  //   label: '体征指数'
  // },
  {
    id: 'wgjz',
    logoSrc: logo5,
    titleSrc: title5,
    targetUrl: '',  // 将从API获取
    action: 'newTab',
    label: '网格基座'
  },
  {
    id: 'zzcc_sjdz',
    logoSrc: logo6,
    titleSrc: title6,
    targetUrl: '',  // 将从API获取
    action: 'newTab',
    label: '数据底座'
  },
  // {
  //   id: 'zzcc_sjdz',
  //   logoSrc: logo6,
  //   titleSrc: title6,
  //   targetUrl: '',  // 将从API获取
  //   action: 'modal',
  //   modalKey: 'V2504DataBase',
  //   label: '数据底座'
  // },
  {
    id: 'zzcc_gz',
    logoSrc: logo7,
    titleSrc: title7,
    targetUrl: '',  // 将从API获取
    action: 'newTab',
    label: '感知治理'
  },
  {
    id: 'xxaq',
    logoSrc: logo8,
    titleSrc: title8,
    targetUrl: '',  // 将从API获取
    action: 'newTab',
    label: '信息安全'
  }
];

// 通过ID获取服务配置
export const getServiceConfigById = (id: string): ServiceConfig | undefined => {
  return SPECIAL_SERVICES.find(service => service.id === id);
};

// 根据服务ID和API返回的服务列表，更新服务配置的URL
export const updateServiceUrls = (
  serviceList: { id: string; linkUrl?: string }[]
): ServiceConfig[] => {
  return SPECIAL_SERVICES.map(service => {
    const apiService = serviceList.find(item => item.id === service.id);
    return {
      ...service,
      targetUrl: apiService?.linkUrl || ''
    };
  });
};

export default SPECIAL_SERVICES; 