import axios from 'axios';
|
import const_dcdc from '@/assets/js/const/const_dcdc';
|
export default {
|
/**
|
* 读取DCDC工作参数
|
*
|
* @param {[type]} data 参数
|
*
|
* @return {[type]} [return description]
|
*/
|
getDcDcWorkParams(data) {
|
// 设置命令
|
data.opCmd = const_dcdc.cmd.get;
|
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130DCDCParamAction!searchParam',
|
data: 'json=' + JSON.stringify(data),
|
});
|
},
|
/**
|
* 设置DCDC工作参数
|
*
|
* @param {[type]} data 参数
|
*
|
* @return {[type]} [return description]
|
*/
|
setDcDcWorkParams(data) {
|
// 设置命令
|
data.opCmd = const_dcdc.cmd.set;
|
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130DCDCParamAction!updateParam',
|
data: 'json=' + JSON.stringify(data),
|
});
|
},
|
/**
|
* 读取DCDC内部数据
|
*
|
* @param {[type]} data [data description]
|
*
|
* @return {[type]} [return description]
|
*/
|
getDcDcInsideParams(data) {
|
// 设置命令
|
data.opCmd = const_dcdc.cmd.inside;
|
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130DCDCDataAction!searchParam',
|
data: 'json=' + JSON.stringify(data),
|
});
|
},
|
/**
|
* 读取模拟量
|
*
|
* @param {Object} data 参数
|
*
|
* @return {[type]} [return description]
|
*/
|
getDcDcAnalogParams(data) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130BmsStateAction!searchParam',
|
data: 'json=' + JSON.stringify(data),
|
});
|
},
|
/**
|
* 读取告警量
|
*
|
* @param {[type]} data 参数
|
*
|
* @return {[type]} [return description]
|
*/
|
getDcDcWarnParams(data) {
|
// 设置命令
|
data.opCmd = const_dcdc.cmd.warn;
|
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130BmsAlmAction!searchParam',
|
data: 'json=' + JSON.stringify(data),
|
});
|
},
|
|
// 查询所有的放电计划
|
searchDcDcPlanAll(id) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130_setparam_planAction_action_serchByCondition',
|
data: 'json=' + JSON.stringify({
|
dev_id: id,
|
}),
|
});
|
},
|
// 添加充放电计划
|
addDcDcPlan(data) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130_setparam_planAction_action_add',
|
data: 'json=' + JSON.stringify([data]),
|
});
|
},
|
|
// 添加充放电计划
|
editDcDcPlan(data) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130_setparam_planAction_action_update',
|
data: 'json=' + JSON.stringify(data),
|
});
|
},
|
|
// 删除充放电计划
|
delDcDcPlan(data) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Li9130_setparam_planAction_action_del',
|
data: 'json=' + JSON.stringify(data),
|
});
|
},
|
|
// 查询所有模板
|
searchTplAll() {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'EleTmpAction!searchAll',
|
data: null,
|
});
|
},
|
// 添加模板
|
addTpl(tmp_name) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'EleTmpAction!add',
|
data: "json=" + JSON.stringify({
|
tmp_name,
|
}),
|
});
|
},
|
// 编辑模板
|
editTpl(tmp_id, tmp_name) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'EleTmpAction!update',
|
data: "json=" + JSON.stringify({
|
tmp_id,
|
tmp_name,
|
}),
|
});
|
},
|
// 删除模板
|
delTpl(tmp_id) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'EleTmpAction!del',
|
data: "json=" + JSON.stringify({
|
tmp_id,
|
}),
|
});
|
},
|
// 查询电价
|
searchElePrices(id) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'ElePriceAction!serchByCondition',
|
data: "json=" + JSON.stringify({
|
tmp_id: id
|
}),
|
});
|
},
|
// 更新电压
|
updatedElePrice(data) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'ElePriceAction!update',
|
data: "json=" + JSON.stringify(data),
|
});
|
},
|
/**
|
* 统计削峰填谷价格
|
* @param data
|
* @returns {AxiosPromise}
|
*/
|
getPeakPrice(data) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Peak_statisticsAction!serchByCondition',
|
data: "json=" + JSON.stringify(data),
|
})
|
},
|
restartDcDc(dev_id) {
|
// 请求后台查询内容
|
return axios({
|
method: 'post',
|
url: 'Fbs9100_setparamAction_action_restartDCDC',
|
data: "json=" + JSON.stringify({
|
op_cmd: 0x9A,
|
dev_id: dev_id,
|
}),
|
})
|
}
|
};
|