import { axios } from '@/utils/request'

export const listLookUp = params => {
  let url = `/lookup/queryLike`
  return axios({
    url: url,
    data: params,
    method: 'POST',
    headers:{
      'module': encodeURIComponent('字典列表查询')
    }
  })
}

export const saveLookUp = params => {
  return axios({
    url: '/lookup/save',
    data: params,
    method: 'post',
    headers:{
      'module': encodeURIComponent('新增/编辑')
    }
  })
}

export const delLookUp = params => {
  return axios({
    url: `/lookup/delete/${params.id}`,
    method: 'get',
    headers:{
      'module': encodeURIComponent('删除')
    }
  })
}

export const getLookUpItem = (params) => {
  let url = `/lookupItem/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('字典项列表查询')
    }
  })
}


export const delLookUpItem = params => {
  return axios({
    url: `/lookupItem/delete/${params.id}`,
    method: 'get',
    headers:{
        'module': encodeURIComponent('删除字典项')
    }
  })
}
export const saveLookUpItem = params => {
  return axios({
    url: '/lookupItem/save',
    data: params,
    method: 'post',
    headers:{
        'module': encodeURIComponent('添加/编辑字典项')
    }
  })
}
