import request from '@/utils/request'

export const FIXED_JUMP_OPTIONS = [
  { label: '太古地产', value: '太古地产' },
  { label: '龙腾', value: '龙腾' }
]

export async function fetchLinkOptions() {
  const [campaignRes, channelRes] = await Promise.all([
    request.get('/api/campaign/list'),
    request.get('/api/channel/list')
  ])

  return {
    campaignOptions: (campaignRes.data || []).map(item => ({
      label: `${item.id} - ${item.name}`,
      value: item.id
    })),
    channelOptions: (channelRes.data || []).map(item => ({
      label: `${item.id} - ${item.subName || item.name || '-'}`,
      value: item.id
    }))
  }
}
