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

// 获得门店和服务区的树选择
export async function handleGetSPRegionShopTree(params?: any) {
    const data = await request('/BaseInfo/GetSPRegionShopTree', {
        method: 'GET',
        params
    })

    if (data.Result_Code !== 100) {
        return []
    }

    const treeTable = wrapTreeNode(data.Result_Data.List);
    return [...treeTable];
}


// 获取经营单位账号列表
export async function handleGetUserList(params?: any) {
    const data = await request('/BusinessMan/GetUserList', {
        method: 'POST',
        data: params
    })

    if (data.Result_Code !== 100) {
        return []
    }

    const treeTable = wrapTreeNode(data.Result_Data.List);
    return [...treeTable];
}