/**
 * 事部件管理接口
 */
import request from '@/utils/request'

export function getCaseTypeDict() {
  return request({
    url: '/dict/code/eorc',
    method: 'get'
  })
}

export function getCaseTypeList() {
  return request({
    url: '/case/type/list',
    method: 'get'
  })
}

export function getCaseDetailType(params) {
  return request({
    url: '/case/typeDetail/listPage',
    method: 'get',
    params
  })
}

export function getCaseTypesTime(detailId) {
  return request({
    url: '/case/typesTime/listPage',
    method: 'get',
    params: {
      detailId: detailId
    }
  })
}

export function getMaxDetailCode(typeId) {
  return request({
    url: '/case/typeDetail/maxDetailCode',
    method: 'post',
    params: {
      id: typeId
    }
  })
}

export function addCaseDetailType(params) {
  return request({
    url: '/case/typeDetail/add',
    method: 'post',
    params
  })
}

export function addCaseTypesTime(data) {
  return request({
    url: '/case/typesTime/add',
    method: 'post',
    headers: { 'Content-Type': 'application/json' },
    data
  })
}

export function addBatchCaseTypesTime(params) {
  return request({
    url: '/case/typesTime/addBatch',
    method: 'post',
    params
  })
}

export function updateCaseDetailType(params) {
  return request({
    url: '/case/typeDetail/update',
    method: 'post',
    params
  })
}

export function updateCaseTypesTime(params) {
  return request({
    url: '/case/typesTime/update',
    method: 'post',
    params
  })
}

export function deleteCaseDetailType(ids) {
  return request({
    url: '/case/typeDetail/delete',
    method: 'get',
    params: {
      ids: ids
    }
  })
}

export function deleteCaseTypesTime(id) {
  return request({
    url: '/case/typesTime/delete',
    method: 'get',
    params: {
      id: id
    }
  })
}

