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
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
<template>
    <flex-layout direction="row" class="page-real-time" :no-bg="true">
        <!-- 充放电一体机一期 -->
        <content-box style="margin-left: 4px; margin-right: 4px;" :title="battFullName">
            <div slot="box-tools" class="box-tools">
                <el-tooltip class="item" effect="dark" content="历史数据" placement="bottom">
                    <i class="iconfont el-icon-jinru" @click="syncPage"></i>
                </el-tooltip>
            </div>
            <!-- <div slot="box-tools" class="box-tools" style="right: 40px;">
                <el-tooltip class="item" effect="dark" content="历史实时数据" placement="bottom">
                    <i class="el-iconfont el-icon-s-marketing" @click="historyRealTimeDataDialog.show=true"></i>
                </el-tooltip>
            </div> -->
            <flex-layout :no-bg="true">
                <div class="content-header" slot="header" :model="inputs">
                    <div class="table-layout">
                        <div class="table-row">
                            <div class="table-cell text-right w80">电池状态:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.batt_state" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">端电压:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.group_online_vol" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">电池电流:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.group_curr" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">更新日期:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.rec_datetime" size="small" :disabled="true"></el-input>
                            </div>
                        </div>
                        <div class="table-row">
                            <div class="table-cell text-right w80">测试时长:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.batt_test_tlong" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">测试容量:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.batt_test_cap" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">剩余容量:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.batt_syrl_cap" size="small" :disabled="true"></el-input>
                            </div>
                            <div class="table-cell text-right w80">续航时长:</div>
                            <div class="table-cell">
                                <el-input :value="backInputs.sysc" size="small" :disabled="true"></el-input>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="page-content">
                    <div class="page-content-tools" v-if="control.show && isCanTest">
                        <el-popover placement="bottom" trigger="hover">
                            <div class="hdw-menu-list">
                                <ul>
                                    <li class="hdw-menu-item" v-if="control.data.startCharge.show">
                                        <a @click="boot('charge')" href="javascript:void(0);">启动充电</a>
                                    </li>
                                    <li class="hdw-menu-item" v-if="control.data.stopCharge.show">
                                        <a @click="stopCharge" href="javascript:void(0);">停止充电</a>
                                    </li>
                                    <li class="hdw-menu-item" v-if="control.data.startDischarge.show">
                                        <a @click="boot('discharge')" href="javascript:void(0);">启动放电</a>
                                    </li>
                                    <li class="hdw-menu-item" v-if="control.data.stopDischarge.show">
                                        <a @click="stopDischarge" href="javascript:void(0);">停止放电</a>
                                    </li>
                                    <li class="hdw-menu-item" v-if="control.data.startActivate.show">
                                        <a @click="boot('activate')" href="javascript:void(0);">启动活化</a>
                                    </li>
                                    <li class="hdw-menu-item" v-if="control.data.stopActivate.show">
                                        <a @click="stopActivate" href="javascript:void(0);">停止活化</a>
                                    </li>
                                    <li class="hdw-menu-item" v-if="control.data.clearAlerm.show">
                                        <a @click="clearAlerm" href="javascript:void(0);">清除告警</a>
                                    </li>
                                    <li class="hdw-menu-item" v-if="control.data.clearAlerm.show">
                                        <a @click="showVideoDialog" href="javascript:void(0);">内窥镜</a>
                                    </li>
                                    <!-- <li class="hdw-menu-item" v-if="control.data.pause.show">
                                        <a @click="pause(type)" href="javascript:void(0);">暂停{{typeStr}}}</a>
                                    </li> -->
                                </ul>
                            </div>
                            <button class="hdw-btn transparentBtn" slot="reference">
                                <span class="light-color">远程管理</span>
                                <i class="hdw-icon el-icon-caret-bottom"></i>
                            </button>
                        </el-popover>
                    </div>
                    <el-tabs v-model="acTabs" type="border-card" class="flex-layout noborder" @tab-click="tabClick">
                        <el-tab-pane label="电路拓扑图" class="tab-eleLine" name="eleLine">
                            <div class="left">
                                <science-box :top="8" class="panel-box" :left="8" no-header>
                                    <div class="hdw-state-list table-layout">
                                        <div v-for="state in stateList"
                                            :key="state.text"
                                            v-show="state.show"
                                            class="table-row" :class="state.type">
                                            <div class="table-cell text-right">
                                                <i v-if="state.icon" class="iconfont" :class="state.icon"></i>{{ state.text }}
                                            </div>
                                            <div class="table-cell" v-if="state.name == 'alarm'">
                                                <hdw-light
                                                    class="ywbj"
                                                    :type="state.value"
                                                    ></hdw-light>
                                            </div>
                                            <div v-else class="table-cell">
                                                {{ state.value }}{{ state.unit }}
                                            </div>
                                        </div>
                                    </div>
                                        <!-- 确认烟雾报警 -->
                                        <div v-if="confirmBtnShow" class="row">
                                            <el-button @click="confirmAlarm" type="primary" size="mini">确认烟雾报警</el-button>
                                        </div>
                                </science-box>
                                <!-- <science-box :top="8" :left="8" class="panel-box second" no-header>
                                    <div class="hdw-state-list table-layout">
                                    </div>
                                </science-box> -->
                            </div>
                            <circuit-diagram
                                ref="circuitDiagram"
                                :width="diagramOpt.width"
                                :height="diagramOpt.height"
                                wrap-class="wrap"
                                :levelArr="['staticL', 'stateL', 'flushL']"
                                @ratioChanged="ratioChanged"
                                @debugClick="debugClick"
                                >
                                <div class="info-panel title" :style="getStyle('title', ratio)">{{diagram.desc}}</div>
                                <div class="info-panel strong" :style="getStyle('batts', ratio)">
                                    <div class="">{{inputs.group_vol}} V</div>
                                    <div class="">{{inputs.group_curr}} A</div>
                                </div> 
                                <div class="info-panel strong" :style="getStyle('online', ratio)">
                                    <div class="">{{backInputs.dev_captest_onlinevol}} V</div>
                                </div>
                                <!-- 电感线圈充能动画 -->
                                <div :class="['ani-panel', {'charge': flag && isCharge, 'disCharge': flag && !isCharge}]" :style="getStyle('inductance', ratio)"></div>
                                <div slot="mask"
                                    v-if="-1 == diagram.type || 1 == diagram.type || 3 == diagram.type"
                                    :class="['mask', 'iconfont', {'el-icon-duankailianjie': diagram.type == -1, 'el-icon-zanting': diagram.type == 1 || diagram.type == 3}]"
                                    ></div>
                            </circuit-diagram>
                        </el-tab-pane>
                        <el-tab-pane label="电压" name="vol">
                            <bar-chart ref="vol" id="vol" unit="V" right-menu></bar-chart>
                        </el-tab-pane>
 
                        <el-tab-pane label="数据表格" name="tblData" class="el-table-wrapper">
                            <el-table
                                stripe
                                size="small"
                                :data="table.datas"
                                height="100%">
                                <el-table-column
                                    v-for="header in table.headers"
                                    :key="header.prop"
                                    :prop="header.prop"
                                    :label="header.label"
                                    :width="header.width"
                                    align="center"></el-table-column>
                            </el-table>
                        </el-tab-pane>
                    </el-tabs>
                </div>
            </flex-layout>
        </content-box>
        <!-- 活化参数设置 -->
        <el-dialog :title="dialogTitle" width="800px" :visible.sync="dialog.show" :close-on-click-modal="false"
                   top="0" class="dialog-center" :modal-append-to-body="false">
            <activate-dialog-content v-if="dialog.show" :type="dialog.type" :batt="batt" @startok="dialog.show = false"></activate-dialog-content>
        </el-dialog>
        <el-dialog title="内窥镜" width="800px" :visible.sync="videoDialog.show" :close-on-click-modal="false"
                   top="0" class="dialog-center" :modal-append-to-body="false">
            <endoscope-video v-if="videoDialog.show"></endoscope-video>
        </el-dialog>
        <!-- 停电放电确认 -->
        <el-dialog :title="confirmDialog.title" width="480px" :visible.sync="confirmDialog.show" :close-on-click-modal="false"
                   top="0" class="dialog-center dialog-confirm" :modal-append-to-body="false"
                   :close-on-press-escape="false" :before-close="confirmStop">
            <div class="content">当前设备在线电压低(&lt;51.5V),是否确认停止放电?</div>
            <div class="" slot="footer">
                <el-button type="primary" size="mini" @click="confirmStop(1)">确认</el-button>
                <el-button type="warning" size="mini" @click="confirmStop(0)">取消</el-button>
            </div>
        </el-dialog>
    </flex-layout>
