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


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

// 完成任务
export function complete(data) {
  return defHttp.post({
    url: '/flowable/task/complete',
    data: data
  })
}

// 委派任务
export function delegate(data) {
  return defHttp.post({
    url: '/flowable/task/delegate',
    data: data
  })
}

// 退回任务
export function returnTask(data) {
  return defHttp.post({
    url: '/flowable/task/return',
    data: data
  })
}

// 驳回任务
export function rejectTask(data) {
  return defHttp.post({
    url: '/flowable/task/reject',
    data: data
  })
}

// 可退回任务列表
export function returnList(data) {
  return defHttp.post({
    url: '/flowable/task/returnList',
    data: data
  })
}

// 下一节点
export function getNextFlowNode(data) {
  return defHttp.post({
    url: '/flowable/task/nextFlowNode',
    data: data
  })
}

// 下一节点
export function getNextFlowNodeByStart(data) {
  return defHttp.post({
    url: '/flowable/task/nextFlowNodeByStart',
    data: data
  })
}

// 部署流程实例
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) {
  return defHttp.delete({
    url: '/system/deployment',
    params: {id:id}
  })
}

// 导出流程定义
export function exportDeployment(query) {
  return defHttp.get({
    url: '/system/deployment/export',
    params: query
  })
}
// 流程节点表单
export function flowTaskForm(query) {
  return defHttp.get({
    url: '/flowable/task/flowTaskForm',
    params: query
  })
}


// 流程节点表单值
export function findFlowFormVal(query) {
  return defHttp.get({
    url: '/flowable/task/findFlowFormVal',
    params: query
  })
}


// 流程节点表单
export function getNextFlowNodeType(query) {
  return defHttp.get({
    url: '/flowable/task/getNextFlowNodeType',
    params: query
  })
}




