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
| <template>
| <div class="params-container">
| <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>
| <el-row :gutter="layout.gutter">
| <el-col :span="layout.span">
| <el-form-item label="模块编号">
| <el-select v-model="params.groupNum" placeholder="请选择" @change="changeGroupNum">
| <el-option :value="1">1</el-option>
| <el-option :value="2">2</el-option>
| <el-option :value="3">3</el-option>
| <el-option :value="4">4</el-option>
| <el-option :value="5">5</el-option>
| </el-select>
| </el-form-item>
| </el-col>
| <el-col :span="layout.span">
| <el-form-item label="模块状态">
| <el-select v-model="params.workstate" placeholder="请选择" disabled>
| <el-option v-for="item in testType" :key="item.value" :label="item.label"
| :value="item.value"></el-option>
| </el-select>
| </el-form-item>
| </el-col>
| </el-row>
| <div class="form-footer">
| <three-btn :disabled="params.workstate==0" @click="stopCuring">停止</three-btn>
| </div>
| </el-form>
| </div>
| </template>
|
| <script>
| import {const_curing} from "@/assets/js/const";
| import {realTimeStateList, curingControl} from "../js/realTime";
|
| export default {
| name: "StopCuring",
| props: {
| batt: {
| type: Object,
| default() {
| return {}
| }
| }
| },
| data() {
| let cmd = const_curing.cmd;
| let testType = [
| {
| label: '停止',
| value: 0,
| },
| {
| label: '养护',
| value: 1,
| },
| {
| label: '除硫',
| value: 2,
| }
| ];
| let rules = const_curing.dischargeRules;
| return {
| layout: {
| gutter: 16,
| span: 12,
| },
| testType: testType,
| params: {
| devId: 0,
| groupNum: 1, // 电池组号
| resttime: 0, // 剩余天数
| workstate: 0, // 工作模式
| vgroupvol: 0, // 组端电压
| vpeakvol: 0, // 峰值电压
| },
| rules: {},
| allData: {
| resttimeFive: 0,
| resttimeFour: 0,
| resttimeOne: 0,
| resttimeThree: 0,
| resttimeTwo: 0,
| vgroupvolFive: 0,
| vgroupvolFour: 0,
| vgroupvolOne: 0,
| vgroupvolThree: 0,
| vgroupvolTwo: 0,
| vpeakvolFive: 0,
| vpeakvolFour: 0,
| vpeakvolOne: 0,
| vpeakvolThree: 0,
| vpeakvolTwo: 0,
| workstateFive: 0,
| workstateFour: 0,
| workstateOne: 0,
| workstateThree: 0,
| workstateTwo: 0,
| battGroupId: 0,
| devId: 0,
| num: 40,
| },
| }
| },
| methods: {
| changeGroupNum() { // 改变某块编号
| let groupNum = this.getCuringGroupNum(this.params.groupNum);
| Object.keys(this.allData).forEach(key => {
| if (key.indexOf(groupNum) != -1) {
| Object.keys(this.params).forEach(jkey => {
| if ((jkey + groupNum) == key) {
| this.params[jkey] = this.allData[key];
| }
| });
| }
| });
| },
| getCuringGroupNum(group) {
| let groupNum = null;
| group = Number(group);
| switch (group) {
| case 0:
| case 1:
| groupNum = 'One';
| break;
| case 2:
| groupNum = 'Two';
| break;
| case 3:
| groupNum = 'Three';
| break;
| case 4:
| groupNum = 'Four';
| break;
| case 5:
| groupNum = 'Five';
| break;
| }
| return groupNum;
| },
| search() {
| let batt = this.batt;
| realTimeStateList(batt.battGroupId).then(res => {
| res = res.data;
| if (res.code && res.data) {
| this.allData = res.data;
| // 设置值
| this.changeGroupNum();
| }
| }).catch(error => {
| console.log(error);
| });
| },
| // 停止养护除硫
| stopCuring() {
| let batt = this.batt;
| let groupNum = this.params.groupNum;
| let battGroupNum = batt.groupIndexInFBSDevice;
| this.$layer.confirm('确定停止养护/除硫', {icon: 3}, index => {
| // 关闭确认框
| this.$layer.close(index);
| let loading = this.$layer.loading(1);
| curingControl({
| devId: batt.fbsdeviceId,
| groupNum,
| battGroupNum
| })
| .then((res) => {
| res = res.data;
| this.$layer.msg(res.msg);
| // 关闭等待框
| this.$layer.close(loading);
| })
| .catch((error) => {
| // 关闭等待框
| this.$layer.close(loading);
| });
| });
| },
| },
| 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,
| }
| }
| },
| mounted() {
| // 查询当前养护除硫信息
| this.search();
| }
| }
| </script>
|
| <style scoped>
|
| </style>
|
|