whyczyk
2022-05-09 49a4938ad5b8feb2065d9e9ef74967cda23cc220
src/pages/monitoring/js/api.js
@@ -1,137 +1,117 @@
import axios from "@/assets/js/axios";
/**
 * 查询站点名  带stationId fbsdeviceId (含包机组过滤)
 * stationName1
 * stationName2
 * stationName5
 * BattInfAction!serchAllStationName   // 旧
 * 查询机房信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区"}
 */
export const getAllStations = (params) => {
export const searchStation = (params) => {
    return axios({
        method: 'GET',
        url: 'battInf/searchAllStationName',
        params
        method: "post",
        url: "BattInfAction!serchAllStationName",
        data: "json=" + JSON.stringify(params)
    })
}
/**
 * 根据机房id获取电池信息 机房下的电池组列表
 * stationId
 * BattInfAction!serchAllBattinf // 旧
 * 查询电池组信息
 * 参数:json = {"StationName1":"北京市","StationName2":"市辖区","StationName5":"海淀区","StationName3":"紫晶科技机房"}
 */
export const getBattList = (stationId) => {
export const searchBattInfo = (params) => {
    return axios({
        method: "GET",
        url: "battInf/findBattInfByStationId",
        params: {
            stationId
        }
    });
        method: "post",
        url: "BattInfAction!serchAllBattinf",
        data: "json=" + JSON.stringify(params)
    })
}
/**
 * 根据电池组ID查询电池组信息
 * BattInfAction!findByBattGroupId  // 旧
 * @param data
 * @returns {AxiosPromise}
 */
export const getBattGroupInfo = (battGroupId) => {
export const getBattGroupInfo = (params) => {
    return axios({
        method: 'GET',
        url: 'battInf/findByBattGroupId',
        params: {
            battGroupId
        }
    });
        method: 'post',
        url: 'BattInfAction!findByBattGroupId',
        data: 'bif.BattGroupId=' + params,
    })
}
/**
 * 查询电池告警参数
 * Dev_paramAction!serchParamById // 旧
 * {devId}
 * 参数:json={"dev_id":910000022}
 */
export const realTimeAlarm = (params) => {
    return axios({
        method: "GET",
        url: "Dev_paramAction/serchParamById",
        params
        method: "post",
        url: "Dev_paramAction!serchParamById",
        data: "json=" + JSON.stringify(params)
    })
}
/**
 * 根据设备id查询设备当前的开关状态
 * {devId}
 * Fbs9100_stateAction_action_serchContactorState // 旧
 * json={"dev_id":910000022}
 */
export const realTimePowerOff = (params) => {
    return axios({
        method: "GET",
        url: "Fbs9100_stateAction/serchContactorState",
        params
        method: "post",
        url: "Fbs9100_stateAction_action_serchContactorState",
        data: "json=" + JSON.stringify(params)
    })
}
/**
 * 根据电池组id查询该电池组中所有电池信息  (图表数据)
 * Batt_rtdataAction_serchByCondition // 旧
 * json={"BattGroupId":1005074}
 */
export const realTimeSearch = (params) => {
    return axios({
        method: "GET",
        url: "Batt_rtdataAction/serchByCondition",
        params
        method: "post",
        url: "Batt_rtdataAction_serchByCondition",
        data: "json=" + JSON.stringify(params)
    })
}
/**
 * 根据电池组id查询电池组实时组端信息
 * Batt_rtstateAction_serchByCondition // 旧
 * 参数:rtstate.battGroupId=1005074
 */
