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 getNormalDrawing(query) {
  return request({
    url: baseUrl + '/business/drawing/drawingList',
    method: 'get',
    params: query
  })
}

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

// 根据文件名查询图纸会签列表
export function getListByName(query) {
  return request({
    url: baseUrl + '/business/drawing/getListByName',
    method: 'get',
    params: query
  })
}

// 电子图纸会签流程
export function saveDrawing(data) {
  return request({
    url: baseUrl + '/business/drawing/save',
    method: 'post',
    data: data
  })
}


export function getProcuctDrawing() {
  return request({
    url: baseUrl + '/business/drawing/getProcuctDrawing',
    method: 'get'
  })
}
// 查询电子图纸详细
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 addPersonalSeal(data) {
  return request({
    url: baseUrl + '/business/personalSeal',
    method: 'post',
    data: data
  })
}
// 新增公共章
export function addPublicSeal(data) {
  return request({
    url: baseUrl + '/business/publicSeal',
    method: 'post',
    data: data
  })
}

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

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

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

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

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