import request from './request'
//登录
export function wxLogin(params) {
	return new Promise((resolve, reject) => {
		request.post("/user/login", params).then(result => {
			resolve(result)
		}).catch(err => {
			reject(err)
		});
	})
}
//换电监控接口开始
//换电信息
export function swapInfo(params) {
	return request.post("/swap/swapInfo", params)
}
//已连接站控车辆列表
export function CarOnline() {
	return request.post("/vehicle/online")
}
//修改车牌号
export function EditPlate(params) {
	return request.post("/vehicle/editPlate", params)
}
//车辆上锁
export function Updatelock(params) {
	return request.post("/vehicle/lock", params)
}

//车辆解锁
export function Updateunlock(params) {
	return request.post("/vehicle/unlock", params)
}
//暂停恢复PLC
export function EditSwapplc(data) {
	return request.post("/swap/plc", data)
}
//开始换电
export function beginSwap(params) {
	return request.post("/swap/startSwap", params)
}
//设置选电模式(0自动、1手动)
export function setMode(params) {
	return request.post("/swap/setMode", params)
}
//急停中止
export function plcStop(params) {
	return request.post("/swap/plcStop", params)
}
//锁止屏蔽
export function EditforbidLock(data) {
	return request.post("/vehicle/forbidLock", data)
}
//换电监控接口结束

//故障告警
export function alarmList(data) {
	return request.post("/alarm/list", data)
}
// 处理告警
export function alarmDispose(data) {
	return request.post("/alarm/dispose", data)
}
//开始充电
export function startCharge(params) {
	return request.post(`/discharge/startCharge?chargerId=${params.chargerId}&sn=${params.sn}`)
}
//断电
export function stopCharge(params) {
	return request.post(`/discharge/stopCharge?chargerId=${params.chargerId}`)
}

// 获取充电机ID
export function getChargeCode() {
  return request.get('/device/getChargeCode')
}
// 充电记录列表
export function chargeList(data) {
  return request.post('/charge/list',data)
}
// 换电记录列表
export function swapList(data) {
  return request.post('/swapRecord/list',data)
}
//获取用户信息
export function getInfo(data) {
  return request.get('/user/info',data)
}
//车辆管理、基础数据
export function vehicleList(data) {
	return request.post('/vehicle/list',data)
}
//删除车辆、基础数据
export function delvehicle(data) {
	return request.post('/vehicle/del',data)
}
//添加车辆、基础数据
export function addvehicle(data) {
	return request.post('/vehicle/save',data)
}
//编辑车辆、基础数据
export function Editvehicle(data) {
	return request.post('/vehicle/edit',data)
}
//普通调仓
export function RuleChangestorage(data) {
	return request.post('/device/exchangeBattery',data)
}
//消防调仓
export function FireChangestorage(data) {
	return request.post('/device/fireProtection',data)
}
//消防告警
export function getwarnList(data) {
	return request.post("/alarm/toDayAlarm", data)
}
// 处理告警
export function getfireProtection(data) {
	return request.post("/device/fireProtection", data)
}
//首页数据概览
export function getoverview() {
	return request.post("/statistics/overview")
}
//云端同步时间获取
export function getSyncTime() {
	return request.post("/vehicle/getSyncTime")
}
//云端同步
export function getSync() {
	return request.post("/vehicle/sync")
}
//侧边栏消防告警数量
export function getToDayAlarm() {
	return request.post("/alarm/toDayAlarm")
}
//换电监控 车牌号刷新接口
export function getRefresh() {
	return request.post("/vehicle/refresh")
}
