import { appservice } from '@/utils/apiService'

const baseUrl = '/api/dict-entries'

export function getList(params) {
  return appservice({
    url: `${baseUrl}`,
    method: 'get',
    params
  })
}

export function create(data) {
  return appservice({
    url: `${baseUrl}`,
    method: 'post',
    data
  })
}

export function update(id, data) {
  return appservice({
    url: `${baseUrl}/${id}`,
    method: 'put',
    data
  })
}

export function updateOrders(ids) {
  return appservice({
    url: `${baseUrl}/orders`,
    method: 'post',
    data: ids
  })
}

export function remove(id) {
  return appservice({
    url: `${baseUrl}/${id}`,
    method: 'delete'
  })
}

export function lookupByDict(params) {
  return appservice({
    url: `${baseUrl}/lookup/by-dict`,
    method: 'get',
    params
  })
}

export function getAuditFlowTypes() {
  return lookupByDict({ dictName: '审核流程' })
}

export function getJQJTypes() {
  return lookupByDict({ dictName: '架桥机类型' })
}

export function getYLCTypes() {
  return lookupByDict({ dictName: '运梁车类型' })
}

