import axios from '@/utils/request'
const baseURL = import.meta.env.VITE_APP_BASE_PROCESS_API;
// 查询分页数据：
export const getprocessInstanceTaskPage = (arg) => {
  return axios.request({
    baseURL: baseURL,
    url: '/engine-rest/history/task',
    method: 'get',
    params: arg,
    dataType: 'json'
  })
}
// 查询详情数据：
export const getprocessInstanceTaskDetail = (arg) => {
  return axios.request({
    baseURL: baseURL,
    url: `/engine-rest/task/${arg.taskId}/identity-links`,
    method: 'get',
    dataType: 'json'
  })
}

// 添加数据：
export const addprocessInstanceTask = (arg) => {
  return axios.request({
    baseURL: baseURL,
    url: `/engine-rest/task/${arg.taskId}/identity-links`,
    method: 'post',
    data: arg,
    dataType: 'json'
  })
}

// 修改数据：
export const updateprocessInstanceTask = (arg) => {
  return axios.request({
    baseURL: baseURL,
    url: '/sys/processInstanceTask',
    method: 'put',
    data: arg,
    dataType: 'json'
  })
}

// 删除数据:
export const deleteprocessInstanceTask = (arg) => {
  return axios.request({
    baseURL: baseURL,
    url: `/engine-rest/task/${arg.taskId}/identity-links/delete`,
    method: 'post',
    data: arg,
    dataType: 'json'
  })
}


// 启动流程:
export const start = (arg) => {
  return axios.request({
    baseURL: baseURL,
    url: `/start`,
    method: 'post',
    data: arg,
    dataType: 'json'
  })
}