import request from '@/utils/request'
const baseUrl = import.meta.env.VITE_APP_BASE_API

// 查询电子图纸列表
export function listDrawing(query) {
  return request({
   url: baseUrl +'/business/drawing/list',
    method: 'get',
    params: query
  })
}

// 查询图纸名
export function drawingByName(query) {
  return request({
   url: baseUrl +'/business/drawing/byName',
    method: 'get',
    params: query
  })
}
// 查询电子图纸详细
export function getDrawing(id) {
  return request({
   url: baseUrl +'/business/drawing/' + id,
    method: 'get'
  })
}

// 新增电子图纸
export function addDrawing(data) {
  return request({
   url: baseUrl +'/business/drawing',
    method: 'post',
    data: data
  })
}

// 修改电子图纸
export function updateDrawing(data) {
  return request({
   url: baseUrl +'/business/drawing',
    method: 'put',
    data: data
  })
}

// 删除电子图纸
export function delDrawing(id) {
  return request({
   url: baseUrl +'/business/drawing/' + id,
    method: 'delete'
  })
}
