import type { FinalParam, ResetParam } from '/#/api'
import { http } from '@/utils/http/axios'

/**
 * 获取审核列表
 * @returns
 */
export async function getFinalList(params: FinalParam) {
  const res = await http.request({
    url: `/flow/task/listfinal`,
    method: 'get',
    params,
  })

  const { data: { list, totalPage } } = res
  return {
    pageCount: totalPage,
    data: list,
  }
}

/**
 * 重置审批
 * @param params
 * @returns
 */
export async function resetApproval(params: ResetParam) {
  return http.request({
    url: `/flow/task/removeTask`,
    method: 'get',
    params,
  })
}