</template>
 
<script>
import ContentBox from "@/components/ContentBox";
import BarChart from "@/components/chart/BarChart";
import ActivateDialogContent from './components/activateDialogContent';
import {
    realTimeSearch,
    realTimeGroup,
    realTimePowerOff,
    realTimeAlarm
} from '@/assets/js/realTime';
 
import {
    Timeout,
    getBarNum,
    sethoubeiTime,
    regEquipType,
    formatSeconds,
    isHasPermit
} from '@/assets/js/tools';
 
import {
    list
    ,panelPos
    // ,resetFirstTime
    ,update
    ,updateBalls
    ,stop
} from './js/draw_diagram_old';
 
import battGroupMager from '@/assets/js/apis/dataMager/battGroupMager';
import getMarkLineData from "@/components/chart/js/getMarkLineData";
 
import CircuitDiagram from '@/components/diagram/diagram';
import ScienceBox from "@/components/ScienceBox";
 
import Diagram from '@/components/diagram/js/diagram';
import common from '@/components/diagram/js/common';
let interval = common.interval;
 
import {
    const_aio
} from '@/assets/js/const';
import RtmpVideo from "@/components/rtmpVideo";
import EndoscopeVideo from "@/pages/dataTest/components/endoscopeVideo";
import HdwLight from '../dataMager/components/HdwLight.vue';
 
