import request from '@/utils/request'
export function getAllSites() {
	return request({
		url: '/ems/homePage/getAllSites',
		method: 'get'
	})
}

//获取BMS总览数据
export function getBMSOverView(data) {
	return request({
		url: `/ems/siteMonitor/getBMSOverView`, //?siteId=${siteId}
		method: 'get',
		data
	})
}

//获取BMS电池簇总览数据
export function getBMSBatteryCluster(data) {
	return request({
		url: `/ems/siteMonitor/getBMSBatteryCluster`, //?siteId=${siteId}
		method: 'get',
		data
	})
}

//获取电表数据
export function getAmmeterDataList(data) {
	return request({
		url: `/ems/siteMonitor/getAmmeterDataList`, //?siteId=${siteId}
		method: 'get',
		data
	})
}

//获取所有设备
export function getDeviceList(siteId) {
	return request({
		url: `/ems/siteConfig/getDeviceList?siteId=${siteId}`,
		method: 'get'
	})
}

//获取pcs头部的设备信息
export function getRunningHeadInfo(data) {
	return request({
		url: `/ems/siteMonitor/runningHeadInfo`, //?siteId=${siteId}
		method: 'get',
		data
	})
}
//获取pcs列表
export function getPcsDetailInfo(data) {
	return request({
		url: `/ems/siteMonitor/getPcsDetailInfo`, //?siteId=${siteId}
		method: 'get',
		data
	})
}

//获取pcs名称列表
export function getPcsNameList(siteId) {
	return request({
		url: `/ems/siteMonitor/getPcsNameList?siteId=${siteId}`,
		method: 'get'
	})
}

//获取单体电池 电池堆列表数据
export function getStackNameList(siteId) {
	return request({
		url: `/ems/siteMonitor/getStackNameList?siteId=${siteId}`,
		method: 'get'
	})
}
//获取单体电池 电池簇列表数据
export function getClusterNameList({ stackDeviceId, siteId }) {
	return request({
		url: `/ems/siteMonitor/getClusterNameList?stackDeviceId=${stackDeviceId}&siteId=${siteId}`,
		method: 'get'
	})
}
//单体电池表格数据
export function getClusterDataInfoList({ siteId, stackDeviceId, clusterDeviceId, batteryId, pageSize, pageNum }) {
	return request({
		url: `/ems/siteMonitor/getClusterDataInfoList?clusterDeviceId=${clusterDeviceId}&siteId=${siteId}&stackDeviceId=${stackDeviceId}&batteryId=${batteryId}&pageSize=${pageSize}&pageNum=${pageNum}`,
		method: 'get'
	})
}
// 单体电池图表
export function getSingleBatteryData({ siteId, deviceId, clusterDeviceId, startDate, endDate }) {
	return request({
		url: `/ems/siteMonitor/getSingleBatteryData?siteId=${siteId}&deviceId=${deviceId}&startDate=${startDate}&endDate=${endDate}&clusterDeviceId=${clusterDeviceId}`,
		method: 'get'
	})
}

//获取单个站点的基本信息
export function getSingleSiteBaseInfo(data) {
	return request({
		url: `/ems/siteMap/getSingleSiteBaseInfo`, //?siteId=${siteId}`,
		method: 'get',
		data
	})
}

//单站监控 首页 总累计运行数据（基于日表）
export function getDzjkHomeTotalView(siteId) {
	return request({
		url: `/ems/siteMonitor/homeTotalView?siteId=${siteId}`,
		method: 'get'
	})
}

// 单站监控项目展示数据（字段配置 + 最新值）
export function getProjectDisplayData(siteId) {
	return request({
		url: `/ems/siteMonitor/getProjectDisplayData?siteId=${siteId}`,
		method: 'get'
	})
}

// 电价报表（收益数据）
export function getAmmeterRevenueData(params) {
	return request({
		url: `/ems/statsReport/getAmmeterRevenueData`,
		method: 'get',
		params
	})
}

// 一周冲放曲线
export function getSevenChargeData(data) {
	return request({
		url: `/ems/siteMap/getSevenChargeData`, //?siteId=${siteId}&startDate=${startDate}&endDate=${endDate}`,
		method: 'get',
		data
	})
}

//单站监控 首页 当日功率曲线
export function getPointData(data) {
	return request({
		url: `/ems/siteMonitor/getPointData`,
		method: 'get',
		data
	})
}

// 点位配置-曲线数据（与管理端一致）
export function getPointConfigCurve(data) {
	return request({
		url: `/ems/pointConfig/curve`,
		method: 'post',
		data,
		headers: {
			repeatSubmit: false
		}
	})
}

// 获取站点包含的设备种类 用来判断单站监控设备监控的菜单栏展示
export function getSiteAllDeviceCategory(data) {
	return request({
		url: `/ems/siteConfig/getSiteAllDeviceCategory`,
		method: 'get',
		data
	})
}
