/*
 * @Author: zzy 411037547@qq.com
 * @Date: 2024-03-07 11:00:52
 * @LastEditors: zzy 411037547@qq.com
 * @LastEditTime: 2024-03-07 11:39:26
 * @FilePath: \cloud-platform\src\pages\reports\BusinessAnalysis\RevenueReport\service.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request';
import { wrapTreeNode } from '@/utils/format';
import type { RevenueStatisticsParams } from './data';
// import type { ModuleItem } from './data';


// 查询服务区经营数据
export async function getRevenueReport(params: RevenueStatisticsParams) {
    const data = await request('/Revenue/GetRevenueReport', {
        method: 'GET',
        params
    })

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

    const treeTable = wrapTreeNode(data.Result_Data.List);
    return { data: treeTable, otherData: data.Result_Data.OtherData, success: true };
}