let vol, resChart, conduct, currChart, leakVol;
let staticL, stateL, flushL;
let tblData = [];
let ballList = [];
export default {
    name: "realTimeAio",
    components: {
        EndoscopeVideo,
        RtmpVideo,
        ContentBox,
        BarChart,
        ScienceBox,
        ActivateDialogContent,
        CircuitDiagram,
        HdwLight
    },
    watch: {
        "$route.params.BattGroupId"(BattGroupId) {
            // console.log('watch', BattGroupId);
            this.$nextTick(()=>{
                this.getBattGroupInfo(BattGroupId);
            });
        },
        "$store.state.theme.collapse"() {
        //   console.log(123);
          this.$nextTick(()=>{
            this.resize();
          });
        },
        'diagram.type' (n) {
            if (n == 2 || n ==4) {
                this.flag = true;
                this.resetState();
            } else {
                this.flag = false;
            }
        }
    },
    data () {
        let permits = this.$store.state.user.permits;
        let isCanTest = isHasPermit('batt_test_op_permit', permits);
        let stateList = const_aio.stateList0;
        return {
            acTabs: "eleLine",
            isCanTest: isCanTest,
            dialogTitle: '充电参数设置',
            type: '',       // 当前状态 charge discharge activate
            moveBall: null,
            stateList: stateList,
            // k4状态
            main: false,
            confirmBtnShow: 0,
            ratio: 1,
            // 上次停止原因
            lastStopReason: '',
            /* 电池状态 模块 组端展示 */
            dev_captest_onlinevol: 0,   // 在线模块在线电压
            inputs: {
                group_vol: 0 /* 端电压-组端电压 */ ,
                online_vol: 0 /* 端电压-在线电压 */ ,
                group_curr: 0 /* 电池电流 */ ,
                batt_test_tlong: "0:00:00" /* 测试时长 */ ,
                rec_datetime: 0 /* 更新日期 */ ,
                batt_test_cap: 0 /* 测试容量 */ ,
                batt_rest_cap: 0, // 剩余容量
                batt_state: 0 /* 电池状态 */
            },
            control: {
                show: true,
                data: {
                    startCharge: { // 启动充电
                        show: true,
                        typeShow: false,
                        id: 11,
                    },
                    stopCharge: { // 停止充电
                        show: true,
                        typeShow: false,
                        id: 12
                    },
                    startDischarge: { // 启动放电
                        show: true,
                        typeShow: false,
                        id: 13
                    },
                    stopDischarge: { // 停止放电
                        show: true,
                        typeShow: false,
                        id: 14
                    },
                    startActivate: { // 启动活化
                        show: true,
                        typeShow: false,
                        id: 15
                    },
                    stopActivate: { // 停止活化
                        show: true,
                        typeShow: false,
                        id: 16
                    },
                    clearAlerm: {
                        show: true,
                        typeshow: false,
                        id: 17
                    }
                }
            },
            dialog: {
                show: false,
                type: ''
            },
            confirmDialog: {
                show: false,
                title: '停电放电提示'
            },
            timer: new Timeout('movingRingSysteRrealTime'),
            timer2: new Timeout(),
            table: {
                headers: [
                    {
                        prop: "num1",
                        label: "单体编号",
                        width: ""
                    },
                    {
                        prop: "vol1",
                        label: "电压(V)",
                        width: ""
                    },
                    // {
                    //     prop: "temp1",
                    //     label: "温度(℃)",
                    //     width: ""
                    // },
                ],
                datas: []
            },
            batt: {},
            diagram: {
                update: true,
                type: -1,
                desc: "",
                powerCut: 1,
                temp: 0 // 设备温度
            },
            diagramOpt: {
                width: 1300,
                height: 760,
            }
            ,sta: {
                Q1: false
                ,Q2: false
                ,Q3: false
                ,Q4: false
                ,Q5: false
            },
            videoDialog: {
                show: false,
            },
            // 储能状态
            isCharge: true,
            count: 0,
            flag: false
        }
    },
    computed: {
        battFullName () {
            let batt = this.batt;
            if (batt.StationName && batt.BattGroupName) {
                return batt.StationName + '-' + batt.BattGroupName;
            }
            return "电池组全称";
        },
        backInputs() {
            const obj = {
                    0: "未知",
                    1: "浮充",
                    2: "充电",
                    3: "放电",
                    4: "均充",
                },
                list = {
                    batt_state: "未知",
                    group_online_vol: "在线:0.00V; 组端:0.00V",
                    dev_captest_onlinevol: 0,   // 在线模块在线电压
                    group_curr: "0.00A",
                    rec_datetime: "1982-01-01 00:00:00",
                    batt_test_tlong: formatSeconds(0),
                    batt_test_cap: "0Ah",
                    batt_syrl_cap: "---",
                    sysc: "------"
                };
            if (this.diagram.type == -1) {
                return list;
            }
            let batt_state_text = this.diagram.powerCut?"停电放电":obj[this.inputs.batt_state];
            list.batt_state = batt_state_text + '(' + this.diagram.desc + ')';
            list.group_online_vol =
                `在线:${this.inputs.online_vol.toFixed(2)}V; 组端:${this.inputs.group_vol.toFixed(2)}V`;
            list.group_curr = this.inputs.group_curr.toFixed(2) + "A";
            list.rec_datetime = this.inputs.rec_datetime;
            list.batt_test_tlong = formatSeconds(this.inputs.batt_test_tlong);
            list.dev_captest_onlinevol = this.dev_captest_onlinevol; 
 
            list.batt_test_cap = this.inputs.batt_test_cap.toFixed(1) + "AH";
            if (this.inputs.batt_state === 2) {
                list.batt_syrl_cap = "---";
            } else {
                list.batt_syrl_cap = this.inputs.batt_rest_cap.toFixed(1) + "AH";
            }
            if (this.inputs.batt_state === 3) {
                list.sysc = sethoubeiTime(
                    parseFloat(this.inputs.batt_rest_cap) /
                    parseFloat(this.inputs.group_curr)
                );
            } else {
                list.sysc = "------";
            }
            return list;
        },
    },
    methods: {
        resize() {
            // if(this.acTabs === "powerInfo") {
            //     this.powerInfoChartResize();
            // }else {
            //     this.$G.chartManage.resize(this.acTabs);
            // }
            this.$G.chartManage.resize(this.acTabs);
        },
        tabClick(tab) {
            // 根据tab更新电路图
            if(this.acTabs === "eleLine") {
                this.$refs.circuitDiagram.resizeHandle();
                this.timer2.restart();
            } else {
                this.timer2.stop();
            }
            // 更新图表
            this.setChart();
 
            // 重置图表的大小
            this.$nextTick(() => {
                this.resize();
                // 设置表格的数据
                if(this.acTabs == "tblData") {
                    this.table.datas = tblData;
                }
            });
        },
        initChart() {
            // 电压
            vol = {
                title: {
                    show: true,
                    text: "最大值=0V;最小值=0V;平均值=0V",
                    x: "center",
                    textStyle: {
                        fontSize: "14"
                    }
                },
                series: [{
                    name: "电压",
                    type: "bar",
                    data: [],
                    markLine: {
                      data: getMarkLineData(),
                    },
                }]
            };
            // 漏液电压
            leakVol = {
                title: {
                    show: true,
                    text: "最大值=0V;最小值=0V;平均值=0V",
                    x: "center",
                    textStyle: {
                        fontSize: "14"
                    }
                },
                series: [{
                    name: "漏液电压",
                    type: "bar",
                    data: [],
                }]
            };
 
            // 内阻
            resChart = {
                title: {
                    show: true,
                    text: "最大值=0mΩ;最小值=mΩ;平均值=0mΩ",
                    x: "center",
                    textStyle: {
                        fontSize: "14"
                    }
                },
                series: [{
                    name: "内阻",
                    type: "bar",
                    data: [],
                    markLine: {
                      data: getMarkLineData(),
                    },
                }]
            };
 
 
            // 电导
            conduct = {
                title: {
                    show: true,
                    text: "最大值=0;最小值=0;平均值=0",
                    x: "center",
                    textStyle: {
                        fontSize: "14"
                    }
                },
                series: [{
                    name: "电导",
                    type: "bar",
                    data: [],
                    markLine: {
                      data: getMarkLineData(),
                    },
                }]
            };
            // 均衡电流
            currChart = {
                title: {
                    show: true,
                    text: "最大值=0mA;最小值=0mA;平均值=0mA",
                    x: "center",
                    textStyle: {
                        fontSize: "14"
                    }
                },
                series: [{
                    name: "均衡电流",
                    type: "bar",
                    data: []
                }]
            };
            // 设置配置项
            this.setChart();
        },
        setChart() {
            let acTabs = this.acTabs;
            switch(acTabs) {
                case 'vol':
                    this.$refs.vol.setOption(vol);
                    break;
            }
        },
        getBattGroupInfo(BattGroupId) {
            // console.log(BattGroupId, 'battGroupId');
            this.$apis.dataMager.battGroupMager.getBattGroupInfo(BattGroupId).then(res=>{
                let rs = JSON.parse(res.data.result);
                // console.log(rs, 'rs');
                if(rs.code == 1) {
                    this.leafClick(rs.data[0]);
                }else {
                    this.$layer.msg('未获取到电池组的信息');
                }
            }).catch(error=>{
                console.log(error);
            });
        },
        leafClick(data) {
            this.batt = data;
            this.diagram.desc = "";
            this.realTimeAlarmss();
            // 开启循环请求
            this.startTimer();
        },
        realTimeAlarmss() {
            var batt = this.batt;
            realTimeAlarm({
                dev_id: batt.FBSDeviceId
            }).then(res => {
              let rs = JSON.parse(res.data.result);
              if(rs.code == 1) {
                let list = rs.data;
                // 单体电压
                this.setChartMarkLine(vol, "Voltage", "Batt_Alarm_Type_MonVol", list);
              }
            });
        },
        setChartMarkLine(chartData, name, alm_name, list) {
          let batt = this.batt;
          // 遍历list
          for(let i=0; i<list.length; i++) {
            let item = list[i];
            if(item.alm_name == alm_name) {
              let high = 0;
              let low = 0;
              switch (name) {
                case "Voltage":      // 电压告警
                  //单体电压
                  let std_mon_vol = batt.MonVolStd;
                  high = parseFloat(std_mon_vol*item.alm_high_coe).toHold(3);
                  low = parseFloat(std_mon_vol*item.alm_low_coe).toHold(3);
                  break;
                case "Temperature":
                  //单体温度
                  let std_mon_tmp = 25;
                  high = parseFloat(std_mon_tmp*item.alm_high_coe).toHold(1);
                  low = parseFloat(std_mon_tmp*item.alm_low_coe).toHold(1);
                  break;
              }
              // 低告警
              chartData.series[0].markLine.data[0].yAxis = low;
              // 高告警
              chartData.series[0].markLine.data[1].yAxis = high;
              break;
            }
          }
        },
        /* echars图表 */
        realTimeSearch() {
            var batt = this.batt;
            realTimeSearch({
                BattGroupId: batt.BattGroupId
            }).then(res => {
                let rs = JSON.parse(res.data.result);
                // console.log(rs, 'rs===========');
                let data = [];
                if (rs.code == 1) {
                    let temp0 = const_aio.getItemByName('temp0', this.stateList).value;
                    data = rs.data.map((item, i) => {
                        if (i < 3) {
                            // console.log('===', temp0, 'temp0', item.mon_tmp);
                            // this.stateList[i + 2].value = item.mon_tmp;
                            this.setStateList('temp' + (i + 1), item.mon_tmp, item.mon_tmp > temp0 ? 'alarm' : '');
                        }
                        return {
                            num1: "#" + item.mon_num,
                            vol1: item.mon_vol,
                            res1: item.mon_res,
                            temp1: item.mon_tmp,
                            conduct1: item.mon_res ? (1 / item.mon_res * 1000).toFixed(0) : 0,
                            curr1: item.mon_JH_curr,
                            leakVol1:item.mon_LY_vol
                        };
                    });
                }
                // 更新表格
                if(this.acTabs == 'tblData') {
                    this.table.datas = data;
                }else {
                    tblData = data;
                }
 
                // 电压值
                let volTempVol = [];
                if (rs.code == 1) {
                    volTempVol = rs.data.map(item => {
                        return ["#" + item.mon_num, item.mon_vol];
                    });
                }
                let volBarNum = getBarNum(volTempVol);
                vol.title.text = "最大值=" + volBarNum.max.toFixed(2) + "V;最小值=" + volBarNum.min.toFixed(2) + "V;平均值=" + volBarNum.avg
                    .toFixed(2) + "V";
                vol.series[0].data = volTempVol;
 
                // 更新电压图表
                this.setChart();
            });
        },
        // 向父级发送同步页面的指令
        syncPage() {
            let batt = this.batt;
            let search =
                "?province=" +
                batt.StationName1 +
                "&city=" +
                batt.StationName2 +
                "&county=" +
                batt.StationName5 +
                "&home=" +
                batt.StationName3 +
                "&batt=" +
                batt.BattGroupId;
            window.parent.postMessage({
                    cmd: "syncPage",
                    params: {
                        pageInfo: {
                            label: "历史数据",
                            name: "history",
                            src: "#/history" + search,
                            closable: true
                        }
                    }
                },
                "*"
            );
        },
        // 设置stateList的值
        setStateList(name, value, type, show) {
            show = undefined === show ? true : show;
            let stateList = this.stateList;
            for (let i = 0; i < stateList.length; i++) {
                let state = stateList[i];
                if (state.name == name) {
                    state.value = value;
                    state.type = type ? type : "";
                    state.show = show;
                }
            }
        },
        /* 实时组端信息 */
        realTimeGroupss() {
            var batt = this.batt;
            realTimeGroup(batt.BattGroupId).then(res => {
                let rsa = JSON.parse(res.data.result);
                // console.log(rsa, '??', rsa.data[0]);
                if (rsa.code == 1) {
                    this.inputs = rsa.data[0];
                    // console.log(this.inputs.rec_datetime, '更新时间');
                }
            });
        },
        /* 查询电路图开关状态和信息 */
        realTimePowerOffs() {
            let batt = this.batt;
 
            // 查询后台数据
            realTimePowerOff({
                dev_id: batt.FBSDeviceId
            }).then(res => {
                let rs = JSON.parse(res.data.result);
                // console.log('状态:', rs);
                let outTime = 2 * 60; //设备超时时间(2分钟)
                let isOutTime = true; //通讯中断        判断设备是否通讯中断    true:中断    false:正常
                if (rs.code == 1) {
                    let data = rs.data[0];
                    // 烟感报警 > 0为报警状态
                    // this.stateList[4].value = data.dev_temp > 0 ? 1 : 0;
                    this.setStateList('alarm', data.dev_temp > 0 ? 1 : 0);
                    this.confirmBtnShow = data.dev_res_test_state;
                    // 当值大于0x80之后 这边需要减去0x80之后再对应下表并把上次停止原因标红
                    let reason = data.dev_last_captest_stop_type;
                    let alarm = false;
                    if (reason > 0x80) {
                        alarm = true;
                        reason -= 0x80;
                    }
                    this.setStateList('stopreason', const_aio.stopreasons0[reason], alarm ? 'alarm' : '');
                    // console.log(data, 'rt');
                    // 如果dev_alarmstate的值为1则弹窗
                    if (data.dev_alarmstate == 1) {
                        this.confirmDialog.show = true;
                    }
                    // 判断是否超时
                    var nowTime = new Date(data.note).getTime(); //当前时间
                    var record = new Date(data.record_datetime).getTime();
                    if (Math.abs(nowTime - record) / 1000 > outTime) {
                        this.disconnect();
                    } else {
                        // 未超时执行逻辑
                        // 基础信息
                        this.setEquipBase(data);
 
                        let dev_id = batt.FBSDeviceId;
                        this.diagram.powerCut = 0;
                        //
                        this.diagram.type = data.dev_workstate;
                        // 活化状态
                        let workstates = (data.dev_batt_xuhang_tlong > 0 ? '活化 ' : '') + const_aio.workstates[data.dev_workstate];
                        this.diagram.desc = workstates;
                        this.setStateList('workState', workstates);
                        // 活化阶段
                        if (data.dev_batt_xuhang_tlong > 0) {
                            let str = data.dev_restest_monindex + '/' + data.dev_restest_moncount;
                            this.setStateList('activateCounter', str, '', true);
                        } else {
                            this.setStateList('activateCounter', '', '', false);
 
                        }
                        // 如果是充电 则显示充电类型
                        if (data.dev_workstate == 4) {
                            let chargeType = const_aio.chargeType[data.dev_eachgroup_battsum];
                            this.setStateList('chargeType', chargeType, '', true);
                        } else {
                            this.setStateList('chargeType', '', '', false);
                        }
                        this.main = !data.batt_online_state;
                        this.dev_captest_onlinevol = data.dev_captest_onlinevol;
                    }
                } else {
                    // 设备处于未连接
                    this.disconnect();
                }
            });
        },
        disconnect() {
            // 设备未连接
            this.diagram.type = -1;
            this.setStateList("workState", "未连接");
            this.diagram.desc = '设备未连接';
            this.main = false;
        },
        // 基础信息
        setEquipBase(data) {
            // 设备的温度
            this.diagram.temp = data.dev_temp;
        },
        startTimer() {
            this.timer.start(() => {
                this.$axios
                    .all([
                        this.realTimeSearch(),
                        this.realTimeGroupss(),
                        this.realTimePowerOffs(),
                        this.getTempLimit()
                    ])
                    .then(() => {
                        this.timer.open();
                    })
                    .catch(() => {
                        this.timer.open();
                    });
            }, 3000);
        },
        // 获取温度报警阀值
        getTempLimit () {
            this.$apis.aio.realtime.getTempLimit(this.batt.FBSDeviceId).then((res) => {
                res = JSON.parse(res.data.result);
                // this.setStateList('temp0', 1);
                // console.log(res, '==res');
                if (res.code) {
                    this.setStateList('temp0', res.data[0].CharHighTmp);
                }
            }).catch((err) => {
                console.error(err);
            });
        },
        monitorPage() {
            // 获取缓存的session
            let name = sessionStorage.getItem('acTabs');
            // console.log(name, 'session acTabs');
            if(name === "movingRingSystemRealTime" && this.acTabs === "eleLine") {
                this.diagram.update = true;
            }else {
                this.diagram.update = false;
            }
            // 启动监控
            requestAnimationFrame(()=>{
                this.monitorPage();
            });
        },
        stopCharge () {
            // console.log('stopcharge');
            this.$layer.confirm(
                "停止充电", {
                    icon: 3,
                },
                (index) => {
                    // 关闭询问层
                    this.$layer.close(index);
                    let loading = this.$layer.loading();
                    this.$apis.aio.realtime.sendCmd({
                        dev_id: this.batt.FBSDeviceId,
                        op_cmd: const_aio.cmd.stopCharge
                    }).then((res) => {
                        res = JSON.parse(res.data.result);
                        this.$layer.close(loading);
                        // console.log(res, 'res');
                        if (res.code) {
                            this.$layer.msg('停止充电成功!');
                        } else {
                            this.$layer.msg('停止充电失败!');
                        }
                    }).catch((err) => {
                        this.$layer.close(loading);
                        console.log(err);
                        this.$layer.msg('停止充电失败, 请求异常!');
                    });
                }
            );
        }
        ,stopDischarge () {
            // console.log('stopdischarge');
            this.$layer.confirm(
                "停止放电", {
                    icon: 3,
                },
                (index) => {
                    // 关闭询问层
                    this.$layer.close(index);
                    let loading = this.$layer.loading();
                    this.$apis.aio.realtime.sendCmd({
                        dev_id: this.batt.FBSDeviceId,
                        op_cmd: const_aio.cmd.stopDisCharge
                    }).then((res) => {
                        res = JSON.parse(res.data.result);
                        this.$layer.close(loading);
                        // console.log(res, 'res');
                        if (res.code) {
                            this.$layer.msg('停止放电成功!');
                        } else {
                            this.$layer.msg('停止放电失败!');
                        }
                    }).catch((err) => {
                        this.$layer.close(loading);
                        console.log(err);
                        this.$layer.msg('停止放电失败, 请求异常!');
                    });
                }
            );
        }
        ,stopActivate () {
            // console.log('stopActivate');
            this.$layer.confirm(
                "停止活化", {
                    icon: 3,
                },
                (index) => {
                    // 关闭询问层
                    this.$layer.close(index);
                    let loading = this.$layer.loading();
                    this.$apis.aio.realtime.sendCmd({
                        dev_id: this.batt.FBSDeviceId,
                        op_cmd: const_aio.cmd.stopActivate
                    }).then((res) => {
                        res = JSON.parse(res.data.result);
                        this.$layer.close(loading);
                        // console.log(res, 'res');
                        if (res.code) {
                            this.$layer.msg('停止活化成功!');
                        } else {
                            this.$layer.msg('停止活化失败!');
                        }
                    }).catch((err) => {
                        this.$layer.close(loading);
                        console.log(err);
                        this.$layer.msg('停止活化失败, 请求异常!');
                    });
                }
            );
        }
        // 启动
        ,boot (type) {
            // console.log(type);
            switch (type) {
                case 'charge':
                    this.dialogTitle = '充电参数设置';
                    break;
                case 'discharge':
                    this.dialogTitle = '放电参数设置';
                    break;
                case 'activate':
                    this.dialogTitle = '活化参数设置';
                    break;
            }
            this.dialog.type = type;
            this.dialog.show = true;
        }
        // 暂停
        // ,pause (type) {
        //     console.log('暂停', type)
        // }
        ,clearAlerm () {
            // console.log('clearAlerm');
            // 清除告警
            this.$layer.confirm(
                "清除设备告警", {
                    icon: 3,
                    title: "系统提示",
                },
                (index) => {
                    // 关闭弹出框
                    this.$layer.close(index);
                    // 开启加载等待
                    let load = this.$layer.loading(1);
                    // 执行清除告警
                    let batt = this.batt;
                    this.$apis.system
                        .clearWarn(batt.FBSDeviceId)
                        .then((res) => {
                            let rs = JSON.parse(res.data.result);
                            // console.log('??', rs);
                            if (rs.code == 1) {
                                this.$layer.msg("清除设备告警成功!");
                            } else {
                                this.$layer.msg("清除设备告警失败!");
                            }
                            // 关闭等待
                            this.$layer.close(load);
                        })
                        .catch((error) => {
                            console.log(error);
                            // 关闭等待
                            this.$layer.close(load);
                        });
                }
            );
        }
        ,ratioChanged (ratio) {
            // console.log(ratio);
            this.ratio = ratio;
            staticL && staticL.setRatio(ratio);
            flushL && flushL.setRatio(ratio);
            stateL && stateL.setRatio(ratio);
        }
        ,init () {
            // console.log(this.$refs.circuitDiagram);
            let circuitDiagram = this.$refs.circuitDiagram;
            // console.log(circuitDiagram.$refs.staticL[0]);
            // debugger;
            let opts = {
                count: 60
            };
            staticL = new Diagram(circuitDiagram.$refs.staticL[0], opts);
            stateL = new Diagram(circuitDiagram.$refs.stateL[0], opts);
            flushL = new Diagram(circuitDiagram.$refs.flushL[0], opts);
            this.moveBall = updateBalls(flushL, ballList);
        }
        ,drawStatic () {
            staticL.importObjList(list);
            // drawPanel(staticL);
            staticL.drawAll();
        }
        ,drawFlush () {
            
        }
        // 调试时的点击
        ,debugClick (o) {
            let point = {
                x: o.offsetX
                ,y: o.offsetY
            };
            let inObj = staticL.mousePointInObj([point.x, point.y], undefined);
            let canvas_obj_id_arr = staticL.getObjIdArr();
            let canvas_obj = staticL.getObjList();
            if (inObj) {
                for (let i = 0, j = canvas_obj_id_arr.length; i < j; i++) {
                let id = canvas_obj_id_arr[i];
                let _inObj = staticL.mousePointInObj([point.x, point.y], id);
                if (_inObj) {
                    let _obj = canvas_obj[id];
                    console.log('----obj', _obj, id);
                    break;
                }
                }
            }
        }
        
        ,loop () {
            this.timer2.start(() => {
                // console.log('loop');
                this.count++;
                // 两秒切换一次状态
                if (this.count == 2) {
                    this.count = 0;
                    this.isCharge = !this.isCharge;
                }
                update(this.moveBall, stateL, {
                        state: this.diagram.type,
                        main: this.main,
                        onlineVol: this.backInputs.dev_captest_onlinevol,
                        groupVol: this.inputs.group_vol,
                        isCharge: this.isCharge
                    }, ballList);
                this.timer2.open();
                
            }, 1000);
        }
        ,getStyle (type, ratio) {
            if (!staticL) {
                return {};
            }
           let pos = panelPos[type];
          //  let ratio = staticL.ratio;
           return {
               top: pos.top * ratio + 'px'
               ,left: pos.left * ratio + 'px'
               ,width: pos.width * ratio + 'px'
               ,height: pos.height * ratio + 'px'
           }
        },
        showVideoDialog() {
            this.videoDialog.show = true;
        },
        // 确认烟雾告警
        confirmAlarm () {
            this.$apis.aio.realtime.confirmAlarm(this.batt.FBSDeviceId).then((res) => {
                res = JSON.parse(res.data.result);
                // console.log(res, 'confirm');
            }).catch((err) => {
                console.error(err);
            });
        },
        // 停电放电确定
        confirmStop (num) {
            // console.trace('confirm');
            // console.log(num, '==');
            num = typeof (num) == 'function' ? 0 : num;
            let loading = this.$layer.loading(1);
            this.$apis.aio.realtime.confirmStop({
                dev_id: this.batt.FBSDeviceId
                ,num: num
            }).then((res) => {
                this.$layer.close(loading);
                res = JSON.parse(res.data.result);
                // console.log(num, res);
                if (res.code) {
                    this.confirmDialog.show = false;
                }
                this.$layer.msg(res.msg);
            }).catch((err) => {
                this.$layer.close(loading);
                console.error(err);
            });
        },
        resetState () {
            this.count = 0;
            this.isCharge = true;
        }
    },
    mounted() {
        // console.log(this.$route.params, 'mounted');
        let BattGroupId = this.$route.params.BattGroupId;
        this.getBattGroupInfo(BattGroupId);
        this.initChart();
        this.$nextTick(() => {
            this.$G.chartManage.resize(this.acTabs);
        });
        // 屏幕缩放时触发
        window.addEventListener('resize', this.resize);
        // 监控是否已经切换到当前页面
        this.monitorPage();
 
        this.init();
        interval(this.drawStatic, 100, 50);
        // this.drawStatic();
        this.loop();
        this.timer2.open();
    },
    beforeDestroy () {
        this.timer.stop();
        this.timer2.stop();
        stop();
    }
}
</script>
 
