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

// 列表分页查询
export const getItemListByPage = (params) => {
  const url = `/assess/item/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 列表查询 (不带分页)
export const getItemList = (params) => {
  const url = `/assess/item/queryList`
  return axios({
    url: url,
    data: {},
    method: 'post'
  })
}
// 保存考评项目
export const itemSave = (params) => {
  return axios({
    url: '/assess/item/save',
    data: params,
    method: 'post'
  })
}
// 考评项目启删除
export const itemDelete = (params) => {
  return axios({
    url: `/assess/item/delete/${params.id}`,
    data: {},
    method: 'get'
  })
}
// 考评项目启禁用
export const itemEnable = (params) => {
  return axios({
    url: `/assess/item/enable/${params.id}/${params.status}`,
    data: {},
    method: 'get'
  })
}
// 考评项目详情
export const itemDetail = (params) => {
  return axios({
    url: `/assess/item/find/${params.id}`,
    data: {},
    method: 'get'
  })
}
/**
 * 考评指标管理
 */
// 考评指标列表查询
export const itemIndexQuery = (params) => {
  return axios({
    url: `/assess/target/query`,
    data: params,
    method: 'post'
  })
}
// 考评指标删除
export const itemIndexDelete = (params) => {
  return axios({
    url: `/assess/target/delete/${params.id}`,
    data: {},
    method: 'get'
  })
}
// 考评指标详情
export const itemIndexDetail = (params) => {
  return axios({
    url: `/assess/target/find/${params.id}`,
    data: {},
    method: 'get'
  })
}
// 考评指标保存
export const itemIndexSave = (params) => {
  return axios({
    url: `/assess/target/save`,
    data: params,
    method: 'post'
  })
}
