import axios from '@/common/services/axios-instance'

class FlowcenterService {
  // 获取工作台业务类型树
  getFrameWorktree(params) {
    return axios({
      url: `api/framework/v1/we-app-flow-center/businesstype-${params.label ? 'count-' : ''}tree`,
      method: 'get',
      params,
    })
  }

  // 草稿箱、废件箱删除
  fnDarftsDelete(params) {
    return axios({
      url: 'api/framework/v1/process-manager/process-instance/remove',
      method: 'post',
      data: params,
    })
  }

  // 废件箱恢复
  fnTrashResumeData(params) {
    return axios({
      url: 'api/framework/v1/flow-manage/flow/resume',
      method: 'post',
      data: params,
    })
  }

  // 批量阅毕
  saveBatch(keys) {
    return axios({
      url: `api/framework/v1/extra-task-process/batch-read?ids=${keys}`,
      method: 'get',
    })
  }

  // 获取沟通树
  getConnectTree(treeId) {
    return axios({
      url: 'api/flow-mobile/v1/communicatecontroller/communicate/gettrees?label=' + treeId,
      method: 'post',
    })
  }
}

export default new FlowcenterService()
