/**
 * 培训计划请求接口
 */
import request from '../index'
const prefix = '/meter'

// 导出培训计录列表
export function exportLogList(data: object) {
  return request({
    url: `${prefix}/train/log/listExport`,
    method: 'post',
    responseType: 'blob',
    data,
  })
}

// 导出培训计划列表
export function exportPlanList(data: object) {
  return request({
    url: `${prefix}/train/plan/listExport`,
    method: 'post',
    responseType: 'blob',
    data,
  })
}
// 列表查询
export function getPlanList(data: { offset: number; limit: number }) {
  return request({
    url: `${prefix}/train/plan/listPage?offset=${data.offset}&limit=${data.limit} `,
    method: 'post',
    data,
  })
}

// 审批列表查询
export function getapprovalList(data: { offset: number; limit: number }) {
  return request({
    url: `${prefix}/train/plan/approval/listPage?offset=${data.offset}&limit=${data.limit} `,
    method: 'post',
    data,
  })
}

// 培训计划审批删除
export function getApprovalDelete(data: object) {
  return request({
    url: `${prefix}/train/plan/approval/operate/delete`,
    method: 'post',
    data,
  })
}
// 主管部门
export function getDeptTree(params: object) {
  return request({
    url: '/sys/dept/tree',
    method: 'get',
    params,
  })
}

// 培训计划保存
export function getListSave(data: object) {
  return request({
    url: `${prefix}/train/plan/save`,
    method: 'post',
    data,
  })
}
// 培训计划保存后的提交
export function getListSubmit(data: object) {
  return request({
    url: `${prefix}/train/plan/submit`,
    method: 'post',
    data,
  })
}
// 培训计划详情
export function getListDetail(data: object) {
  return request({
    url: `${prefix}/train/plan/detail`,
    method: 'post',
    data,
  })
}
// 培训计划更新
export function getListUpdate(data: object) {
  return request({
    url: `${prefix}/train/plan/update`,
    method: 'post',
    data,
  })
}
// 培训计划删除
export function getListDelete(data: object) {
  return request({
    url: `${prefix}/train/plan/delete`,
    method: 'post',
    data,
  })
}

// 培训记录列表
export function getLogList(data: { offset: number; limit: number }) {
  return request({
    url: `${prefix}/train/log/listPage?offset=${data.offset}&limit=${data.limit} `,
    method: 'post',
    data,
  })
}

// 列表编号查询
export function getPlanIdList(data: object) {
  return request({
    url: `${prefix}/train/plan/list`,
    method: 'post',
    data,
  })
}

// 培训记录新建
export function getListLogAdd(data: object) {
  return request({
    url: `${prefix}/train/log/add`,
    method: 'post',
    data,
  })
}

// 培训记录修改
export function getListLogupdate(data: object) {
  return request({
    url: `${prefix}/train/log/update`,
    method: 'post',
    data,
  })
}

// 培训记录详情
export function getListLogDetail(data: object) {
  return request({
    url: `${prefix}/train/log/detail`,
    method: 'post',
    data,
  })
}
