import axios from '@/libs/axios.js';
// 根据字典code查询选项
export const getLookUpDatas = (params) => {
  const url = `lookupItem/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

export const listLookUp = (params) => {
  const url = `lookup/queryLike`
  return axios.request({
    url: url,
	data: params||{},
    method: 'POST'
  }).then(res => res)
}
 
// 查询最新版本信息
export const getSysVersion = (params) => {
  return axios.request({
    url: `sysVersion/getLatest`,
    method: 'post',
	data: {applyCode:'jgqp',versionType: params.versionType}
  }, true)
}
// 数据字典
export const getLookUpItem = (params) => {
  let url = `lookupItem/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios.request({
    url: url,
    data: params,
    method: 'post'
  })
}

// 查询省市区
export const getArea = (params) => {
  if(params.type == '2' || params.parentId){
    return axios.request({
      url: `area/queryList`,
      data: params,
      method: 'post'
    })
  }
}
// 获取省市区，兼容小程序数据
export const getAreaCgj = (params) => {
  if(params.type == '2' || params.parentId){
    return axios.request({
      url: `areaCgj/queryList`,
      data: params,
      method: 'post'
    })
  }
}