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


// 我的发起的流程
export function myProcessList(query) {
  return defHttp.get({
    url: '/flowable/task/myProcess',
    params: query
  })
}

export function flowFormData(query) {
  return defHttp.get({
    url: '/flowable/task/flowFormData',
    params: query
  })
}

export function flowTaskInfo(query) {
  return defHttp.get({
    url: '/flowable/task/flowTaskInfo',
    params: query
  })
}

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

// 取消申请
export function stopProcess(data) {
  return defHttp.post({
    url: '/flowable/task/stopProcess',
    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 deployStart(deployId) {
  return defHttp.get({
    url: '/flowable/process/startFlow/' + deployId,
  })
}

// 查询流程定义详细
export function getDeployment(id) {
  return defHttp.get({
    url: '/system/deployment/' + 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/' + id,
  })
}

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