<style scoped>
.page-real-time {
    color: #ffffff;
}
.table-row .table-cell {
    padding-top: 12px;
    vertical-align: middle;
}
.page-content {
    position: relative;
    padding-top: 8px;
    padding-bottom: 2px;
    box-sizing: border-box;
    height: 100%;
}
.page-content-tools {
    position: absolute;
    top: 14px;
    right: 8px;
    z-index: 99;
}
 
.hdw-btn {
    display: inline-block;
    color: #fff;
    background-color: #409eff;
    border-color: #409eff;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-appearance: none;
    text-align: center;
    box-sizing: border-box;
    outline: none;
    margin: 0;
    transition: 0.1s;
    font-weight: 500;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 4px;
}
 
.hdw-btn:hover {
    background-color: #3c91e6;
}
 
.hdw-menu-list {
    border: 1px solid #409eff;
}
 
.hdw-menu-list .hdw-menu-item {
    border-top: 1px solid #0e5194;
}
 
.hdw-menu-list .hdw-menu-item:first-child {
    border-top: none;
}
 
.hdw-menu-item a {
    display: block;
    text-align: center;
    padding: 8px;
    color: #ffffff;
    cursor: pointer;
    background-color: rgba(30, 125, 219, 0.767);
}
 
.hdw-menu-item a:hover {
    background-color: rgb(60, 135, 211);
}
 
