longyvfengyun
2023-12-25 d8d792a6842832e8f6af6604274c438b25053afe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<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";
 
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);
      // 请求后台
      this.$apis.dischargeTest.bts.start({
        num: this.cmd.start,
        dev_id: this.batt.FBSDeviceId,
        BattGroupNum: this.batt.GroupIndexInFBSDevice+1,
      }).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;
      return {
        groupName: batt.StationName + "-" + batt.BattGroupName,
        FBSDeviceId: batt.FBSDeviceId,
        groupInfo: groupInfo,
        GroupIndexInFBSDevice: this.batt.GroupIndexInFBSDevice + 1,
      }
    }
  },
}
</script>
 
<style scoped>
 
</style>