he wei
2024-09-21 70edda3b00f2528a473c28ec5a50b739ed160f0f
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<template>
    <flex-layout>
        <el-row :gutter=8 class="module-info">
            <el-col :span=10>
                <table-wrapper class="h500" :title="device.name">
                    <el-table
                        stripe
                        size="small"
                        :data="device.data"
                        height="100%">
                        <el-table-column
                            prop="name"
                            label="参数名称"
                            min-width="240"
                            align="center"></el-table-column>
                        <el-table-column
                            prop="value"
                            label="参数值"
                            min-width="150"
                            align="center"></el-table-column>
                    </el-table>
                </table-wrapper>
            </el-col>
            <el-col :span=7>
                <table-wrapper class="h500" :title="collectState.name">
                    <el-table
                        stripe
                        size="small"
                        :data="collectState.data"
                        height="100%">
                        <el-table-column
                            prop="name"
                            label="参数名称"
                            min-width="150"
                            align="center"></el-table-column>
                        <el-table-column
                            prop="value"
                            label="参数值"
                            min-width="150"
                            align="center"></el-table-column>
                    </el-table>
                </table-wrapper>
            </el-col>
            <el-col :span=7>
                <table-wrapper class="h500" :title="chargeEleState.name">
                    <el-table
                        stripe
                        size="small"
                        :data="chargeEleState.data"
                        height="100%">
                        <el-table-column
                            prop="name"
                            label="参数名称"
                            min-width="150"
                            align="center"></el-table-column>
                        <el-table-column
                            prop="value"
                            label="参数值"
                            min-width="150"
                            align="center"></el-table-column>
                    </el-table>
                </table-wrapper>
            </el-col>
        </el-row>
    </flex-layout>
</template>
 
