import axios from '@/utils/axios'

export default {
  /**
   * 获取专利列表
   */
  getPatentListV2(data) {
    return axios.post('/v2/patent/list', data);
  },
  /**
   * 获取专利两边的数据
   */
  getBetweenPatentList(data) {
    return axios.post('/v2/patent/between', data)
  },
  /**
   * 获取专利申请人列表
   */
  getPatentApplicantList(params) {
    return axios.get('/v2/patent/applicant/list', { params })
  },
  /**
   * 获取专利申请人（合并）列表
   */
  getPatentApplicantMergeList(params) {
    return axios.get('/v2/patent/applicant/merge/list', { params })
  },
  /**
   * 新增专利申请人
   */
  addPatentApplicant(data) {
    return axios.post('/v2/patent/applicant/add', data)
  },
  /**
   * 编辑专利申请人
   */
  editPatentApplicant(data) {
    return axios.post('/v2/patent/applicant/edit', data)
  },
  /**
   * 删除专利申请人
   */
  deletePatentApplicant(params) {
    return axios({
      url: '/v2/patent/applicant/delete',
      method: 'post',
      params: params
    })
  },
  /**
   * 删除专利申请人（合并）
   */
  deletePatentMergeApplicant(params) {
    return axios({
      url: '/v2/patent/applicant/merge/delete',
      method: 'post',
      params: params
    })
  },
  /**
   * 批量上传专利说明书
   */
  batchUploadPatentInstruction(params) {
    return axios({
      url: '/v2/patent/instruction/batch/upload',
      method: 'post',
      params: params
    })
  },
  /**
   * 编辑专利说明书
   */
  editPatentInstruction(data) {
    return axios.post('/v2/patent/instruction/edit', data)
  },
  /**
   * 专利说明书列表
   */
  getPatentInstructionList(params) {
    return axios.get('/v2/patent/instruction/list', { params })
  },
  /**
   * 专利阅读统计
   */
  getPatentReadTotal(params) {
    return axios.get('/v2/patent/read/total', { params })
  },
  /**
   * 获取专利查询字段源数据
   */
  getPatentQuerySource(params) {
    return axios.get('/v2/patent/query/field/source', { params })
  },
  /**
   * 专利导出
   */
  exportPatentList(data) {
    return axios.post('/v2/patent/export', data)
  },
  /**
   * 根据ID获取专利
   */
  getPatentById(id, params) {
    return axios.get('/v2/patent/' + id, { params })
  },
  /**
   * 设置专利已读未读
   */
  updatePatentReadStatus(data) {
    return axios({
      url: '/v2/patent/read/update',
      method: 'post',
      data: data,
      loading: false
    })
  },
  /**
   * 更新专利列表字段
   */
  updatePatentListField(data) {
    return axios.post('/v2/patent/list/field/update', data)
  },
  /**
   * 查询源
   */
  getPatentQuerySourceList(data) {
    return axios.post('/v2/patent/query/source', data)
  },
  /**
   * 保存专利检索条件
   */
  savePatentQueryCondition(data) {
    return axios.post('/v2/patent/query/condition', data)
  },
  /**
   * 批量标引
   */
  patentBatchIndex(data) {
    return axios.post('/v2/patent/batch/index', data)
  },
  /**
   * 更新标签
   */
  updatePatentLabel(data) {
    return axios.post('/v2/patent/label', data)
  },
  /**
   * 获取专利ID
   */
  getPatentListIds(data) {
    return axios.post('/v2/patent/ids', data)
  },
  /**
   * 获取标引情况
   */
  getPatentIndexSetting(params) {
    return axios.get('/v2/patent/index/setting', { params })
  },
  /**
   * 获取标引情况
   */
  getPatentIndexSetting2(params) {
    return axios.get('/v2/patent/index/setting/all', { params })
  },
  /**
   * 更新标引
   */
  updatePatentIndexSetting(data) {
    return axios.post('/v2/patent/index/setting', data)
  },
  /**
   * 专利关键词高亮模板
   */
  getPatentKeywordsHighlight(params) {
    return axios.get('/v2/patent/keywords/highlight/list', { params })
  },
  /**
   * 更新专利关键词高亮模板
   */
  updatePatentKeywordsHighlight(data) {
    return axios.post('/v2/patent/keywords/highlight/update', data)
  },
  /**
   * 新增专利关键词高亮模板
   */
  addDefaultPatentKeywordsHighlight(params) {
    return axios({
      url: '/v2/patent/keywords/highlight/default',
      method: 'post',
      params: params
    })
  },
  /**
   * 删除专利关键词高亮模板
   */
  deletePatentKeywordsHigh(params) {
    return axios({
      url: '/v2/patent/keywords/highlight/delete',
      method: 'post',
      params: params
    })
  },
  /**
   * 保存所选专利
   */
  saveSelectPatent(data) {
    return axios.post('/v2/patent/save/select', data)
  },
  /**
   * 上传专利附图
   */
  uploadPatentImage(data) {
    return axios.post('/v2/patent/image/add', data)
  },
  /**
   * 修改专利附图
   */
  editPatentImage(data) {
    return axios.post('/v2/patent/image/edit', data)
  },
  /**
   * 上传专利附图
   */
  deletePatentImage(params) {
    return axios({
      url: '/v2/patent/image/delete',
      method: 'post',
      params: params
    })
  },
  /**
   * 获取同族专利
   */
  getPatentFamilyList(params) {
    return axios.get('/v2/patent/family/list', { params })
  },
  /**
   * 专利注释
   */
  getPatentAnnotationList(params) {
    return axios.get('/v2/patent/annotation/list', { params })
  },
  /**
   * 更新专利注释
   */
  editPatentAnnotation(data) {
    return axios.post('/v2/patent/annotation/edit', data)
  },
  /**
   * 新增专利注释
   */
  addPatentAnnotation(data) {
    return axios.post('/v2/patent/annotation/add', data)
  },
  /**
   * 删除专利注释
   */
  deletePatentAnnotation(params) {
    return axios({
      url: '/v2/patent/annotation/delete',
      method: 'post',
      params: params
    })
  },
  /**
   * 根据专利号获取ID
   */
  getPatentIdByPatentNo(params) {
    return axios.get('/v2/patent/id', { params })
  },
  /**
   * 获取专利发明人列表
   */
  getPatentInventorList(params) {
    return axios.get('/v2/patent/inventor/list', { params })
  },
  /**
   * 新增专利发明人
   */
  addPatentInventor(data) {
    return axios.post('/v2/patent/inventor/add', data)
  },
  /**
   * 编辑专利发明人
   */
  editPatentInventor(data) {
    return axios.post('/v2/patent/inventor/edit', data)
  },
  /**
   * 删除专利发明人
   */
  deletePatentInventor(params) {
    return axios({
      url: '/v2/patent/inventor/delete',
      method: 'post',
      params: params
    })
  },
  /**
   * 获取说明书文件流
   */
  getPatentInstructionFile(params) {
    return axios({
      url: '/v2/patent/instruction/file',
      method: 'post',
      responseType: 'blob',
      params: params
    })
  },

  
  /**
   * 获取权要树
   */
  queryPatentRightTree(params) {
    return axios.get('/v2/patentRight/queryPatentRightTree', {params})
  },

   /**
   * 导出pdf首页
   */
   pdfFirstPage(params) {
    return axios.post('/v2/patent/instruction/pdfFirstPage', params)
  },

  /**
   * pdf首页列表
   */
  queryPatentPdfFirstPages(params) {
    return axios.post('/v2/patent/instruction/queryPatentPdfFirstPages', params)
  },

}
