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

// 列表分页查询
export const planQueryByPage = (params) => {
  const url = `/assess/scheme/query/${params.pageNo}/${params.pageSize}`
  delete params.pageNo
  delete params.pageSize
  return axios({
    url: url,
    data: params,
    method: 'post'
  })
}
// 列表查询 (不带分页)
export const planQuery = (params) => {
  const url = `/assess/scheme/queryList`
  return axios({
    url: url,
    data: {},
    method: 'post'
  })
}
// 保存考评项目
export const planSave = (params) => {
  return axios({
    url: '/assess/scheme/save',
    data: params,
    method: 'post'
  })
}
// 删除
export const planDelete = (params) => {
  return axios({
    url: `/assess/scheme/delete/${params.id}`,
    data: {},
    method: 'get'
  })
}
// 启禁用
export const planEnable = (params) => {
  return axios({
    url: `/assess/scheme/enable/${params.id}/${params.status}`,
    data: {},
    method: 'get'
  })
}
// 考评方案详情
export const planDetail = (params) => {
  return axios({
    url: `/assess/scheme/find/${params.id}`,
    data: {},
    method: 'get'
  })
}
/**
 * 为考评方案选择项目
 */
// 考评方案包含项目查询
export const planItemQuery = (params) => {
  return axios({
    url: `/assess/scheme/item/query`,
    data: params,
    method: 'post'
  })
}
// 保存考评方案项目
export const planItemSave = (params) => {
  return axios({
    url: `/assess/scheme/item/save`,
    data: params,
    method: 'post'
  })
}
/**
 * 设置默认方案
 */
// 默认考评配置查询
export const planDefaultQuery = (params) => {
  return axios({
    url: `/assess/default/query`,
    data: {},
    method: 'post'
  })
}
// 保存默认考评配置
export const planDefaultSave = (params) => {
  return axios({
    url: `/assess/default/save`,
    data: params,
    method: 'post'
  })
}
