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


// 业务列表接口
export async function handleGetAPPROVALROUTEList(params?: any) {
  const data = await request(`/BusinessProcess/GetAPPROVALROUTEList`, {
    method: 'POST',
    data: params
  });
  if (data.Result_Code !== 100) {
    return {
      data: [],
      current: 1,
      pageSize: 10,
      total: 0,
      success: false
    }
  }
  return data.Result_Data.List;
}


// 新增业务接口
export async function handleSynchroAPPROVALROUTE(params?: any) {
  const data = await request(`/BusinessProcess/SynchroAPPROVALROUTE`, {
    method: 'POST',
    data: params
  });
  if (data.Result_Code !== 100) {
    return {
      data: [],
      current: 1,
      pageSize: 10,
      total: 0,
      success: false
    }
  }
  return data;
}

// 删除环节
export async function handleDeleteAPPROVALROUTE(params?: any) {
  const data = await request(`/BusinessProcess/DeleteAPPROVALROUTE`, {
    method: 'GET',
    params
  });
  if (data.Result_Code !== 100) {
    return {
      data: [],
      current: 1,
      pageSize: 10,
      total: 0,
      success: false
    }
  }
  return data;
}


// 获得用户列表
export async function handleGetUSERList(params?: any) {
  const data = await request(`/Platform/GetUSERList`, {
    method: 'POST',
    data: params
  });
  if (data.Result_Code !== 100) {
    return {
      data: [],
      current: 1,
      pageSize: 10,
      total: 0,
      success: false
    }
  }
  return data.Result_Data.List;
}
