import { defHttp } from '/@/utils/http/axios';


// 查询已办任务列表
export function finishedList(query) {
  return defHttp.get({
    url: '/flowable/task/finishedList',
    params: query
  })
}

// 任务流转记录
export function flowRecord(query) {
  return defHttp.get({
    url: '/flowable/task/flowRecord',
    params: query
  })
}


// 部署流程实例
export function deployStart(deployId) {
  return defHttp.get({
    url: '/flowable/process/startFlow',
    params: {deployId:deployId}
  })
}

// 查询流程定义详细
export function getDeployment(id) {
  return defHttp.get({
    url: '/system/deployment',
    params: {id:id}
  })
}

// 新增流程定义
export function addDeployment(data) {
  return defHttp.post({
    url: '/system/deployment',
    data: data
  })
}

// 修改流程定义
export function updateDeployment(data) {
  return defHttp.post({
    url: '/system/deployment',
    data: data
  })
}

// 删除流程定义
export function delDeployment(id) {
  const params = {instanceId:id}
  return defHttp.delete({
    url: '/flowable/instance/delete',
    data:params},
    {joinParamsToUrl: true}
  )
}

// 导出流程定义
export function exportDeployment(query) {
  return defHttp.get({
    url: '/system/deployment/export',
    params: query
  })
}


// 撤回
export function revokeProcess(query) {
  return defHttp.get({
    url: '/system/deployment/revokeProcess',
    params: query
  })
}



