import request from '@/utils/request';
import { wrapTreeNode } from '@/utils/format';


// 列表接口
export async function handleGetAuditTasksReport(params: any) {
    const data = await request('/Audit/GetAuditTasksReport', {
        method: 'GET',
        params
    })

    if (data.Result_Code !== 100) {
        return {
            data: [],
            otherData: '',
            current: 1,
            pageSize: 20,
            total: 0,
            success: true,
        };
    }
  return data.Result_Data.List
}


// 抽屉里面的详情接口
export async function handleGetAuditTasksDetail(params: any) {
  const data = await request('/Audit/GetAuditTasksDetailList', {
    method: 'GET',
    params
  })

  if (data.Result_Code !== 100) {
    return {
      data: [],
      otherData: '',
      current: 1,
      pageSize: 20,
      total: 0,
      success: true,
    };
  }
  return data.Result_Data.List
}


// 同步智能稽核任务主表
export async function handleSynchroAUDITTASKS(params?: any) {

  const data = await request(`/Audit/IssueAuditTasks`, {
    method: 'POST',
    data: params
  });

  if (data.Result_Code !== 100) {
    return {
      data: [],
      current: 1,
      pageSize: 10,
      total: 0,
      success: false
    }
  }
  return  data
}
