import request from '@/utils/request'

/* 无data  文档编辑器中的文档及模版列表 */
export function pageDocument(data) {
  return request({
    url: '/document/pageDocument',
    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/update',
    method: 'post',
    data
  })
}



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



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



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





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(data) {
  return request({
    url: '/document/category/delete',
    method: 'post',
    data
  })
}

/* 获取模版列表 */

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

/* 获取文档列表 */

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


/* 导出pdf */

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

/* 新_word导出  document/htmlWordNew */

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


/* pdf转word */

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

/* 预览 */

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

/* 获取文档内容查询 - 问答对 */
export function queryDocumentContent(data) {
  return request({
    url: '/document/content/query',
    method: 'get',
    params: data
  })
}

/* 导出问答对到Excel */
export function exportQaToExcel(data) {
  return request({
    url: '/document/content/export_qa_to_excel/',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}