<template>
|
<div class="page-container" ref="page">
|
<el-row class="out-row" :gutter="16">
|
<el-col :span="4" style="height: 100%;">
|
<el-row :gutter="16">
|
<el-col :span="24" style="height: 100%;">
|
<box-all
|
title="充放电信息"
|
style="height: 100%;">
|
<div class="inner">
|
<test-list
|
:params="testParams"
|
@select-change="handlerTestList"></test-list>
|
<div class="p-footer">
|
<div class="btn_3d" :class="{'disabled': !selected}" @click="exportCsv">导出数据</div>
|
</div>
|
</div>
|
</box-all>
|
</el-col>
|
</el-row>
|
<el-row :gutter="16">
|
<el-col :span="24" style="height: 100%;">
|
<box-all
|
title="设备状态"
|
:style="getDiffStyle"
|
v-loading="rtstate.loading"
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
element-loading-text="数据加载中">
|
<div class="dev-states" v-show="showAbnormal">
|
<div class="dev-state-item">
|
突变起始时间: {{start_time}}
|
</div>
|
<div class="dev-state-item">
|
初始电流: {{start_curr}} A
|
</div>
|
<div class="dev-state-item">
|
结束电流: {{end_curr}} A
|
</div>
|
</div>
|
<div class="dev-states" v-show="!showAbnormal">
|
<div class="dev-state-item">
|
电池状态:{{getBattState}}
|
</div>
|
<div class="dev-state-item">
|
端电压:在线 {{rtstate.data.online_vol}}V,组端 {{rtstate.data.group_vol}}V
|
</div>
|
<div class="dev-state-item">
|
电池电流:{{rtstate.data.test_curr}}A
|
</div>
|
<div class="dev-state-item">
|
测试日期:{{rtstate.data.test_starttime}}
|
</div>
|
<div class="dev-state-item">
|
测试时长:{{getTestTimeLong}}
|
</div>
|
<div class="dev-state-item">
|
测试容量:{{rtstate.data.test_cap | fixed(1)}}AH
|
</div>
|
<!-- <div class="dev-state-item">
|
剩余容量:{{rtstate.data.batt_rest_cap}}AH
|
</div>
|
<div class="dev-state-item">
|
续航时长:{{rtstate.data.xuhang}}
|
</div> -->
|
</div>
|
</box-all>
|
</el-col>
|
</el-row>
|
</el-col>
|
<el-col :span="20" style="height: 100%; overflow: hidden;">
|
<div class="G-wraper" :class="{'show-abnormal': showAbnormal}">
|
<el-row :gutter="16">
|
<el-col :span="12" style="height: 100%;">
|
<!-- <div class="col-inner"> -->
|
<box-all
|
title="端电压折线图"
|
style="height: 100%;"
|
v-loading="loading"
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
element-loading-text="数据加载中">
|
<div class="graph">
|
<div class="graph-container" ref="groupLine"></div>
|
</div>
|
</box-all>
|
<!-- </div> -->
|
</el-col>
|
<el-col :span="12" style="height: 100%;">
|
<!-- <div class="col-inner"> -->
|
<box-all
|
title="单体信息柱状图"
|
style="height: 100%;"
|
v-loading="loading"
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
element-loading-text="数据加载中">
|
<div class="graph cut38">
|
<div class="graph-container" ref="monInfoBar"></div>
|
</div>
|
<div class="slider-container">
|
<el-slider
|
v-model="slider"
|
:format-tooltip="setDataBySlide"></el-slider>
|
</div>
|
</box-all>
|
<!-- </div> -->
|
</el-col>
|
</el-row>
|
<el-row :gutter="16">
|
<el-col :span="12" style="height: 100%;">
|
<!-- <div class="col-inner"> -->
|
<box-all
|
title="电池电流折线图"
|
:style="getDiffStyle"
|
v-loading="loading"
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
element-loading-text="数据加载中">
|
<div class="graph">
|
<div class="graph-container" ref="currLine"></div>
|
</div>
|
</box-all>
|
<!-- </div> -->
|
</el-col>
|
<el-col :span="12" style="height: 100%;">
|
<box-all
|
title="单体电压折线图"
|
:style="getDiffStyle"
|
v-loading="loading"
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
element-loading-text="数据加载中">
|
<div class="graph">
|
<div class="graph-container" ref="monLine"></div>
|
</div>
|
</box-all>
|
</el-col>
|
</el-row>
|
<el-row class="panel-abnormal" :gutter="16">
|
<el-col :span="24" style="height: 100%;">
|
<box-all
|
title="电池电流突变折线图"
|
:style="getDiffStyle"
|
v-loading="loading"
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
element-loading-text="数据加载中">
|
<div class="graph">
|
<div class="graph-container" ref="currAbnormalLine"></div>
|
</div>
|
</box-all>
|
</el-col>
|
</el-row>
|
</div>
|
</el-col>
|
</el-row>
|
<el-dialog
|
title="修改"
|
:visible.sync="settingsVisible"
|
width="26em"
|
class="dialog-bg">
|
<div class="D-content">
|
<el-form ref="form_settings" :model="settingsData" :rules="rules" label-position="left" label-width="14em">
|
<el-form-item label="霍尔量程" prop="clamp_range">
|
<el-input v-model="settingsData.clamp_range"><template slot="append">A</template></el-input>
|
</el-form-item>
|
<el-form-item label="电流变化阀值" prop="delta_limit">
|
<el-input v-model="settingsData.delta_limit"><template slot="append">A</template></el-input>
|
</el-form-item>
|
</el-form>
|
</div>
|
<span slot="footer" class="dialog-footer h-center">
|
<el-button type="primary" @click="settingsConfirm">确定</el-button>
|
<el-button @click="settingsVisible = false">取消</el-button>
|
</span>
|
</el-dialog>
|
<progress-load
|
:show="progress.show"
|
:percentage="progress.value"
|
:text="progress.text"></progress-load>
|
</div>
|
</template>
|
|
<script>
|
import echarts from 'echarts'
|
import BoxAll from '../components/BoxAll'
|
import TestList from '@/components/TestList'
|
import ProgressLoad from '@/components/ProgressLoad'
|
import {
|
formatSeconds,
|
EGraph,
|
} from '@/assets/js/common'
|
|
let currAbnormalLine;
|
var groupLine = "";
|
var currLine = "";
|
var monLine = "";
|
var monInfoBar = "";
|
var allData = [];
|
export default {
|
components: {
|
BoxAll,
|
TestList
|
,ProgressLoad
|
},
|
data() {
|
return {
|
settingsVisible: false,
|
battIdx: this.$route.query.idx || 0,
|
settingsData: {
|
clamp_range: 0,
|
delta_limit: 0
|
},
|
start_time: '',
|
start_curr: 0,
|
end_curr: 0,
|
showAbnormal: false,
|
selected: false,
|
exportObj: null,
|
progress: {
|
show: false,
|
value: 0,
|
text: '',
|
},
|
main: {
|
width: 100,
|
height: 100
|
},
|
testParams: {
|
num: '',
|
BattGroupId: '',
|
},
|
rtstate: {
|
loading: false,
|
stop_resean: '无', // 停止原因
|
data: {
|
test_type: 0,
|
online_vol: 0, // 在线电压
|
group_vol: 0, // 组端电压
|
test_curr: 0, // 电池电流
|
test_starttime: '1982-01-01 00:00:00', // 测试日期
|
test_timelong: 0, // 测试时长
|
test_cap: 0, // 测试容量
|
batt_rest_cap: 0, // 剩余容量
|
xuhang: '------', // 续航时间
|
}
|
},
|
loading: false,
|
slider: 100,
|
record_num: 0,
|
testData: { // 所有的测试数据
|
allData: [],
|
everyCount: [],
|
groupVol: [],
|
onlineVol: [],
|
testCurr: [],
|
testTime: []
|
},
|
rules: {
|
clamp_range: [{
|
validator: (rule, value, callback) => {
|
// console.log(value);
|
if (!('' + value).trim()) {
|
callback(new Error('量程值必填'));
|
}
|
if (/[^0-9]/.test(('' + value).trim())) {
|
callback(new Error('量程值必须为正整数'));
|
}
|
if (value < 0 || value > 50000) {
|
callback(new Error('量程值应介于0~50000之间'));
|
} else {
|
callback()
|
}
|
},
|
trigger: 'blur'
|
}]
|
,delta_limit: [{
|
validator: (rule, value, callback) => {
|
// console.log(value);
|
if (!('' + value).trim()) {
|
callback(new Error('阀值必填'));
|
}
|
if (!/^\d+(?:\.\d{1})?$/.test(('' + value).trim())) {
|
callback(new Error('阀值必须为数值,最多一位小数'));
|
}
|
if (value <= 10 || value > 5000) {
|
callback(new Error('阀值应介于10~5000之间'));
|
} else {
|
callback()
|
}
|
},
|
trigger: 'blur'
|
}]
|
}
|
}
|
},
|
watch: {
|
'$route.query.idx' () {
|
// 初始化页面
|
this.initPage();
|
}
|
},
|
filters: {
|
fixed(val, num) {
|
return Number(val.toFixed(num));
|
}
|
},
|
methods: {
|
getBatt: function() {
|
var batt = this.$store.state.battGroup;
|
if(batt.BattGroupId == undefined) {
|
return -1;
|
}else {
|
return batt;
|
}
|
},
|
initPage() {
|
// 设置测试数据列表
|
this.setTestParams();
|
// 初始化电池状体值
|
this.initRtState();
|
// 初始化testData
|
// this.testData = [];
|
// 查询电流突变数据
|
this.getAbnormalInfo();
|
},
|
initRtState() {
|
var data = {
|
test_type: 0,
|
online_vol: 0, // 在线电压
|
group_vol: 0, // 组端电压
|
test_curr: 0, // 电池电流
|
test_starttime: '1982-01-01 00:00:00', // 测试日期
|
test_timelong: 0, // 测试时长
|
test_cap: 0, // 测试容量
|
batt_rest_cap: 0, // 剩余容量
|
xuhang: '------', // 续航时间
|
};
|
this.rtstate.data = data;
|
// 初始化图表
|
this.initGraph();
|
},
|
initGraph() {
|
groupLine.clear();
|
monLine.clear();
|
currLine.clear();
|
monInfoBar.clear();
|
currAbnormalLine.clear();
|
allData=[];
|
},
|
setTestParams() {
|
var batt = this.getBatt();
|
if(batt != -1) {
|
this.testParams.num = batt.FBSDeviceId;
|
this.testParams.BattGroupId = batt.BattGroupId;
|
}
|
},
|
handlerTestList(data) {
|
// console.log(data, 'data');
|
if (data.abnormal) {
|
this.showAbnormal = true;
|
this.start_time = data.text;
|
this.start_curr = data.start_curr;
|
this.end_curr = data.end_curr;
|
// 查询电流突变数据
|
this.getAbnormalInfo(data.val);
|
} else {
|
this.showAbnormal = false;
|
// 设置终止原因
|
this.rtstate.stop_resean = data.stop;
|
// 初始化电池状体值
|
this.initRtState();
|
// 查询历史信息
|
this.searchHistory(data);
|
}
|
this.selected = true;
|
this.exportObj = data;
|
}
|
// 查询电流突变数据
|
,getAbnormalInfo (id) {
|
// BattcurrdataAction!serchByCondition
|
// 根据设备id和test_record_count查询突变情况实时数据
|
// 参数 json:{"BattGroupId":"10000004","test_record_count":"1"}
|
// test_record_count哪一次
|
let params = {
|
BattGroupId: this.$store.state.battGroup.BattGroupId
|
,test_record_count: id
|
};
|
// 显示等待框
|
this.loading = true;
|
// 请求后台查询
|
this.$axios({
|
method: 'post',
|
url: 'BattcurrdataAction!serchByCondition',
|
data: 'json=' + JSON.stringify(params)
|
}).then((res)=> {
|
res = JSON.parse(res.data.result);
|
// console.log(res.data);
|
let times = [];
|
let datalist = [];
|
if (res.code) {
|
res.data.forEach((v) => {
|
times.push(v.record_time);
|
datalist.push(v.group_curr);
|
});
|
// console.log(times, datalist);
|
this.setCurrAbnormalInfo(times, datalist);
|
}
|
|
// 关闭等待框
|
this.loading=false;
|
}).catch(()=>{
|
// 关闭等待框
|
this.loading=false;
|
});
|
|
}
|
,searchHistory(data) {
|
var batt = this.getBatt();
|
var searchParams = {
|
BattGroupId: batt.BattGroupId,
|
test_record_count: data.val
|
};
|
// 显示等待框
|
this.loading=true;
|
// 请求后台查询
|
this.$axios({
|
method: 'post',
|
url: 'BatttestdataAction!findhistory',
|
data: 'json='+JSON.stringify(searchParams)
|
}).then((res)=> {
|
var rs = JSON.parse(res.data.result);
|
if(rs.code == 1) {
|
var data = rs.data;
|
this.formatAlldata(data);
|
}else {
|
this.formatAlldata([]);
|
}
|
// 关闭等待框
|
this.loading=false;
|
}).catch(()=>{
|
// 关闭等待框
|
this.loading=false;
|
});
|
},
|
formatAlldata(data) {
|
allData = data;
|
var monNums = this.getMonNums(); // 获取单体编号
|
var groupVol = []; // 组端电压
|
var onlineVol = []; // 组端电流
|
var testCurr = []; // 测试电流
|
var testTime = []; // 测试时间
|
var everyCount = []; // 每次测试的状态数据
|
var batt_test_data = []; // 电池单体测试数据
|
var batt_test_voldata = []; // 电池单体电压折线图
|
var batt_test_tmpdata = []; // 电池单体温度折线图
|
var test_record_num = -1;
|
var start_record_num = -1;
|
var batt_index = -1;
|
|
// data长度不为0
|
if(data.length != 0) {
|
start_record_num = data[0].record_num;
|
}
|
for(var k=0;k<monNums.length;k++){
|
batt_test_voldata[k] = new Array();
|
batt_test_tmpdata[k] = new Array();
|
}
|
// 遍历数据并进行处理
|
for(var i=0; i<data.length; i++) {
|
var _data = data[i];
|
if(_data.record_num != test_record_num){
|
test_record_num = _data.record_num; // 设置记录的num
|
groupVol.push(_data.group_vol.toFixed(2)); //组端电压
|
onlineVol.push(_data.online_vol.toFixed(2)); //在线电压
|
testCurr.push(_data.test_curr.toFixed(1)); //组端电流
|
testTime.push(formatSeconds(_data.test_timelong)); // 测试时间
|
everyCount.push(_data); // 每次记录的状态数据
|
// 设置电池单体数据容器
|
batt_test_data[++batt_index] = new Array();
|
if(test_record_num > start_record_num){
|
batt_test_data[batt_index]=batt_test_data[batt_index-1].slice(0);
|
this.setArrayvalue(batt_test_voldata,batt_index);
|
this.setArrayvalue(batt_test_tmpdata,batt_index);
|
}
|
}
|
// 设置单体数据
|
batt_test_data[batt_index][_data.mon_num-1] = _data.mon_vol;
|
batt_test_voldata[_data.mon_num-1][batt_index] = _data.mon_vol;
|
batt_test_tmpdata[_data.mon_num-1][batt_index] = _data.mon_tmp.toFixed(1);
|
}
|
//console.log(everyCount);
|
// 设置状态数据
|
this.testData.everyCount = everyCount;
|
// 设置值
|
this.slider = 100;
|
// 设置组端电压折线图
|
this.setGroupLine(groupVol, onlineVol, testTime);
|
// 设置测试电流折线图
|
this.setCurrLine(testCurr, testTime);
|
// 设置单体折线图
|
this.setMonLine(batt_test_voldata, testTime);
|
},
|
setArrayvalue(list, index) {
|
if(list!=undefined && index > 0){
|
for(var i=0;i<list.length;i++){
|
list[i][index] = list[i][index-1];
|
}
|
}
|
},
|
getMonNums() {
|
var batt = this.getBatt();
|
var monCount = batt.MonCount;
|
var rs = [];
|
for(var i=0; i<monCount; i++) {
|
rs.push('#'+(i+1));
|
}
|
return rs;
|
},
|
setGroupLine(groupVol, onlineVol, testTime) {
|
groupLine.changeData({
|
x: testTime,
|
y: [
|
{
|
name: '组端电压',
|
data: groupVol,
|
},
|
{
|
name: '在线电压',
|
data: onlineVol
|
}
|
]
|
});
|
},
|
setCurrLine(testCurr, testTime) {
|
currLine.changeData({
|
x: testTime,
|
y: [
|
{
|
name: '电池电流',
|
data: testCurr,
|
}
|
]
|
});
|
},
|
setMonLine(monData, testTime) {
|
monLine.changeData({
|
x: testTime,
|
y: (function(data) {
|
let arr = [];
|
let arr_max = [];
|
let arr_min = [];
|
let arr_average = [];
|
for (let m = 0, n = testTime.length ,j = data.length; m < n; m++) {
|
let _arr = [];
|
for(let i = 0; i < j; i++) {
|
_arr.push(data[i][m]);
|
}
|
let max = Math.max(..._arr);
|
let min = Math.min(..._arr);
|
let sum = _arr.reduce((t, v) => {
|
return t + v;
|
});
|
let average = (sum / j).toFixed(3) * 1;
|
arr_max.push(max);
|
arr_min.push(min);
|
arr_average.push(average);
|
}
|
arr.push({
|
name: '最大值'
|
,data: arr_max
|
}, {
|
name: '最小值'
|
,data: arr_min
|
}, {
|
name: '平均值'
|
,data: arr_average
|
});
|
// console.log(arr, data, '====data');
|
return arr;
|
})(monData)
|
});
|
},
|
setDataBySlide(val) {
|
if(val == null) {
|
return val;
|
}
|
var index = this.getIndex();
|
var rs = "00:00:00";
|
if(index != -1) {
|
var testCount = this.getTestCount(index);
|
// 设置滑块显示的数字
|
rs = formatSeconds(testCount.test_timelong);
|
// 设置rtstate的值
|
this.setRtState(testCount);
|
this.record_num = testCount.record_num;
|
this.setMonInfo();
|
}
|
return rs;
|
},
|
getIndex: function() { // 获取笔数下标
|
var val = this.slider;
|
var everyCount = this.testData.everyCount;
|
if(everyCount.length != 0) {
|
return Math.floor((everyCount.length-1)*val/100);
|
}else {
|
return -1;
|
}
|
},
|
getTestCount(index) { // 获取显示的笔数
|
return this.testData.everyCount[index];
|
},
|
setRtState(data) { // 设置rtstate的值
|
this.rtstate.data = data;
|
},
|
getStopCause(c_type, s_cause) {
|
var rs = "";
|
rs = c_type+"(终止原因:"+s_cause+")";
|
return rs;
|
},
|
setMonInfo() { // 设置单体信息
|
var monInfo = this.getMonInfo(this.record_num);
|
// 根据数据生成单体编号
|
var monNums = [];
|
for(var i=0; i<monInfo.length; i++) {
|
monNums.push('#'+(i+1));
|
}
|
monInfoBar.changeData({
|
x: monNums,
|
y: [
|
{
|
name: '单体电压',
|
data: monInfo
|
}
|
]
|
});
|
},
|
setCurrAbnormalInfo (times, data) {
|
currAbnormalLine.changeData({
|
x: times,
|
y: [
|
{
|
name: '组端电流',
|
data
|
}
|
]
|
});
|
},
|
getMonInfo(record_num) {
|
var rs = [];
|
// 遍历allData
|
for(var i=0; i<allData.length; i++) {
|
var data = allData[i];
|
if(data.record_num==record_num) {
|
rs.push(data.mon_vol);
|
}else if(data.record_num>record_num){
|
break;
|
}
|
}
|
// 返回结果
|
return rs;
|
}
|
/**
|
* 获取文件导出时的进度条
|
* 参数 null
|
*/
|
,getProgress () {
|
return this.$axios({
|
method: 'post',
|
url: 'LoginAction!serchFileProgress',
|
data: null
|
}).then((res) => {
|
res = JSON.parse(res.data.result);
|
let percentage = Number(res.data[0].toFixed(0));
|
this.progress.value = percentage;
|
// console.log(res);
|
if(percentage == 0) {
|
this.progress.text="数据加载中...";
|
}else {
|
this.progress.text="文件下载中...";
|
}
|
|
if(res.data<100 && this.progress.show) {
|
setTimeout(this.getProgress, 50);
|
}else {
|
this.progress.value = 100;
|
// this.progress.show = false;
|
}
|
});
|
}
|
/**
|
* 清除进度条进度
|
*/
|
,clearProgress () {
|
return this.$axios({
|
method: 'post',
|
url: 'LoginAction!clearProgress',
|
data: null
|
});
|
}
|
,exportCsv () {
|
var batt = this.getBatt();
|
|
if (!this.exportObj) {
|
return false;
|
}
|
|
const count = this.exportObj.val;
|
const date = this.exportObj.text.split(' ')[0];
|
|
let param = {
|
dev_name: batt.BattGroupName.replace('#', '号'),
|
dev_id: batt.BattGroupId,
|
test_record_count: count,
|
export_num: this.exportObj.abnormal ? 7 : 3,
|
table_name: date.replace(/-/g, '_'),
|
record_time: date + " 00:00:00"
|
};
|
// console.log(param, 'param');
|
|
// 显示进度条
|
this.progress.show = true;
|
// 请求后台
|
this.clearProgress().then(()=> {
|
this.getProgress();
|
this.$axios({
|
method: 'post'
|
,url: 'CsvFileDownloadAction!searchDownloadFile'
|
,data: 'json=' + JSON.stringify(param)
|
,timeout: 0
|
}).then(res=>{
|
res = JSON.parse(res.data.result);
|
// console.log(res, 'download res');
|
if(res.code == 1) {
|
// 关闭进度条
|
this.progress.show = false;
|
this.progress.value = 0;
|
let data = res.data[0];
|
const link = document.createElement("a");
|
link.href = encodeURI(this.$config.url + 'tomcat7_csv/' + data.fileName);
|
link.download = data.fileName;
|
document.body.appendChild(link);
|
link.click();
|
document.body.removeChild(link);
|
setTimeout(()=>{
|
// 关闭进度条
|
this.progress.show = false;
|
this.progress.value = 0;
|
}, 1000);
|
}else {
|
// 关闭进度条
|
this.progress.show = false;
|
this.progress.value = 0;
|
this.$layer.msg('生成文件失败!');
|
}
|
}).catch(error=>{
|
// 关闭进度条
|
this.progress.show = false;
|
this.progress.value = 0;
|
this.$layer.msg('生成文件失败!');
|
console.warn(error);
|
});
|
});
|
}
|
,handleShowSettings () {
|
this.getDeltaLimit();
|
this.settingsVisible = true;
|
this.$nextTick(() => {
|
this.$refs.form_settings.validate();
|
});
|
}
|
// 查询当前阀值
|
// Fbs9100_setparamAction!serchByCondition //查询汇集器参数
|
// 传参json:{"dev_id":"960000001","op_cmd":"241"}
|
// dev_id设备id(你看看查询左侧电池组信息时有没有查出FBSDeviceId这个是设备低),op_cmd是李军给的命令 (241是读取参数,243是设置参数)
|
,getDeltaLimit () {
|
let param = {
|
dev_id: this.$store.state.battGroup.FBSDeviceId,
|
op_cmd: 241
|
};
|
// console.log('param', param);
|
if (!param.dev_id) {
|
return false;
|
}
|
|
// console.log(param, 'param');
|
this.$axios({
|
method: 'post'
|
,url: 'Fbs9100_setparamAction!serchByCondition'
|
,data: 'json=' + JSON.stringify(param)
|
,timeout: 0
|
}).then((res) => {
|
res = JSON.parse(res.data.result);
|
// console.log(res, 999999999999999)
|
if (res.code) {
|
let data = res.data[0];
|
this.settingsData.clamp_range = data.MonomerLowCount;
|
this.settingsData.delta_limit = data.MonomerVol_Low;
|
}
|
});
|
}
|
// Fbs9100_setparamAction!update
|
// 设置参数
|
// 传参json:{"dev_id":"960000001","op_cmd":"243","MonomerVol_Low":"60","MonomerLowCount":"800"}
|
// MonomerVol_Low 阈值,MonomerLowCount霍尔量程
|
,settingsConfirm () {
|
this.$refs.form_settings.validate((valid) => {
|
if (valid) {
|
let param = {
|
dev_id: this.$store.state.battGroup.FBSDeviceId,
|
op_cmd: 243,
|
MonomerLowCount: this.settingsData.clamp_range,
|
MonomerVol_Low: this.settingsData.delta_limit
|
};
|
// console.log(param, 'param');
|
this.$axios({
|
method: 'post'
|
,url: 'Fbs9100_setparamAction!update'
|
,data: 'json=' + JSON.stringify(param)
|
}).then((res) => {
|
res = JSON.parse(res.data.result);
|
if (res.code) {
|
this.$message({
|
type: 'success',
|
message: res.msg
|
});
|
this.settingsVisible = false;
|
} else {
|
this.$message({
|
type: 'warning',
|
message: res.msg
|
});
|
}
|
});
|
}
|
});
|
}
|
// 查询所有电池组
|
,getAllBattList () {
|
return this.$axios({
|
method: "post",
|
url: 'BattInfAction!searchAll',
|
data: null
|
}).then((res) => {
|
res = JSON.parse(res.data.result);
|
// console.log(res);
|
if(res.code == 1) {
|
var data = res.data;
|
this.$store.dispatch('changeBattList', data);
|
this.$store.dispatch('changeBattGroup', this.$store.state.allBattList[this.battIdx]);
|
}
|
});
|
}
|
},
|
computed: {
|
getBattState() {
|
var rtstate = this.rtstate.data;
|
return rtstate.test_type==3?this.getStopCause('放电', this.rtstate.stop_resean):rtstate.test_type==2?"充电":"未知";
|
},
|
getDiffStyle() {
|
return {
|
height: '100%',
|
// 'margin-top': '0.8rem'
|
};
|
},
|
getTestTimeLong() { // 获取测试时长
|
return formatSeconds(this.rtstate.data.test_timelong);
|
},
|
},
|
mounted() {
|
// 设置导航栏
|
this.$store.dispatch('changeNavActive', 1);
|
this.$event.$on('showSettings', this.handleShowSettings);
|
// if (!this.$store.state.allBattList.length) {
|
this.getAllBattList().then(() => {
|
this.initPage();
|
});
|
/* } else {
|
// 初始化页面
|
this.initPage();
|
}*/
|
|
// 端电压折线图
|
groupLine = new EGraph(this.$refs.groupLine, {
|
type: 'line',
|
init: {
|
yAxis: {
|
name: 'V'
|
}
|
}
|
});
|
groupLine.chart.group = 'group1';
|
// 电池电流
|
currLine = new EGraph(this.$refs.currLine, {
|
type: 'line',
|
init: {
|
yAxis: {
|
name: 'A'
|
}
|
}
|
});
|
currLine.chart.group = 'group1';
|
// 单体电压折线图
|
monLine = new EGraph(this.$refs.monLine, {
|
type: 'line',
|
init: {
|
yAxis: {
|
name: 'V'
|
}
|
}
|
});
|
monLine.chart.group = 'group1';
|
// 关联图表
|
echarts.connect('group1');
|
// 单体信息图表
|
monInfoBar = new EGraph(this.$refs.monInfoBar, {
|
init: {
|
yAxis: {
|
name: 'V'
|
}
|
}
|
});
|
currAbnormalLine = new EGraph(this.$refs.currAbnormalLine, {
|
type: 'line',
|
init: {
|
yAxis: {
|
name: 'A'
|
}
|
}
|
});
|
|
|
// window大小发生变化时echarts重置大小
|
window.onresize = function() {
|
groupLine.resize();
|
currLine.resize();
|
monLine.resize();
|
currAbnormalLine.resize();
|
monInfoBar.resize();
|
}
|
},
|
destroyed() {
|
// 销毁echrts对象
|
groupLine.dispose();
|
currLine.dispose();
|
monLine.dispose();
|
monInfoBar.dispose();
|
currAbnormalLine.dispose();
|
// 解除window.onresize
|
window.onresize = null;
|
}
|
}
|
</script>
|
|
<style scoped>
|
.page-container {
|
height: 100%;
|
/* display: -webkit-flex;
|
display: flex;
|
flex-direction: column; */
|
}
|
.page-container >>> .el-row:nth-child(1) {
|
height: 47%;
|
}
|
.page-container >>> .el-row:nth-child(2) {
|
height: 53%;
|
}
|
.page-container >>> .el-row:only-child {
|
height: 100%;
|
}
|
>>> .el-row:first-of-type:not(:only-child) {
|
padding-bottom: 10px;
|
/*flex: 0.9;*/
|
}
|
.page-container div.el-row.out-row {
|
padding-bottom: 0;
|
height: 100%;
|
}
|
.dev-states {
|
padding: 0.6rem;
|
}
|
.dev-state-item {
|
line-height: 1.4rem;
|
}
|
.slider-container {
|
padding-left: 0.8rem;
|
padding-right: 0.8rem;
|
}
|
.graph,
|
.graph-container {
|
height: 100%;
|
}
|
.graph.cut38 {
|
height: calc(100% - 38px);
|
}
|
.inner {
|
height: 100%;
|
display: -webkit-flex;
|
display: flex;
|
flex-direction: column;
|
}
|
.inner .p-footer {
|
display: -webkit-flex;
|
display: flex;
|
justify-content: center;
|
padding: 6px;
|
}
|
.inner .p-footer .btn_3d {
|
width: 8em;
|
}
|
.inner >>> .test-list {
|
flex: 1;
|
}
|
.panel-abnormal {
|
height: 100%;
|
}
|
.G-wraper {
|
height: 100%;
|
/*overflow: hidden;*/
|
}
|
.show-abnormal {
|
-webkit-transform: translateY(-100%);
|
transform: translateY(-100%);
|
}
|
.D-content {
|
padding: 0 20px;
|
}
|
.D-content >>> .el-form-item__label {
|
text-align: right;
|
color: #fff;
|
}
|
.D-content >>> .el-input-group__append {
|
width: 4em;
|
color: #000;
|
}
|
>>> .dialog-bg .el-dialog__header {
|
background-image: linear-gradient(#0fa1d9, #056aa5, #0fa1d9);
|
color: #fff;
|
}
|
>>> .el-dialog__title {
|
color: #fff;
|
}
|
>>> .el-dialog__headerbtn .el-dialog__close {
|
color: #fff;
|
}
|
>>> .dialog-bg .el-dialog {
|
background: #034362;
|
color: #fff;
|
}
|
</style>
|