import request from '@/utils/request'
import { PageType, StrAnyObj } from '@/typings'

// 查询待办任务分页
export function getToDoPageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.get('/flow/execute/todoPage', params)
}

// 查询已办任务历史记录
export function getDoneListApi(id: string): Promise<PageType<StrAnyObj>> {
  return request.get(`/flow/execute/doneList/${id}`)
}

// 查询已办任务历史记录（根据业务id）
export function doneListByBusinessId(id: string): Promise<PageType<StrAnyObj>> {
  return request.get(`/flow/execute/doneListByBusinessId/${id}`)
}

// 办理
export function handleApi(data: StrAnyObj): Promise<void> {
  return request.post(`/flow/execute/handle`, data)
}

// 查询已办任务分页
export function getDonePageApi(params: StrAnyObj): Promise<PageType<StrAnyObj>> {
  return request.get('/flow/execute/donePage', params)
}

// 查询已办任务历史记录
export function getDoneListTwoApi(id: string): Promise<PageType<StrAnyObj>> {
  return request.get(`/flow/execute/doneListByBusinessId/${id}`)
}
