| | |
| | | label-position="top" |
| | | :model="params" |
| | | :rules="rules" |
| | | class="params-dialog"> |
| | | class="params-dialog" |
| | | > |
| | | <el-form-item label="电池组名称"> |
| | | <el-input v-model="otherParams.groupName" readonly></el-input> |
| | | </el-form-item> |
| | |
| | | <el-form-item label="测试起始电池序号"> |
| | | <el-select v-model="params.param_teststart_batt_num"> |
| | | <el-option |
| | | v-for="(item, key) in monNums" :key="'key'+key" |
| | | :value="item.value" :label="item.label"></el-option> |
| | | v-for="(item, key) in monNums" |
| | | :key="'key' + key" |
| | | :value="item.value" |
| | | :label="item.label" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="单体电压下限阀值(0~14.0V)" prop="param_mon_curr_low"> |
| | | <el-form-item |
| | | label="单体电压下限阀值(0~14.0V)" |
| | | prop="param_mon_curr_low" |
| | | > |
| | | <el-input v-model="params.param_mon_curr_low"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="单体电压上限阀值(0~14.0V)" prop="param_mon_curr_high"> |
| | | <el-form-item |
| | | label="单体电压上限阀值(0~14.0V)" |
| | | prop="param_mon_curr_high" |
| | | > |
| | | <el-input v-model="params.param_mon_curr_high"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="在线电压阀值(60.0~270.0℃)" prop="param_online_vol"> |
| | | <el-form-item |
| | | label="在线电压阀值(60.0~270.0℃)" |
| | | prop="param_online_vol" |
| | | > |
| | | <el-input v-model="params.param_online_vol"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="在线电压恢复阀值(60.0~270.0℃)" prop="param_online_vol_recover"> |
| | | <el-form-item |
| | | label="在线电压恢复阀值(60.0~270.0℃)" |
| | | prop="param_online_vol_recover" |
| | | > |
| | | <el-input v-model="params.param_online_vol_recover"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="内阻告警上限(0~65.0mΩ)" prop="param_res_args"> |
| | | <el-input v-model="params.param_res_args"></el-input> |
| | | <el-form-item label="内阻告警上限(0~65.0mΩ)" prop="param_res_high"> |
| | | <el-input v-model="params.param_res_high"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="充电电流下限阀值(0.30~4.00A)" prop="param_charge_curr_low"> |
| | | <el-form-item |
| | | label="充电电流下限阀值(0.30~4.00A)" |
| | | prop="param_charge_curr_low" |
| | | > |
| | | <el-input v-model="params.param_charge_curr_low"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="layout.span"> |
| | | <el-form-item label="充电容量下限阀值(60~100%)" prop="param_charge_cap_low"> |
| | | <el-form-item |
| | | label="充电容量下限阀值(60~100%)" |
| | | prop="param_charge_cap_low" |
| | | > |
| | | <el-input v-model="params.param_charge_cap_low"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <div class="form-footer"> |
| | | <three-btn :disabled="!startTestFlag">启动测试</three-btn> |
| | | <three-btn :disabled="!startTestFlag" @click="confirmStartTest">启动测试</three-btn> |
| | | <three-btn @click="getParams(true)">读取</three-btn> |
| | | <three-btn :disabled="!setTestFlag">设定</three-btn> |
| | | <three-btn :disabled="!setTestFlag" @click="submitFrom">设定</three-btn> |
| | | </div> |
| | | </el-form> |
| | | </template> |
| | | |
| | | <script> |
| | | import const_ld_nine from "@/assets/js/const/const_ld_nine"; |
| | | import {testVal} from "@/assets/js/tools"; |
| | | import { testVal } from "@/assets/js/tools"; |
| | | export default { |
| | | name: "LdNineParams", |
| | | props: { |
| | | batt: { |
| | | type: Object, |
| | | default() { |
| | | return {} |
| | | } |
| | | } |
| | | return {}; |
| | | }, |
| | | }, |
| | | }, |
| | | data() { |
| | | let cmd = const_ld_nine.cmd; |
| | |
| | | let rules = const_ld_nine.rules; |
| | | |
| | | return { |
| | | startTestFlag: false, // 启动测试的状态 |
| | | setTestFlag: false, // 设置参数的状态 |
| | | startTestFlag: false, // 启动测试的状态 |
| | | setTestFlag: false, // 设置参数的状态 |
| | | layout: { |
| | | gutter: 16, |
| | | span: 8, |
| | |
| | | params: { |
| | | num: 0, |
| | | dev_id: 0, |
| | | param_teststart_batt_num: 0, //测试起始电池序号 |
| | | param_cap: 0, //标称容量 |
| | | param_teststart_batt_num: 0, //测试起始电池序号 |
| | | param_cap: 0, //标称容量 |
| | | op_cmd: 0, |
| | | param_discharge_curr: 0, //放电电流0.001 |
| | | param_mon_curr_high: 0, //单体上限0.001 |
| | | param_charge_curr: 0, //充电电流0.001 |
| | | param_mon_curr_low: 0, //单体下限0.001 |
| | | param_online_vol: 0, //在线电压阀值0.01 |
| | | param_charge_curr_low: 0, //充电电流下限阀值0.001 |
| | | param_charge_cap_low: 0, //充电容量下限阀值% |
| | | param_online_vol_recover: 0, //在线电压恢复阀值0.01 |
| | | param_junheng_model: 0, //均衡功能 0->禁用 1->启用 |
| | | param_datasource: 0, // 数据来源 |
| | | param_res_args: 0, // 内阻测试系数 |
| | | param_cap_low: 0, // 容量告警下限 |
| | | param_tmp_high: 0, // 温度告警上限 |
| | | param_res_high: 0 // 内阻告警上限 |
| | | param_discharge_curr: 0, //放电电流0.001 |
| | | param_mon_curr_high: 0, //单体上限0.001 |
| | | param_charge_curr: 0, //充电电流0.001 |
| | | param_mon_curr_low: 0, //单体下限0.001 |
| | | param_online_vol: 0, //在线电压阀值0.01 |
| | | param_charge_curr_low: 0, //充电电流下限阀值0.001 |
| | | param_charge_cap_low: 0, //充电容量下限阀值% |
| | | param_online_vol_recover: 0, //在线电压恢复阀值0.01 |
| | | param_junheng_model: 0, //均衡功能 0->禁用 1->启用 |
| | | param_datasource: 0, // 数据来源 |
| | | param_res_args: 0, // 内阻测试系数 |
| | | param_cap_low: 0, // 容量告警下限 |
| | | param_tmp_high: 0, // 温度告警上限 |
| | | param_res_high: 0, // 内阻告警上限 |
| | | }, |
| | | rules: { |
| | | param_cap: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_cap) |
| | | param_cap: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_cap); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_discharge_curr: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_discharge_curr) |
| | | ], |
| | | param_discharge_curr: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_discharge_curr); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_charge_curr: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_charge_curr) |
| | | ], |
| | | param_charge_curr: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_charge_curr); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_mon_curr_low: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_mon_curr_low) |
| | | ], |
| | | param_mon_curr_low: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_mon_curr_low); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_mon_curr_high: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_mon_curr_high) |
| | | ], |
| | | param_mon_curr_high: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_mon_curr_high); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_tmp_high: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_tmp_high) |
| | | ], |
| | | param_tmp_high: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_tmp_high); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_online_vol: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_online_vol) |
| | | ], |
| | | param_online_vol: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_online_vol); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_online_vol_recover: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_online_vol_recover) |
| | | ], |
| | | param_online_vol_recover: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_online_vol_recover); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_res_args: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_res_args) |
| | | ], |
| | | param_res_high: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_res_high); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_charge_curr_low: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_charge_curr_low) |
| | | ], |
| | | param_charge_curr_low: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_charge_curr_low); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_charge_cap_low: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_charge_cap_low) |
| | | ], |
| | | param_charge_cap_low: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_charge_cap_low); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | param_cap_low: [{ |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_cap_low) |
| | | ], |
| | | param_cap_low: [ |
| | | { |
| | | validator(rule, value, callback) { |
| | | testVal(rule, value, callback, rules.param_cap_low); |
| | | }, |
| | | trigger: "change", |
| | | }, |
| | | trigger: 'change' |
| | | }], |
| | | ], |
| | | }, |
| | | testType: 81, |
| | | }; |
| | |
| | | } |
| | | // 启动按钮不可点击 |
| | | this.startTestFlag = false; |
| | | this.$apis.dischargeTest.ld9.getParams({ |
| | | num: this.cmd.get, |
| | | BattGroupId: this.batt.BattGroupId, |
| | | }).then(res=>{ |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | let rs = JSON.parse(res.data.result); |
| | | if(rs.code == 1) { |
| | | this.$layer.msg('读取成功!'); |
| | | }else { |
| | | let batt = this.batt; |
| | | this.$apis.dischargeTest.ld9 |
| | | .getParams({ |
| | | num: this.cmd.get, |
| | | StationName: batt.StationName, |
| | | StationName1: batt.StationName1, |
| | | BattGroupId: batt.BattGroupId, |
| | | }) |
| | | .then((res) => { |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | let rs = JSON.parse(res.data.result); |
| | | console.log(rs, "====rs"); |
| | | if (rs.code == 1) { |
| | | this.$layer.msg("读取成功!"); |
| | | this.params = rs.data[0].ld9_param; |
| | | // 设置按钮可点击 |
| | | this.setTestFlag = true; |
| | | } else { |
| | | // 设置按钮不可点击 |
| | | this.setTestFlag = false; |
| | | this.$layer.msg("读取失败!"); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | // 设置按钮不可点击 |
| | | this.setTestFlag = false; |
| | | this.$layer.msg('读取失败!'); |
| | | this.$layer.msg("读取失败,请检查网络。"); |
| | | }); |
| | | }, |
| | | submitFrom() { |
| | | this.$refs.ruleForm.validate((valid) => { |
| | | // 校验通过 |
| | | if (valid) { |
| | | // 设置参数 |
| | | this.setParams(true); |
| | | } else { |
| | | this.$layer.msg("存在校验未通过的数据!"); |
| | | return false; |
| | | } |
| | | }).catch(error => { |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | // 设置按钮不可点击 |
| | | this.setTestFlag = false; |
| | | this.$layer.msg('读取失败,请检查网络。'); |
| | | }); |
| | | }, |
| | | // 设定参数 |
| | | setParams(showLoad) { |
| | | // 定义等待框 |
| | | let loading; |
| | | if (showLoad) { |
| | | loading = this.$layer.loading(1); |
| | | } |
| | | // 启动按钮不可点击 |
| | | this.startTestFlag = false; |
| | | let batt = this.batt; |
| | | let param = this.params; |
| | | this.$apis.dischargeTest.ld9 |
| | | .setParams({ |
| | | num: this.cmd.set, |
| | | dev_id: batt.FBSDeviceId, |
| | | param_teststart_batt_num: param.param_teststart_batt_num, |
| | | param_cap: param.param_cap, |
| | | param_discharge_curr: param.param_discharge_curr, |
| | | param_mon_curr_high: param.param_mon_curr_high, |
| | | param_charge_curr: param.param_charge_curr, |
| | | param_mon_curr_low: param.param_mon_curr_low, |
| | | param_online_vol: param.param_online_vol, |
| | | param_charge_curr_low: param.param_charge_curr_low, |
| | | param_charge_cap_low: param.param_charge_cap_low, |
| | | param_online_vol_recover: param.param_online_vol_recover, |
| | | param_junheng_model: param.param_junheng_model, |
| | | param_cap_low: param.param_cap_low, |
| | | param_tmp_high: param.param_tmp_high, |
| | | param_res_high: param.param_res_high, |
| | | }) |
| | | .then((res) => { |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | let rs = JSON.parse(res.data.result); |
| | | console.log(rs, "====rs1"); |
| | | if (rs.code == 1) { |
| | | this.$layer.msg("设定成功!"); |
| | | this.startTestFlag = true; |
| | | } else { |
| | | // 设置按钮不可点击 |
| | | this.startTestFlag = false; |
| | | this.$layer.msg("设定失败!"); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | // 关闭等待框 |
| | | this.$layer.close(loading); |
| | | // 设置按钮不可点击 |
| | | this.startTestFlag = false; |
| | | this.$layer.msg("设定失败,请检查网络。"); |
| | | }); |
| | | }, |
| | | // 确认框 |
| | | confirmStartTest() { |
| | | this.$layer.prompt( |
| | | { |
| | | title: "输入启动口令,并确认", |
| | | formType: 2, |
| | | area: ["300px", "180px"], |
| | | }, |
| | | (pass, index) => { |
| | | // 请求后台校验密码 |
| | | this.$apis.login |
| | | .checkUserPwd(pass) |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | // 关闭弹出框 |
| | | this.$layer.close(index); |
| | | this.$layer.msg("密码检测通过,启动测试"); |
| | | // 启动测试 |
| | | this.startTest(); |
| | | } else { |
| | | this.$layer.msg("启动口令错误!"); |
| | | } |
| | | }) |
| | | .catch((error) => { |
| | | console.log(error); |
| | | this.$layer.msg("网络请求异常"); |
| | | }); |
| | | } |
| | | ); |
| | | }, |
| | | // 启动 |
| | | startTest() { |
| | | // 等待框 |
| | | let loading = this.$layer.loading(1); |
| | | // 请求后台 |
| | | this.$apis.dischargeTest.ld9 |
| | | .start({ |
| | | num: this.cmd.start, |
| | | dev_id: this.batt.FBSDeviceId |
| | | }) |
| | | .then((res) => { |
| | | let rs = JSON.parse(res.data.result); |
| | | if (rs.code == 1) { |
| | | // 提示信息 |
| | | 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; |
| | | 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, |
| | | } |
| | | }; |
| | | }, |
| | | monNums() { |
| | | let monCount = this.batt.MonCount; |
| | | let list = []; |
| | | for(let i=0; i<=monCount; i++) { |
| | | if(monCount>9 && i==0) { |
| | | for (let i = 0; i <= monCount; i++) { |
| | | if (monCount > 9 && i == 0) { |
| | | list.push({ |
| | | value: 0, |
| | | label: "默认" |
| | | label: "默认", |
| | | }); |
| | | }else { |
| | | } else { |
| | | list.push({ |
| | | value: i, |
| | | label: "单体"+i |
| | | }) |
| | | label: "单体" + i, |
| | | }); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | }, |
| | | }, |
| | | mounted() { |
| | | |
| | | } |
| | | } |
| | | this.getParams(true); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |