<template>
|
<el-form
|
ref="ruleForm"
|
size="mini"
|
label-position="top"
|
:model="params"
|
:rules="rules"
|
class="params-dialog">
|
<el-form-item label="电池组名称">
|
<el-input v-model="otherParams.groupName" readonly></el-input>
|
</el-form-item>
|
<div class="form-footer">
|
<!-- <three-btn>清除告警</three-btn> -->
|
<three-btn @click="confirmStart">启动内阻测试</three-btn>
|
</div>
|
</el-form>
|
</template>
|
|
<script>
|
import {const_9100} from "@/assets/js/const";
|
import {
|
btsControl
|
} from '../js/realTime';
|
|
export default {
|
name: "ResTest",
|
props: {
|
batt: {
|
type: Object,
|
default() {
|
return {}
|
}
|
}
|
},
|
data() {
|
let cmd = const_9100.cmd;
|
return {
|
cmd: cmd,
|
params: {},
|
rules: {},
|
}
|
},
|
methods: {
|
confirmStart() {
|
this.$confirm('确定启动内阻测试', '系统提示', {
|
type: 'warning'
|
}).then(()=>{
|
this.start();
|
}).catch(()=>{});
|
},
|
start() {
|
// 等待框
|
let loading = this.$layer.loading(1);
|
// 请求后台
|
btsControl({
|
num: this.cmd.start,
|
devId: this.batt.fbsdeviceId,
|
battGroupNum: this.batt.groupIndexInFBSDevice+1,
|
}).then(res => {
|
res = res.data;
|
if (res.code && res.data2) {
|
// 提示信息
|
this.$layer.msg('启动测试成功');
|
} else {
|
// 提示信息
|
this.$layer.msg('启动测试失败!');
|
}
|
// 关闭等待框
|
this.$layer.close(loading);
|
}).catch(error => {
|
console.log(error);
|
// 关闭等待框
|
this.$layer.close(loading);
|
// 提示信息
|
this.$layer.msg('启动测试失败,启动测试请求异常!');
|
});
|
},
|
},
|
computed: {
|
otherParams() {
|
let batt = this.batt;
|
let groupInfo = '单体数量:' + this.batt.monCount + ";电压(V):"
|
+ this.batt.monVolStd + ";容量(AH):" + this.batt.monCapStd;
|
return {
|
groupName: batt.stationName + "-" + batt.battGroupName,
|
fbsdeviceId: batt.fbsdeviceId,
|
groupInfo: groupInfo,
|
groupIndexInFBSDevice: this.batt.groupIndexInFBSDevice + 1,
|
}
|
}
|
},
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|