import request from "@/utils/request.js";

/*三维设备监控中心*/
export function getBuildingEquipmentMonitoringList(query) {
    return request({
        url: '/buildingEquipmentMonitoring/info/generateDeviceData',
        method: 'get',
        params: query
    })
}
/*二维组态图管理*/
export function getBuildingEquipmentMonitoringConfigurationList(query) {
    return request({
        url: '/buildingEquipmentMonitoring/info/generateDeviceConfigurationData',
        method: 'get',
        params: query
    })
}

/*区域设备分析台*/
export function getBuildingEquipmentMonitoringAreaList(query) {
    return request({
        url: '/buildingEquipmentMonitoring/info/generateAreaData',
        method: 'get',
        params: query
    })
}
// 获取区域统计数据
export function getAreaStats() {
    return request({
        url: '/buildingEquipmentMonitoring/info/getAreaStats',
        method: 'get'
    })
}

/*区域设备分析台*/
// 获取控制指令列表
export function getBuildingEquipmentMonitoringCommandsList(params) {
    return request({
        url: '/buildingEquipmentMonitoring/info/generateCommandsData',
        method: 'get',
        params
    })
}

// 获取指令统计数据
export function getCommandStats() {
    return request({
        url: '/buildingEquipmentMonitoring/info/getCommandStats',
        method: 'get'
    })
}

// 重试指令
export function retryCommand(cmdId) {
    return request({
        url: `/buildingEquipmentMonitoring/info/retryCommand/${cmdId}`,
        method: 'post'
    })
}

// 取消指令
export function cancelCommand(cmdId) {
    return request({
        url: `/buildingEquipmentMonitoring/info/cancelCommand/${cmdId}`,
        method: 'post'
    })
}

// 导出指令数据
export function exportCommands(params) {
    return request({
        url: '/buildingEquipmentMonitoring/info/exportCommands',
        method: 'get',
        params,
        responseType: 'blob'
    })
}