.hdw-menu-item a:active {
    background-color: rgb(34, 100, 167);
}
.info-panel {
    position: absolute;
    text-align: left;
    /* background: #999; */
}
.info-panel.title {
    text-align: right;
    font-size: 18px;
}
.info-panel.strong {
    font-size: 22px;
    color: #FFE329;
    font-weight: bold;
}
>>> .wrap {
    /* background: rgba(66, 66, 66, 1); */
}
.mask {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .4);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 140px;
    color: rgba(200, 200, 200, .6)
}
.panel-box {
    position: relative;
    display: inline-block;
    align-self: flex-start;
}
.tab-eleLine {
    display: flex;
}
>>> .hdw-light-wrapper {
    justify-content: start;
}
.row {
    text-align: center;
    margin-top: 6px;
}
.alarm .table-cell {
    /* color: #ff5503; */
    color: transparent !important;
    -webkit-animation: ani 1s infinite;
    animation: ani 1s infinite;
    text-shadow: 0 0 0 #ff5503;
}
.left {
    display: inline-block;
}
.second .table-row .table-cell {
    padding-top: 0;
}
.ywbj {
    height: 2.5rem;
}
.ywbj >>> .hdw-light {
    transform: scale(1.6, 1.6);
}
.dialog-confirm >>> .el-dialog {
    background: #fff;
}
.dialog-confirm .content {
    padding: 10px;
}
.ani-panel {
    position: absolute;
}
.ani-panel::before {
    content: '';
    position: absolute;
    background: rgb(127, 255, 127);
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    opacity: 0.8;
}
.ani-panel.charge::before {
    -webkit-animation: charge 2s linear forwards;
    animation: charge 2s linear forwards;
}
.ani-panel.disCharge::before {
    -webkit-animation: disCharge linear 2s forwards;
    animation: disCharge 2s linear forwards;
}
.ani-panel::after {
    content: '';
    position: absolute;
    top: 140%;
    left: 0;
    width: 5em;
    text-align: left;
    color: #00f7f9;
    font-size: 16px;
}
.ani-panel.charge::after {
    content: '储能中...';
}
.ani-panel.disCharge::after {
    content: '释放中...';
    color: #ccc;
}
@-webkit-keyframes charge {
    0% {
        width: 0;
        background: rgb(127, 255, 127);
    }
    50% {
        background: rgb(49, 184, 49);
        width: 50%;
    }
    100% {
        background: rgb(0, 255, 0);
        width: 100%;
    }
}
@keyframes charge {
    0% {
        background: rgb(127, 255, 127);
        width: 0;
    }
    50% {
        background: rgb(49, 184, 49);
        width: 50%;
    }
    100% {
        background: rgb(0, 255, 0);
        width: 100%;
    }
}
@-webkit-keyframes disCharge {
    0% {
        background: rgb(0, 255, 0);
        width: 100%;
    }
    50% {
        background: rgb(49, 184, 49);
        width: 50%;
    }
    100% {
        background: rgb(127, 255, 127);
        width: 0;
    }
}
@keyframes disCharge {
    0% {
        background: rgb(0, 255, 0);
        width: 100%;
    }
    50% {
        background: rgb(49, 184, 49);
        width: 50%;
    }
    100% {
        background: rgb(127, 255, 127);
        width: 0;
    }
}
 
@keyframes ani {
    0%, 20% {
        /* color: #ff5703; */
        text-shadow: 0 0 0 #ff5503;
    }
 
    50% {
        /* color: #ff5703b7; */
        text-shadow: 0 0 0 #ff5703b7;
        /* color: rgba(255, 87, 03, 183); */
    }
 
    80%, 100% {
        text-shadow: 0 0 0 #ffe329aa;
        /* color: #ffe329aa; */
    }
}
@-webkit-keyframes ani {
    0%, 20% {
        text-shadow: 0 0 0 #ff5503;
        /* color: #ff5703; */
    }
    50% {
        text-shadow: 0 0 0 #ff5703b7;
        /* color: #ff5703b7; */
    }
    80%, 100% {
        text-shadow: 0 0 0 #ffe329aa;
        /* color: #ffe329aa; */
    }
}
</style>