import axios from "./axios";
|
import md5 from "js-md5";
|
|
/**
|
* 初始化连接池
|
* 无参
|
*/
|
export const initDBPool = () => {
|
return axios({
|
method: "post",
|
url: "LoginAction!initDBPool",
|
data: null
|
})
|
}
|
|
/**
|
* 登录系统
|
* 参数 "uinf.UName="+用户名+"&uinf.Upassword="+密码+"&uinf.UId="+是否记住密码(0,1)
|
* 密码需要使用hex_md5加密
|
*/
|
export const login = (username, password) => {
|
return axios({
|
method: "post",
|
url: `LoginAction_login?uinf.UName=${username}&uinf.Upassword=${md5(password)}&uinf.UId=0`,
|
data: null
|
})
|
}
|
|
/**
|
* 检测后台session
|
* 无参
|
*/
|
export const checkLoginSession = () => {
|
return axios({
|
method: "post",
|
url: "LoginAction!getSessionByString",
|
data: null
|
})
|
}
|
|
|
/**
|
* 查询省
|
* 无参
|
*/
|
export const searchProvince = () => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchAllStationName1",
|
data: null
|
})
|
}
|
|
|
/**
|
* 查询市
|
* 参数:json={"StationName1":"北京市"}
|
*/
|
export const searchCity = (params) => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchAllStationName2",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
/**
|
* 查询区县
|
* 参数:json = {"StationName1":"北京市","StationName2":"市辖区"}
|
*/
|
export const searchCounty = (params) => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchAllStationName5",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
/**
|
* 查询机房停电信息
|
* 无参
|
*/
|
export const searchPowerOff = () => {
|
return axios({
|
method: "post",
|
url: "BattPower_offAction!serchPowerOff",
|
data: null
|
})
|
}
|
|
|
/**
|
* 查询电池组健康率
|
* 无参
|
*/
|
export const searchBattGood = () => {
|
return axios({
|
method: "post",
|
url: "Battalarm_dataAction!serchGood",
|
data: null
|
})
|
}
|
|
/**
|
* 添加地图上的机房
|
* 参数:json={"StationName1":"", "StationName2":"", "StationName5":"","StationName3":""
|
* "Address":"","longitude":"","latitude":"","information":""}
|
*/
|
export const addMapStation = (params) => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!add",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
/* 设置站点名 无参*/
|
export const addMapSetdian = () => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!serchNotInBattMapByUid",
|
data: null
|
})
|
}
|
|
|
/**
|
* 查询地图机房信息(结果中有机房的位置信息)
|
* 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
|
*/
|
export const searchMapStation = (params) => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!serchStationName3",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
|
/**
|
* 查询机房信息
|
* 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
|
*/
|
export const searchStation = (params) => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchAllStationName",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
|
|
/**
|
* 查询电池组信息
|
* 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区","StationName3":"紫晶科技机房"}
|
*/
|
export const searchBattInfo = (params) => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchAllBattinf",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
|
//----------------------------
|
/**
|
* 查询已添加到地图的机房
|
* 参数:json={"adata":{"alm_cleared_type":0,"alm_id":1},"bplan":{"discharge_reason":3}}
|
*/
|
export const searchMap = () => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!searchUserManageStation",
|
data: "json=" + JSON.stringify({
|
adata: {
|
alm_cleared_type: 0,
|
alm_id: 1,
|
},
|
bplan: {
|
discharge_reason: 3,
|
}
|
})
|
})
|
}
|
|
|
/**
|
* 查询机房告警数,落后数和延时数
|
* 参数:result={"StationId":"42070218"}
|
*/
|
export const searchRooms = (params) => {
|
return axios({
|
method: "post",
|
url: "BattInfAction!serchByIdLow",
|
data: "result=" + JSON.stringify(params)
|
})
|
}
|
|
|
/**
|
* 删除地图上的机房
|
* 参数:json={"num":141,"StationId":"42070545",
|
* "StationName":"湖北省-武汉市-BTS-东西湖区-GDXG演示","StationName3":"",
|
* "Address":"湖北省-武汉市-东西湖区-公园南路","longitude":114.252963,"latitude":30.646197,"information":"",
|
* "FBSDeviceId":910000120}
|
*/
|
export const searchDeletRoom = (params) => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!del",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
/**
|
* 根据机房的id查询机房的经纬度
|
* 参数:json={"StationName1":"北京市","StationName2":"市辖区","StationName3":"紫晶科技机房","StationName5":"海淀区"}
|
*/
|
export const searchRoomLocation = (params) => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!serchAddressByStationName3",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
/**
|
* 设置地图默认显示的中心坐标
|
* 参数:json={"map_longitude":113.971219,"map_latitude":30.605035,"map_level":11}
|
*/
|
export const searchCoordinate = (params) => {
|
return axios({
|
method: "post",
|
url: "Positiomap_usrAction!add",
|
data: "json=" + JSON.stringify(params)
|
})
|
}
|
|
/**
|
* 获取地图的中心坐标并将地图移动该坐标
|
* 无参
|
*/
|
export const searchCoordinateMove = () => {
|
return axios({
|
method: "post",
|
url: "Positiomap_usrAction!serchByCondition",
|
data: null
|
})
|
}
|
|
|
/**
|
* 查询页面中的导航
|
* 无参
|
*/
|
export const addNavigation = () => {
|
return axios({
|
method: "post",
|
url: "CustompageAction!searchAll",
|
data: null
|
})
|
}
|
|
/**
|
* 查询电池告警率
|
* 无参
|
*/
|
export const searchAlarm = () => {
|
return axios({
|
method: "post",
|
url: "Battalarm_dataAction!serchAlm",
|
data: "bmd.binf.StationName="
|
});
|
}
|
|
/**
|
* 查询电池状态
|
* 无参
|
*/
|
export const searchBattState = () => {
|
return axios({
|
method: "post",
|
url: "Batt_rtstateAction!serchBattStateRate",
|
data: null
|
});
|
}
|
|
/**
|
* 检测当前用户是否在其他未知登录
|
* 无参
|
* @return 查询结果
|
*/
|
export const checkUserLogin = ()=>{
|
return axios({
|
method: "post",
|
url: "LoginAction_check",
|
data: null
|
});
|
}
|
|
/**
|
* 根据基站信息查询基站的告警和落后信息
|
* 参数: json={"StationId":"@机房编号","FBSDeviceId":"@设备id"}
|
*/
|
export const searchHomeNum = (data)=>{
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!multiAmount",
|
data: 'json='+JSON.stringify(data),
|
});
|
}
|