export const realTimeGroup = (battGroupId) => {
export const realTimeGroup = (params) => {
    return axios({
        method: "GET",
        url: "BattRtstate/serchByCondition",
        params: {
            battGroupId
        }
        method: "post",
        url: "Batt_rtstateAction_serchByCondition",
        data: "rtstate.battGroupId=" + params
    })
}
/**
 * 查询历史实时数据
 * JhStateAction_action_serchByCondition // 旧
 * {devId}
 * @param json:{"dev_id":618500002}
 * @returns {AxiosPromise}
 */
export const JhStateActionSerchByCondition = (params) => {
    // 查询后台
    return axios({
        method: "GET",
        url: "JhStateAction/serchByCondition",
        params
        method: "post",
        url: "JhStateAction_action_serchByCondition",
        data: "json=" + JSON.stringify(params)
    });
}
/**
 * Batt_param_lowAction_searchAll // 旧
 */
export const searchAll_lowAction = () => {
    return axios({
        method: "GET",
        url: "Batt_param_lowAction/searchAll"
        method: "post",
        url: "Batt_param_lowAction_searchAll",
        data: null
    });
}
export const searchBattresdata = (BattGroupId) => {
    return axios({
        method: "post",
        url: "Batt_rtdataAction!serchResById",
        data: "json=" + JSON.stringify({
            BattGroupId: BattGroupId,
        })
    });
}
/**
 * 查询内阻信息
 * Batt_rtdataAction!serchResById // 旧
 */
export const searchBattresdata = (battGroupId) => {
    return axios({
        method: "GET",
        url: "Batt_rtdataAction/serchResById",
        params: {
            battGroupId
        }
    });
}
/**
 * 获取充放电记录
 * Batttestdata_infAction_searchBattTestInfDataById // 旧
 * 参数:json={"num":910000119,"BattGroupId":1005129}
 * 返回结果说明:
 * test_type==3&&test_starttype==3?核容放电:监测放电
@@ -143,22 +123,22 @@
export const searchBattTestData = (params) => {
    return axios({
        method: "POST",
        url: "Batttestdata_infAction/searchBattTestInfDataById",
        params
        method: "post",
        url: "Batttestdata_infAction_searchBattTestInfDataById",
        data: "json=" + JSON.stringify(params)
    })
}
/**
 * 查询LD9测试数据列表
 * {battGroupId}
 * Ld9testdata_infAction_ld9action_searchInfList // 旧
 * Ld9testdata_infAction_ld9action_searchInfList
 * 参数:json={"BattGroupId":1005129}
 */
export const getLD9TestList = (params) => {
export const getLD9TestList = (data) => {
    return axios({
        method: "GET",
        url: "Ld9testdata_infAction/searchInfList",
        params
        method: "post",
        url: "Ld9testdata_infAction_ld9action_searchInfList",
        data: 'json=' + JSON.stringify(data)
    });
}
@@ -176,66 +156,60 @@
/**
 * 查询历史数据
 * BatttestdataAction!findhistory // 旧
 * {"battGroupId":1005129,"testRecordCount":"7"}
 * 参数: json={"BattGroupId":1005129,"test_record_count":"7"}
 */
export const searchHistory = (params) => {
    params.data_new = params.data_new ? params.data_new : 1000;
    return axios({
        method: "GET",
        url: "BatttestdataAction/findhistory",
        params
        method: "post",
        url: "BatttestdataAction!findhistory",
        data: "json=" + JSON.stringify(params)
    })
}
/**
 * 查询LD9 单体测试数据
 * Ld9testdataAction_ld9action_serchByCondition // 旧
 * {"battGroupId":1000061,"testRecordCount":39,"recordNum":3,"testMonNum":1}
 * Ld9testdataAction_ld9action_serchByCondition
 * 参数:json={"BattGroupId":1000061,"test_record_count":39,"record_num":3,"test_monnum":1}
 */
export const getLD9Testdata = (params) => {
export const getLD9Testdata = (data) => {
    return axios({
        method: "GET",
        url: "Ld9testdataAction/serchByCondition",
        params
        method: "post",
        url: "Ld9testdataAction_ld9action_serchByCondition",
        data: 'json=' + JSON.stringify(data)
    });
}
/**
 * 查询LD9测试组端数据
 * Ld9testdatastopAction_ld9action_serchByInfo // 旧
 * {"battGroupId":1000061,"testRecordCount":39,"record_num":3,"testMonNum":1}
 */
export const getLD9GrpTestdata = (params) => {
* 查询LD9测试组端数据
* Ld9testdatastopAction_ld9action_serchByInfo
* 参数:json={"BattGroupId":1000061,"test_record_count":39,"record_num":3,"test_monnum":1}
*/
export const getLD9GrpTestdata = (data) => {
    return axios({
        method: "GET",
        url: "Ld9testdatastopAction/serchByInfo",
        params
    });
}
/**
 * 查询LD9 一次测试中所有单体的实际容量
 * Ld9testdatastopAction_ld9action_serchByCondition // 旧
 * {"battGroupId":1000061,"testRecordCount":39}
 */
export const getLD9MonCaps = (params) => {
    return axios({
        method: "GET",
        url: "Ld9testdatastopAction/serchByCondition",
        params
        method: "post",
        url: "Ld9testdatastopAction_ld9action_serchByInfo",
        data: 'json=' + JSON.stringify(data)
    });
}
/**
 * 通过设备id查询LD9数据
 * {devId}
 * LD9_stateAction_ld9action_searchByDevId // 旧
 * @returns
 */
* 查询LD9 一次测试中所有单体的实际容量
* Ld9testdatastopAction_ld9action_serchByCondition
* 参数:json={"BattGroupId":1000061,"test_record_count":39}
*/
export const getLD9MonCaps = (data) => {
    return axios({
        method: "post",
        url: "Ld9testdatastopAction_ld9action_serchByCondition",
        data: 'json=' + JSON.stringify(data)
    });
}
export const realTimeLd9Data = (params) => {
    return axios({
        method: "GET",
        url: "LD9_stateAction/searchByDevId",
        params
        method: "post",
        url: "LD9_stateAction_ld9action_searchByDevId",
        data: "json=" + JSON.stringify(params)
    })
}