import request from '@/utils/request'

/* 无data  文档编辑器中的文档及模版列表 */
export function pageDocument(data) {
  return request({
    url: '/document/list',
    method: 'post',
    data
  })
}

export function searchDocument(data) {
  return request({
    url: '/document/search',
    method: 'post',
    data
  })
}

//导出
export function exportDocument(data) {
  return request({
    url: '/document/export',
    method: 'post',
    data
  })
}


//导出
export function exportDemoDocument(data) {
  return request({
    url: '/document/demo',
    method: 'post',
    data
  })
}




export function updateDocument(data) {
  return request({
    url: '/document/edit',
    method: 'post',
    data
  })
}



export function createDocument(data) {
  return request({
    url: '/document/add',
    method: 'post',
    data
  })
}



export function getDocumentInfo(id) {
  return request({
    url: `/document/info/${id}`,
    method: 'get'
  })
}



export function deleteDocument(dcm_id) {
  return request({
    url: `/document/dele/${dcm_id}`,
    method: 'get'
  })
}





export function searchDocumentCategory(data) {
  return request({
    url: '/document/category/search',
    method: 'post',
    data
  })
}




export function createDocumentCategory(data) {
  return request({
    url: '/document/category/create',
    method: 'post',
    data
  })
}




export function updateDocumentCategory(data) {
  return request({
    url: '/document/category/update',
    method: 'post',
    data
  })
}




export function getDocumentCategoryInfo(data) {
  return request({
    url: '/document/category/info',
    method: 'post',
    data
  })
}




export function deleteDocumentCategory(id) {
  return request({
    url: `/document/category/delete/${id}`,
    method: 'get'
  })
}

/* 获取模版列表 */

export function searchList(data) {
  return request({
    url: '/template/searchList',
    method: 'post',
    data
  })
}

/* 获取文档列表 */

export function searchlistDoc(data) {
  return request({
    url: '/document/list',
    method: 'post',
    data
  })
}

/* 获取codeJson */

export function getInfoDCPPNO(productId) {
  return request({
    url: `/product/getInfoDCPPNO/${productId}`,
    method: 'get'
  })
}