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
|
});
|
};
|
|
export const uKeyLogin = (username, password, uKeyId) => {
|
return axios({
|
method: "post",
|
url: `LoginAction_login4UKey?uinf.UName=${username}&uinf.Upassword=${md5(password)}&uinf.UId=0&uinf.UKey_ID=${uKeyId}`,
|
data: null
|
});
|
};
|
|
/**
|
* 根据手机号获取动态口令
|
* @param num 手机号
|
* @returns {AxiosPromise}
|
*/
|
export const getVerifyCode = (num) =>{
|
return axios({
|
method: "post",
|
url: "MessageAction!getDynamicPassword",
|
data: "json="+num
|
});
|
}
|
/**
|
* 使用手机号登录
|
* @param num
|
* @param code
|
* @returns {AxiosPromise}
|
*/
|
export const phoneVerifyCodeLogin = (num, code) => {
|
return axios({
|
method: "post",
|
url: "MessageAction!validateDynamicPassword",
|
data: "json="+JSON.stringify({
|
UMobilephone: num,
|
UNote: code
|
})
|
});
|
}
|
|
/**
|
* 检测后台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)
|
});
|
};
|
|
/**
|
* 更新地图上的机房
|
* @param params
|
* @returns {AxiosPromise}
|
*/
|
export const updateMapStation = (params) => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!update",
|
data: "json=" + JSON.stringify(params)
|
});
|
};
|
/* 设置站点名 无参*/
|
export const addMapHomeList = () => {
|
return axios({
|
method: "post",
|
url: "BattMap_informationAction!serchNotInBattMapByUid",
|
data: null
|
});
|
};
|
/**
|
* 设置地图的中心点坐标和地图显示的等级
|
* @param data 需要设置的参数
|
* @returns {AxiosPromise}
|
*/
|
export const setMapCenterPoint = (data) => {
|
return axios({
|
method: 'post',
|
url: 'Positiomap_usrAction!add',
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
|
/**
|
* 查询地图机房信息(结果中有机房的位置信息)
|
* 参数: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)
|
});
|
};
|
|
/**
|
* 查询站点信息
|
*/
|
export const searchStationHome = (params) => {
|
return axios({
|
method: "post",
|
url: "StationAction!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 delMapHome = (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)
|
});
|
};
|
|
/**
|
* 根据机房id获取定位信息
|
*
|
* @param {[type]} params 机房id
|
*
|
* @return {[type]} 查询结果
|
*/
|
export const searchAddressById = (params) => {
|
return axios({
|
method: 'post',
|
url: "BattMap_informationAction!searchAddressByStationId",
|
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),
|
});
|
};
|
|
export const searchMapHomeState = () => {
|
return axios({
|
method: "post",
|
url: 'BattMap_informationAction!findStationState',
|
data: null
|
});
|
};
|
|
/**
|
* 首页地图json数据配置 增加
|
* 参数: json={"province":"省","city":"市","distinct":"区","name":"json文件名称"}
|
*/
|
export const addMapOutlineAction = (data) => {
|
return axios({
|
method: "post",
|
url: "MapOutlineAction!add",
|
data: 'json=' + JSON.stringify(data),
|
});
|
};
|
|
/**
|
* 首页地图json数据配置 修改
|
* 参数: json={"province":"省","city":"市","distinct":"区","name":"json文件名称","status":0或1,"id":id}
|
*/
|
export const updateMapOutlineAction = (data) => {
|
return axios({
|
method: "post",
|
url: "MapOutlineAction!update",
|
data: 'json=' + JSON.stringify(data),
|
});
|
};
|
|
/**
|
* 首页地图json数据配置 地图设置激活
|
* 参数: json={"id":id}
|
*/
|
export const activeMapOutlineAction = (data) => {
|
return axios({
|
method: "post",
|
url: "MapOutlineAction!active",
|
data: 'json=' + JSON.stringify(data),
|
});
|
};
|
|
/**
|
* 首页地图json数据配置 查询单个
|
* 参数: json={"id":id}
|
*/
|
export const getMapOutlineAction = (data) => {
|
return axios({
|
method: "post",
|
url: "MapOutlineAction!get",
|
data: 'json=' + JSON.stringify(data),
|
});
|
};
|
|
/**
|
* 首页地图json数据配置 查询关联地图
|
* 参数: json={"id":id}
|
*/
|
export const getAllMapOutlineAction = (data) => {
|
return axios({
|
method: "post",
|
url: "MapOutlineAction!getAll",
|
data: 'json=' + JSON.stringify(data),
|
});
|
};
|
|
/**
|
* 查询所有告警信息
|
* 参数
|
*/
|
export const getAllRealAlarm = (data) => {
|
return axios({
|
method: "post",
|
url: "Battalarm_dataAction!getRealAlarm",
|
});
|
};
|
|
export const getRandomFromServer = () => {
|
return axios({
|
method: 'post',
|
url: 'LoginAction_getRandom'
|
});
|
};
|
|
export const loginSignVerity = (data) => {
|
return axios({
|
method: 'post',
|
url: 'LoginAction_verify',
|
data: 'json=' + JSON.stringify(data),
|
});
|
};
|
|
/**
|
* 查询维护员告警列表
|
*/
|
export const getTaskListWithFlag = (data) => {
|
return axios({
|
method: "post",
|
url: 'WorkAlarmAction!getTaskListWithFlag',
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 获取维护员告警列表
|
*/
|
export const searchAllByUserIdAndStatus = (data) => {
|
return axios({
|
method: "post",
|
url: 'UserWorkAction!searchAllByUserIdAndStatus',
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 根据站点查询相关人员
|
*/
|
export const getUserInfoByStationId = (data) => {
|
return axios({
|
method: "post",
|
url: `User_infAction!getUserInfoByStationId`,
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 确认指派任务订单
|
*/
|
export const dispatchTask = (data) => {
|
return axios({
|
method: "post",
|
url: `WorkAlarmAction!dispatchTask`,
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 开始处理更新状态
|
*/
|
export const searchStatusById = (data) => {
|
return axios({
|
method: "post",
|
url: `UserWorkAction!searchStatusById`,
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 更新告警处理
|
*/
|
export const updateUserWork = (data) => {
|
return axios({
|
method: "post",
|
url: `UserWorkAction!updateUserWork`,
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 文件上传
|
*/
|
export const uploadAlarmFile = (data) => {
|
return axios({
|
method: "post",
|
url: `MyFileAction!uploadAlarmFile`,
|
headers: {
|
"Content-Type": "multipart/form-data"
|
},
|
data: data
|
});
|
};
|
|
/**
|
* 查询告警处理详情
|
*/
|
export const serchByCondition = (data) => {
|
return axios({
|
method: "post",
|
url: `UserWorkAction!serchByCondition`,
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 删除文件
|
*/
|
export const deleteAlarmFile = (data) => {
|
return axios({
|
method: "post",
|
url: `MyFileAction!deleteAlarmFile`,
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|
|
/**
|
* 更新当前告警状态
|
*/
|
export const updateWorkAlarm = (data) => {
|
return axios({
|
method: "post",
|
url: `UserWorkAction!updateWorkAlarm`,
|
data: 'json=' + JSON.stringify(data)
|
});
|
};
|