<script>
import TableWrapper from "@/components/TableWrapper";
import {
    Timeout,
    getNewListByConfig
} from "@/assets/js/tools";
export default {
    name: "ModuleInfo",
    components: {
        TableWrapper
    },
    props: {
        batt: {
            type: Object,
            default() {
                return {}
            },
        }
    },
    data() {
        return {
            timer: new Timeout(),
            device: {
                name: "绝缘装置",
                config: {
                    // BattGroupId: '电池组id',
                    recordTime: '记录时间',
                    insulatSystemVol: '绝缘监测模块系统电压',
                    insulatGroundVol: '绝缘监测模块正对地电压',
                    insulatNegativeVol: '绝缘监测模块负对地电压',
                    insulatGroundRes: '绝缘监测模块正对地电阻',
                    insulatNegativeRes: '绝缘监测模块负对地电阻',
                    insulatBattRes: '绝缘监测模块电池对地电阻',
                    insulatFaultNum: '绝缘监测模块故障电池节数',
                    insulatAcVol: '绝缘监测模块交流电压',
                    insulatSystemState: '绝缘监测模块系统状态',
                    insulatRecordState: '绝缘监测模块瞬时记录状态',
                    insulatState: '绝缘监测模块装置状态',
                    insulatBranchNum1: '绝缘监测模块接地支路号(模块1)',
                    insulatBranchResIs1: '绝缘监测模块支路正对地电阻(模块1)',
                    insulatBranchResNe1: '绝缘监测模块支路负对地电阻(模块1)',
                    insulatBranchNum2: '绝缘监测模块接地支路号(模块2)',
                    insulatBranchResIs2: '绝缘监测模块支路正对地电阻(模块2)',
                    insulatBranchResNe2: '绝缘监测模块支路负对地电阻(模块2)',
                    insulatBranchNum3: '绝缘监测模块接地支路号(模块3)',
                    insulatBranchResIs3: '绝缘监测模块支路正对地电阻(模块3)',
                    insulatBranchResNe3: '绝缘监测模块支路负对地电阻(模块3)',
                    insulatBranchNum4: '绝缘监测模块接地支路号(模块4)',
                    insulatBranchResIs4: '绝缘监测模块支路正对地电阻(模块4)',
                    insulatBranchResNe4: '绝缘监测模块支路负对地电阻(模块4)',
                    insulatBranchNum5: '绝缘监测模块接地支路号(模块5)',
                    insulatBranchResIs5: '绝缘监测模块支路正对地电阻(模块5)',
                    insulatBranchResNe5: '绝缘监测模块支路负对地电阻(模块5)',
                    insulatBranchNum6: '绝缘监测模块接地支路号(模块6)',
                    insulatBranchResIs6: '绝缘监测模块支路正对地电阻(模块6)',
                    insulatBranchResNe6: '绝缘监测模块支路负对地电阻(模块6)',
                    insulatBranchNum7: '绝缘监测模块接地支路号(模块7)',
                    insulatBranchResIs7: '绝缘监测模块支路正对地电阻(模块7)',
                    insulatBranchResNe7: '绝缘监测模块支路负对地电阻(模块7)',
                    insulatBranchNum8: '绝缘监测模块接地支路号(模块8)',
                    insulatBranchResIs8: '绝缘监测模块支路正对地电阻(模块8)',
                    insulatBranchResNe8: '绝缘监测模块支路负对地电阻(模块8)',
                    insulatBranchNum9: '绝缘监测模块接地支路号(模块9)',
                    insulatBranchResIs9: '绝缘监测模块支路正对地电阻(模块9)',
                    insulatBranchResNe9: '绝缘监测模块支路负对地电阻(模块9)',
                    insulatBranchNum10: '绝缘监测模块接地支路号(模块10)',
                    insulatBranchResIs10: '绝缘监测模块支路正对地电阻(模块10)',
                    insulatBranchResNe10: '绝缘监测模块支路负对地电阻(模块10)',
                    insulatBranchNum11: '绝缘监测模块接地支路号(模块11)',
                    insulatBranchResIs11: '绝缘监测模块支路正对地电阻(模块11)',
                    insulatBranchResNe11: '绝缘监测模块支路负对地电阻(模块11)',
                    insulatBranchNum12: '绝缘监测模块接地支路号(模块12)',
                    insulatBranchResIs12: '绝缘监测模块支路正对地电阻(模块12)',
                    insulatBranchResNe12: '绝缘监测模块支路负对地电阻(模块12)',
                    insulatBranchNum13: '绝缘监测模块接地支路号(模块13)',
                    insulatBranchResIs13: '绝缘监测模块支路正对地电阻(模块13)',
                    insulatBranchResNe13: '绝缘监测模块支路负对地电阻(模块13)',
                    insulatBranchNum14: '绝缘监测模块接地支路号(模块14)',
                    insulatBranchResIs14: '绝缘监测模块支路正对地电阻(模块14)',
                    insulatBranchResNe14: '绝缘监测模块支路负对地电阻(模块14)',
                    insulatBranchNum15: '绝缘监测模块接地支路号(模块15)',
                    insulatBranchResIs15: '绝缘监测模块支路正对地电阻(模块15)',
                    insulatBranchResNe15: '绝缘监测模块支路负对地电阻(模块15)',
                    insulatBranchNum16: '绝缘监测模块接地支路号(模块16)',
                    insulatBranchResIs16: '绝缘监测模块支路正对地电阻(模块16)',
                    insulatBranchResNe16: '绝缘监测模块支路负对地电阻(模块16)',
                },
                data: []
            },
            collectState: {
                name: "汇集器状态",
                config: {
                    // BattGroupId: '电池组ID',
                    recordTime: '记录时间',
                    colVersion: '汇集器版本',
                    colState: '汇集器状态',
                    colVol: '汇集器组电压',
                    colCurr: '汇集器组电流',
                    colBattState: '汇集器电池状态',
                    colCurrDir: '汇集器电流方向',
                    colMeanRipCurr: '汇集器纹波电流均值',
                    colPeakRipCurr: '汇集器纹波电流峰值',
                    colResTestCount: '汇集器内阻测试次数',
                    colResTestType: '汇集器内阻测试方法',
                },
                data: []
            },
            chargeEleState: {
                name: '充电机状态',
                config: {
                    // BattGroupId: '电池组ID',
                    recordTime: '记录时间',
                    charOutputVol: '充电机输出电压',
                    charOutputCurr: '充电机输出电流',
                    charPeakRipVol: '纹波峰值',
                    charPeakRipParam: '纹波峰值系数',
                    charUan: 'Uan',
                    charIan: 'Ian',
                    charUbn: 'Ubn',
                    charIbn: 'Ibn',
                    charUcn: 'Ucn',
                    charIcn: 'Icn',
                    charSystemState: '系统状态',
                },
                data: []
            },
        }
    },
    methods: {
        // 开启查询
        startSearch() {
            this.timer.start(()=>{
                this.$axios.all([
                    this.searchDevice(),
                    this.searchCollectState(),
                    this.searchChargeEleState()
                ]).then(()=>{
                    // 开启计时器
                    this.timer.open();
                }).catch(error=>{
                    console.log(error);
                    // 开启计时器
                    this.timer.open();
                });
            }, 4000);
        },
        // 绝缘装置查询
        searchDevice() {
            let batt = this.batt;
            this.$apis.dataMager.moduleInfo.searchDevice({
                battGroupId: batt.BattGroupId
            }).then(res=>{
                let rs = JSON.parse(res.data.result);
                let temp = {};
                if(rs.code == 1) {
                    temp = rs.data;
                }
                // 设置内容
                this.device.data = getNewListByConfig(temp, this.device.config);
            }).catch(error=>{
                // 设置内容
                this.device.data = getNewListByConfig({}, this.device.config);
            });
        },
        // 汇集器查询
        searchCollectState() {
            let batt = this.batt;
            this.$apis.dataMager.moduleInfo.searchCollectState({
                battGroupId: batt.BattGroupId
            }).then(res=>{
                let rs = JSON.parse(res.data.result);
                let temp = {};
                if(rs.code == 1) {
                    temp = rs.data;
                }
                // 设置内容
                this.collectState.data = getNewListByConfig(temp, this.collectState.config);
            }).catch(error=>{
                // 设置内容
                this.collectState.data = getNewListByConfig({}, this.collectState.config);
            });
        },
        // 充电机查询
        searchChargeEleState() {
            let batt = this.batt;
            this.$apis.dataMager.moduleInfo.searchChargeEleState({
                battGroupId: batt.BattGroupId
            }).then(res=>{
                let rs = JSON.parse(res.data.result);
                let temp = {};
                if(rs.code == 1) {
                    temp = rs.data;
                }
                // 设置内容
                this.chargeEleState.data = getNewListByConfig(temp, this.chargeEleState.config);
            }).catch(error=>{
                // 设置内容
                this.chargeEleState.data = getNewListByConfig({}, this.chargeEleState.config);
            });
        },
    },
    mounted() {
        // 开始查询
        this.startSearch();
    },
    destroyed() {
        // 关闭计时器
        this.timer.stop();
    }
}
</script>
 
<style scoped>
.module-info {
    text-align: left;
    padding: 8px;
}
</style>