import http from '@/utils/request'

// 通道组接口
export function apiChannelGroup (url, { data: params }) {
  return http.post(`/admin/checkerChannelGroup/${url}`, { data: params })
}

// 通道接口
export function apiChannel (url, { data: params }) {
  return http.post(`/admin/checkerChannel/${url}`, { data: params })
}
// 获取检票机类型
export function getDeviceTypeList () {
  return http.post('/admin/checker/getCheckTypeList')
}

// 获取检票机列表
export function getDeviceList (params) {
  return http.post('/admin/checker', { data: params })
}

// 修改检票设备信息·
export function updateDevice (params) {
  return http.post('/admin/checker/update', { data: params })
}

export function batchUpdateDeviceScene (params) {
  return http.post('/admin/checker/updateBatchScenic', { data: params })
}

// 检票机出入统计
export function getCheckerTrafficRecord (params) {
  return http.post('/admin/checker/getCheckerTrafficRecord', { data: params })
}

// 通道出入统计
export function getCheckerChannelTrafficRecord (params) {
  return http.post('/admin/checkerChannel/getCheckerChannelTrafficRecord', { data: params })
}

// 删除检票机
export function deleteChecker (id) {
  let params = {
    idList: [id]
  }
  return http.post('/admin/checker/delete', { data: params })
}

// IC卡列表
export function getIcCardList (params) {
  return http.post('/admin/card', { data: params })
}

// IC卡挂失
export function repealIcCard (params) {
  return http.post('/admin/card/repeal', { data: params })
}

// IC卡退卡
export function refundIcCard (params) {
  return http.post('/admin/card/back', { data: params })
}

// 团体列表
export function getTeamList (params) {
  return http.post('/admin/team', { data: params })
}

// 团体详情
export function getTeamDetail (id) {
  return http.post('/admin/team/detail', { data: { id } })
}

// 团体删除
export function deleteTeam (id) {
  return http.post('/admin/team/delete', { data: { idList: [id] } })
}

// 子项添加
export function addTeam (params) {
  return http.post('/admin/team/add', { data: params })
}

// 子项修改
export function updateTeam (params) {
  return http.post('/admin/team/update', { data: params })
}

// 导游列表
export function getGuideList (params) {
  return http.post('/admin/guide', { data: params })
}

// 导游详情
export function getGuideDetail (id) {
  return http.post('/admin/guide/detail', { data: { id } })
}

// 导游删除
export function deleteGuide (id) {
  return http.post('/admin/guide/delete', { data: { idList: [id] } })
}

// 导游添加
export function addGuide (params) {
  return http.post('/admin/guide/add', { data: params })
}

// 导游修改
export function updateGuide (params) {
  return http.post('/admin/guide/update', { data: params })
}

// 子项列表
export function getSubProjectList (params) {
  return http.post('/admin/subProject', { data: params })
}

// 子项详情
export function getSubProjectDetail (id) {
  return http.post('/admin/subProject/detail', { data: { id } })
}

// 子项删除
export function deleteSubProject (id) {
  return http.post('/admin/subProject/delete', { data: { idList: [id] } })
}

// 团体添加
export function addSubProject (params) {
  return http.post('/admin/subProject/add', { data: params })
}

// 团体修改
export function updateSubProject (params) {
  return http.post('/admin/subProject/update', { data: params })
}

// 查询某个统计的配置字段
export function getFiledByStatKey (params) {
  return http.post('/admin/statFieldConfig/getFiledByStatKey', { data: params })
}
