wangyanshen
2023-01-11 0acffcc27d165374222737fb7f7b574ece4662cb
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
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
<!--  -->
<template>
  <div style="height: 100%; background-color: transparent">
    <titleBoxVue
      style="background-color: #fff"
      v-if="activeIndex !== 3"
      :title="stepTitleName"
    >
    </titleBoxVue>
    <div
      :style="`width: 100%; height:${
        activeIndex === 3 ? '100%' : 'calc(100% - 80px)'
      } ; padding: ${activeIndex === 3 ? '0' : '10px 0'}`"
    >
      <div
        v-show="activeIndex == 0"
        style="width: 100%; height: 100%; display: flex"
      >
        <left-tree
          :treedata="treeData"
          titleName="泵站列表"
          :defaultExpandedKeys="defaultExpandedKeys"
          :currentNodeKey="currentNodeKey"
          @click="handleNodeClick"
        >
        </left-tree>
        <div class="boxright">
          <titleBoxVue style="background-color: #fff" :title="titleName">
            <template v-slot:right>
              <div style="text-align: left; margin-left: 30px">
                <fks-input
                  style="width: 200px"
                  v-model="searchWord"
                  placeholder="请输入内容"
                ></fks-input>
                <fks-button
                  style="margin-left: 10px"
                  type="primary"
                  icon="fks-icon-search"
                  @click="query"
                  >搜索</fks-button
                >
              </div>
            </template>
          </titleBoxVue>
 
          <fks-table
            stripe
            ref="table"
            :data.sync="tableData"
            style="width: 100%; margin-top: 10px; height: calc(100% - 50px)"
            row-key="id"
            @getExpandNode="getExpand"
            :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
          >
            <fks-table-column prop="name" label="名称" width="180">
            </fks-table-column>
            <fks-table-column prop="No" label="编号" width="180">
            </fks-table-column>
            <fks-table-column prop="type" label="类别" width="180">
            </fks-table-column>
            <fks-table-column prop="code" label="规格" width="180">
            </fks-table-column>
            <fks-table-column prop="model" label="型号" width="180">
            </fks-table-column>
            <fks-table-column prop="status" label="状态" width="180">
            </fks-table-column>
            <fks-table-column prop="note" label="说明"> </fks-table-column>
          </fks-table>
        </div>
      </div>
      <div
        v-show="activeIndex === 1"
        style="width: 100%; height: 100%; display: flex"
      >
        <left-tree
          :treedata="treeData1"
          titleName="测点列表"
          :defaultExpandedKeys="defaultExpandedKeys"
          :currentNodeKey="currentNodeKey"
          @click="handleNodeClick"
        >
        </left-tree>
        <div class="boxright">
          <titleBoxVue style="background-color: #fff" :title="titleName">
            <template v-slot:right>
              <div style="text-align: left; margin-left: 30px">
                <fks-input
                  style="width: 200px"
                  v-model="searchWord"
                  placeholder="请输入内容"
                ></fks-input>
                <fks-button
                  style="margin-left: 10px"
                  type="primary"
                  icon="fks-icon-search"
                  @click="query"
                  >搜索</fks-button
                >
              </div>
            </template>
          </titleBoxVue>
 
          <fks-table
            stripe
            ref="table"
            :data.sync="tableData1"
            style="width: 100%; margin-top: 10px; height: calc(100% - 50px)"
            row-key="id"
          >
            <fks-table-column prop="name" label="名称" width="180">
            </fks-table-column>
            <fks-table-column prop="type" label="数据类型" width="180">
            </fks-table-column>
            <fks-table-column prop="laiyuan" label="数据来源" width="180">
            </fks-table-column>
            <fks-table-column prop="zhongyao" label="重要度" width="180">
            </fks-table-column>
            <fks-table-column prop="note" label="说明"> </fks-table-column>
          </fks-table>
        </div>
      </div>
 
      <div v-if="activeIndex === 2" style="width: 100%; height: 100%">
        <div style="height: calc(50% - 0px); margin-top: 0px">
          <div style="background-color: #fff">
            <label style="margin-left: 10px">开始时间:</label>
            <fks-date-picker v-model="date" type="date" placeholder="选择日期">
            </fks-date-picker>
            <fks-button style="margin-left: 10px" type="primary" @click="query"
              >加载</fks-button
            >
          </div>
          <div
            id="chartLeft"
            style="height: calc(100% - 40px); background-color: #fff"
          ></div>
        </div>
        <div style="height: calc(50% - 5px); margin-top: 5px">
          <titleBoxVue style="background-color: #fff" title="趋势预测">
            <template v-slot:right>
              <div
                style="
                  display: flex;
                  justify-content: space-between;
                  align-items: center;
                  padding: 10px;
                "
              >
                <div>
                  <label style="width: 80px; display: inline-block"
                    >方向:</label
                  >
                  <fks-select
                    style="width: 100px"
                    v-model="fangxiangvalue"
                    placeholder="请选择"
                  >
                    <fks-option
                      v-for="item in fangxiang"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </fks-option>
                  </fks-select>
 
                  <label style="width: 80px; display: inline-block"
                    >分析方法:</label
                  >
                  <fks-select
                    style="width: 150px"
                    v-model="fenxivalue"
                    placeholder="请选择"
                  >
                    <fks-option
                      v-for="item in fenxi"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    >
                    </fks-option>
                  </fks-select>
 
                  <label style="width: 80px; display: inline-block"
                    >阀值:</label
                  >
                  <fks-input style="width: 100px" v-model="fazhi"></fks-input>
                  <fks-button
                    style="margin-left: 30px"
                    type="primary"
                    @click="query"
                    >预测</fks-button
                  >
                </div>
                <div>
                  <label>发生时间:</label>
                  <fks-input
                    style="width: 120px"
                    v-model="fashengshijian"
                  ></fks-input>
                  <!-- background-color: #CAF982; -->
                </div>
              </div>
            </template>
          </titleBoxVue>
          <div
            id="chartRight22" 
            style="height: calc(100% - 40px); background-color: #fff"
          ></div>
        </div>
      </div>
 
      <div v-if="activeIndex === 3" style="width: 100%; height: 100%">
        <titleBoxVue style="background-color: #fff" title="预警记录">
          <template v-slot:right>
            <fks-button
              style="margin-left: 10px"
              type="primary"
              @click="gobackActiveIndex"
              >完成</fks-button
            >
          </template>
        </titleBoxVue>
 
        <div style="margin-top: 10px">
          <titleBoxVue style="background-color: #fff" title="概况">
          </titleBoxVue>
          <fks-form
            style="
              width: 100%;
              height: calc(100% - 50px);
              margin: 0;
              background-color: #fff;
              padding-top: 10px;
            "
            :model="editTrendFunFrom"
            label-width="80px"
          >
            <fks-row :gutter="20">
              <fks-col :span="8">
                <fks-form-item label="泵站">
                  <fks-input
                    v-model="editTrendFunFrom.name"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
              <fks-col :span="8">
                <fks-form-item label="设备">
                  <fks-input
                    v-model="editTrendFunFrom.product"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
              <fks-col :span="8">
                <fks-form-item label="测点">
                  <fks-input
                    v-model="editTrendFunFrom.point"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
            </fks-row>
            <fks-row :gutter="20">
              <fks-col :span="8">
                <fks-form-item label="指标">
                  <fks-input
                    v-model="editTrendFunFrom.signal"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
              <fks-col :span="8">
                <fks-form-item label="分析方法">
                  <fks-input
                    v-model="editTrendFunFrom.model"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
              <fks-col :span="8">
                <fks-form-item label="方向">
                  <fks-input
                    v-model="editTrendFunFrom.fangxiang"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
            </fks-row>
            <fks-row :gutter="20">
              <fks-col :span="8">
                <fks-form-item label="阀值">
                  <fks-input
                    v-model="editTrendFunFrom.value"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
              <fks-col :span="8">
                <fks-form-item label="分析人">
                  <fks-input
                    v-model="editTrendFunFrom.userName"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
              <fks-col :span="8">
                <fks-form-item label="记录时间">
                  <fks-input
                    v-model="editTrendFunFrom.endDate"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
            </fks-row>
            <fks-row :gutter="20">
              <fks-col :span="8">
                <fks-form-item label="预测时间">
                  <fks-input
                    v-model="editTrendFunFrom.startDate"
                    autocomplete="off"
                  ></fks-input>
                </fks-form-item>
              </fks-col>
            </fks-row>
 
            <fks-form-item label="说明">
              <fks-input
                type="textarea"
                :rows="2"
                autocomplete="off"
                v-model="editTrendFunFrom.note"
              >
              </fks-input>
            </fks-form-item>
          </fks-form>
        </div>
 
        <div class="dialogBottom">
          <div class="dialogBottomLeft">
            <titleBoxVue style="background-color: #fff" title="历史数据图">
            </titleBoxVue>
            <div id="chartLeftOnLineModel" style="height: calc(100% - 40px)"></div>
          </div>
          <div class="dialogBottomRight">
            <titleBoxVue style="background-color: #fff" title="趋势预警图">
            </titleBoxVue>
            <div id="chartRightOnLineModel"  style="height: calc(100% - 40px)"></div>
          </div>
        </div>
      </div>
    </div>
 
    <div
      v-if="activeIndex !== 3"
      style="text-align: right; padding: 0 10px; background-color: #fff"
    >
      <fks-button style="margin-left: 10px" type="primary" @click="next">{{
        nextName
      }}</fks-button>
    </div>
 
 
    
    <fks-dialog
      title="生成预警记录"
      width="400px"
      :visible.sync="finishTreadVisible"
    >
      <fks-form :model="finishTreadForm" label-width="80px">
        <fks-form-item label="说明">
          <fks-input
            type="textarea"
            :rows="4"
            autocomplete="off"
            v-model="finishTreadForm.note"
          >
          </fks-input>
        </fks-form-item>
      </fks-form>
      <div slot="footer" class="dialog-footer">
        <fks-button @click="finishTreadVisible = false">取 消</fks-button>
        <fks-button type="primary" @click="finishTreadRecord">确 定</fks-button>
      </div>
    </fks-dialog>
 
 
  </div>
</template>
  
  <script>
import { getDay } from "@/utils/istation/common";
import titleBoxVue from "@/views/main/components/titleBox.vue";
import leftTree from "@/views/main/components/leftTreeByData.vue";
 
import * as echarts from "echarts";
import testData from "@/testData/testData";
let m_chartQH;
let m_chartMain;
let m_chartQH1;
let m_chartMain1;
const tableData = [
  {
    id: 1,
    name: "1#机泵",
    type: "机泵",
    No: "ENGINEPUMP_001",
    code: "",
    model: "",
    note: "",
    status: "在用",
    children: [
      {
        id: 11,
        name: "1#泵",
        type: "泵",
        No: "PUMP_001",
        code: "",
        model: "",
        note: "",
        status: "在用",
      },
      {
        id: 12,
        name: "1#电机",
        type: "电机",
        No: "MOTOR_001",
        code: "",
        model: "",
        note: "",
        status: "在用",
      },
    ],
  },
];
const tableData1 = [
  {
    name: "有效值",
    type: "数值",
    laiyuan: "分析",
    zhongyao: "5",
    note: "",
  },
  {
    name: "歪度",
    type: "数值",
    laiyuan: "分析",
    zhongyao: "5",
    note: "",
  },
  {
    name: "峭度",
    type: "数值",
    laiyuan: "分析",
    zhongyao: "5",
    note: "",
  },
  {
    name: "峰峰值",
    type: "数值",
    laiyuan: "分析",
    zhongyao: "5",
    note: "",
  },
  {
    name: "歪度",
    type: "数值",
    laiyuan: "分析",
    zhongyao: "5",
    note: "",
  },
];
 
 
const treeData = [
  {
    label: "金刚沱泵站",
    id: "s1",
  },
  {
    label: "嘉陵江草街泵站",
    id: "s2",
  },
  {
    label: "江津德感加压站",
    id: "s3",
  },
  {
    label: "永川临江加压站",
    id: "s4",
  },
];
const treeData1 = [
  {
    label: "驱动端X方向振动",
    id: "s1",
  },
  {
    label: "驱动端Y方向振动",
    id: "s2",
  },
  {
    label: "驱动端Y方向振动",
    id: "s3",
  },
  {
    label: "轴承温度",
    id: "s4",
  },
  {
    label: "绕组温度",
    id: "s5",
  },
];
export default {
  name: "vibrationDemo",
  components: {
    titleBoxVue,
    leftTree,
  },
  data() {
    return {
      date: "",
      titleName: "金刚沱泵站-设备列表",
      searchWord: "",
      nextName: "下一步",
      tableData: tableData,
      tableData1: tableData1,
      activeIndex: 0,
      treeData: treeData,
      treeData1: treeData1,
      currentNodeKey: "s1",
      defaultExpandedKeys: ["s1"],
      fangxiang: [
        {
          value: "1",
          label: "正向",
        },
        {
          value: "2",
          label: "反向",
        },
      ],
      fangxiangvalue: "1",
      fenxi: [
        {
          value: "1",
          label: "一阶平滑",
        },
        {
          value: "2",
          label: "二阶平滑",
        },
        {
          value: "3",
          label: "阻尼趋势预测",
        },
        {
          value: "4",
          label: "霍尔特趋势预测",
        },
        {
          value: "5",
          label: "布朗线形趋势预测",
        },
        {
          value: "6",
          label: "自定义",
        },
      ],
      fenxivalue: "3",
      fazhi: "0.6",
      fashengshijian: "10天后",
      editTrendFunFrom: {
        name: "金刚沱泵站",
        product: "1#泵",
        point: "驱动端X方向振动",
        signal: "有效值",
        model: "一阶平滑分析",
        startDate: "2023-1-11",
        endDate: "2023-1-11",
        value: "0.6",
        time: "30天",
        fangxiang: "正向",
        userName: "专家",
      },
      finishTreadForm:{
        note:''
      },
      finishTreadVisible:false,
    };
  },
  created() {},
  mounted() {},
  computed: {
    stepTitleName() {
      let name = "";
      switch (this.activeIndex) {
        case 0:
          name = "选择设备";
          break;
        case 1:
          name = "选择指标";
          break;
        case 2:
          name = "数据分析";
          break;
        case 3:
          name = "预警记录";
          break;
        case 4:
          name = "完成";
          break;
      }
      return name;
    },
  },
  watch: {
    activeIndex(val) {
      let name = "";
      let nextName = "下一步";
      switch (val) {
        case 0:
          name = "金刚沱泵站-设备列表";
          break;
        case 1:
          name = "驱动端X方向振动-指标列表";
          break;
        case 2:
          name = "";
          setTimeout(() => {
            // this.initChartLeft(testData.recordData.Data);
            // this.initChartRight();
          }, 300);
          nextName = "生成";
          break;
        case 3:
          name = "预警记录";
          
          break;
 
        case 4:
          name = "完成";
          break;
      }
      this.titleName = name;
      this.nextName = nextName;
    },
  },
  methods: {
    initChartLeft(recordList_ds) {
      if (m_chartMain) {
        m_chartMain.clear();
      }
      m_chartMain = echarts.init(document.getElementById("chartLeft"));
 
      let m_unitName = "MPa";
      let m_recordName = "压力";
 
      let m_chartRecordList = [];
      let m_alarmList = [];
      var series_arr = [];
      var yaxisName = "";
      var legendData = [];
      var tipUnitName = "";
      if (recordList_ds == null || recordList_ds.length == 0) return;
 
      yaxisName = m_recordName + "(" + m_unitName + ")";
      tipUnitName = m_unitName;
      //console.log(recordList_ds, 243)
      let baseDate =
        new Date(recordList_ds[0].DataTime).getFullYear() +
        "-" +
        (new Date(recordList_ds[0].DataTime).getMonth() + 1) +
        "-" +
        new Date(recordList_ds[0].DataTime).getDate();
 
      var lastTime = null;
      var ignore_time = 1000 * 60 * 10;
 
      var chart_series_record_arr = [];
      var chart_series_alarm_arr = [];
 
      let m_chartValueSeriesList = [];
      let teShuDian = ["3053", "3054", "3055", "3056", "3057", "3058"];
      var nn = recordList_ds.length;
      for (var i = 0; i < nn; i++) {
        var record = recordList_ds[i];
        var real_time = record.DataTime;
        var real_value = record.DataValue;
 
        var dataValue = { value: [real_time, real_value] };
        var alarmValue = null;
        if ((record.RecordStatus & 2) == 2) {
          alarmValue = { value: real_value, coord: [real_time, real_value] };
          // m_alarmList.push(alarmValue)
        }
 
        if (lastTime == null) {
          lastTime = new Date(real_time).getTime();
        }
        if (new Date(real_time).getTime() - lastTime > ignore_time) {
          if (chart_series_record_arr.length > 3) {
            m_chartValueSeriesList.push({
              record: chart_series_record_arr,
              alarm: chart_series_alarm_arr,
            });
          }
          chart_series_record_arr = [];
          chart_series_alarm_arr = [];
        }
 
        chart_series_record_arr.push(dataValue);
        if (alarmValue != null) {
          chart_series_alarm_arr.push(alarmValue);
        }
 
        lastTime = new Date(real_time).getTime();
      }
      m_chartValueSeriesList.push({
        record: chart_series_record_arr,
        alarm: chart_series_alarm_arr,
      });
 
      var color_curve = "#4169E1";
      let showSymbol = false;
      let min = null;
      let max = null;
      let interval = null;
 
      min = baseDate + " 00:00:00";
      max = baseDate + " 23:59:59";
      interval = 1000 * 60 * 60 * 2;
      //console.log(m_chartValueSeriesList)
      for (var i = 0; i < m_chartValueSeriesList.length; i++) {
        series_arr.push({
          name: m_recordName,
          type: "line",
          showSymbol: showSymbol,
          hoverAnimation: false,
          data: m_chartValueSeriesList[i].record,
          itemStyle: {
            color: color_curve,
          },
        });
      }
 
      var main_chart_option = {
        title: {
          text: "",
        },
        legend: {
          data: legendData,
          top: 30,
          right: 50,
        },
        tooltip: {
          trigger: "axis",
          formatter: function (params) {
            //console.log(params);
            var tip = "";
            var date = new Date(params[0].value[0]);
            tip += date.getHours() + ":" + date.getMinutes() + " <br/>";
            for (var i = 0; i < params.length; i++) {
              var node = params[i];
              if (i == params.length - 1) {
                tip +=
                  node.marker +
                  node.seriesName +
                  ":" +
                  (node.value[1] - 0) +
                  " " +
                  tipUnitName;
              } else {
                tip +=
                  node.marker +
                  node.seriesName +
                  ":" +
                  (node.value[1] - 0) +
                  " " +
                  tipUnitName +
                  " <br/>";
              }
            }
            return tip;
            //var params_record = params[0];
            //var date = new Date(params_record.value[0]);
            //return date.getHours() + ':' + date.getMinutes() + ' <br/>值: ' + (params_record.value[1] - 0) + " " + tipUnitName;
          },
          axisPointer: {
            animation: false,
          },
        },
        grid: {
          containLabel: true,
          x: "25",
          y: "65",
          x2: "30",
          y2: "50",
        },
        toolbox: {
          show: true,
          top: 0,
          right: 40,
          iconStyle: {
            color: "#87CEFA",
            
          },
          emphasis: {
            //iconStyle: {
            //    textFill: '#fff',
            //    color: '#fff',
            //    borderColor: '#ccc',
            //},
          },
          feature: {
            mark: { show: true },
            dataZoom: {
              show: true,
              yAxisIndex: "none",
            },
            dataView: {
              show: true,
              readOnly: true,
              optionToContent: function (opt) {
                var series_list = opt.series;
                var table =
                  '<table contenteditable="true"><tbody><tr>' +
                  '<td style="padding:2px 30px;text-align:center;">时间</td>' +
                  '<td style="padding:2px 30px;text-align:center;">监控值</td>' +
                  "</tr>";
 
                for (var i = 0; i < series_list.length; i++) {
                  var series = series_list[i];
                  for (var i = 0, l = series.data.length; i < l; i++) {
                    table +=
                      "<tr>" +
                      '<td  style="padding:2px 30px;text-align:center;">' +
                      series.data[i].value[0] +
                      "</td>" +
                      '<td  style="padding:2px 30px;text-align:center;">' +
                      series.data[i].value[1] +
                      "</td>" +
                      "</tr>";
                  }
                }
 
                table += "</tbody></table>";
                return table;
              },
            },
            magicType: { show: true, type: ["line", "bar", "stack", "tiled"] },
            restore: { show: true },
            saveAsImage: { name: "picture", show: true },
            // myTool1: {
            //   show: true,
            //   title: "设置Y轴坐标",
            //   icon: "path://M962.92864 602.1888c-9.09824 48.42496-43.42272 80.96256-85.41696 80.96256h-4.8128a54.66624 54.66624 0 0 0-54.0672 55.08096 49.7408 49.7408 0 0 0 2.4576 12.96896q1.08544 3.69664 2.50368 7.2704a100.53632 100.53632 0 0 1-34.78528 122.7776l-3.072 1.9968c-0.54784 0.3584-1.11616 0.70144-1.6896 1.024l-104.14592 58.368a28.672 28.672 0 0 1-2.56 1.2288l-1.024 0.512a100.65408 100.65408 0 0 1-40.61696 8.35072 105.01632 105.01632 0 0 1-75.81184-31.7696 141.89056 141.89056 0 0 0-33.75616-25.72288 26.39872 26.39872 0 0 0-12.288-3.072 23.38304 23.38304 0 0 0-12.17024 3.33312 145.88928 145.88928 0 0 0-33.76128 26.112 104.73984 104.73984 0 0 1-76.31872 32.3328 99.79392 99.79392 0 0 1-39.89504-8.09984l-0.87552-0.35328-3.22048-1.536q-0.88064-0.43008-1.7408-0.9216l-107.8272-59.95008a28.38016 28.38016 0 0 1-2.56-1.64352l-1.024-0.7168a100.52096 100.52096 0 0 1-34.01728-122.46016q1.3312-3.456 2.35008-7.01952a50.04288 50.04288 0 0 0 2.5088-13.02016 54.66624 54.66624 0 0 0-54.04672-55.05536h-4.34688c-42.30656 0-76.8-32.5376-85.888-80.96256a531.18464 531.18464 0 0 1-9.41056-90.50112 520.84736 520.84736 0 0 1 9.46176-90.54208c9.05728-48.41984 43.58144-80.96256 85.98528-80.96256h4.1984A54.66112 54.66112 0 0 0 205.312 285.11744a80.73216 80.73216 0 0 0-4.96128-20.23936 100.6336 100.6336 0 0 1 33.86368-122.15808l0.81408-0.5632 2.9696-1.95072c0.56832-0.3584 1.14688-0.70144 1.7408-1.024l102.16448-57.64608a30.6688 30.6688 0 0 1 2.50368-1.23392l1.024-0.512a99.584 99.584 0 0 1 40.70912-8.46336 103.7568 103.7568 0 0 1 76.88192 33.31072 150.1184 150.1184 0 0 0 35.80416 28.07808 23.35232 23.35232 0 0 0 21.73952 0.1536 148.08064 148.08064 0 0 0 36.46976-28.99968 103.69536 103.69536 0 0 1 77.34272-33.82272 99.6352 99.6352 0 0 1 40.00256 8.192l0.9216 0.41472 3.11808 1.47968q0.86016 0.4352 1.6896 0.92672l105.88672 59.28448a28.55936 28.55936 0 0 1 2.45248 1.536l1.024 0.7168a100.67968 100.67968 0 0 1 34.01728 122.46016c0 0.0512-1.1264 2.82112-2.3552 7.01952a49.92 49.92 0 0 0-2.50368 13.02016 54.67648 54.67648 0 0 0 54.0672 55.08096h4.24448c42.35776 0 76.88704 32.54272 85.9392 80.96256a525.312 525.312 0 0 1 9.46176 90.48576v0.05632a534.3744 534.3744 0 0 1-9.41568 90.50624z m-49.46432-173.92128c-2.96448-15.83104-12.63616-34.35008-30.00832-34.35008h-4.27008a113.96096 113.96096 0 0 1-113.44384-114.176 106.22464 106.22464 0 0 1 4.9408-29.696 133.4016 133.4016 0 0 1 4.94592-14.12096 43.87328 43.87328 0 0 0-14.15168-52.40832l-0.26112-0.1536-0.2048-0.1536-106.74176-59.33568-0.2048-0.1536-0.26112-0.10752a47.77984 47.77984 0 0 0-52.0192 11.72992c-16.69632 18.36544-57.2672 53.13536-91.5456 53.13536-13.824 0-31.05792-6.22592-49.664-18.00704a213.08928 213.08928 0 0 1-41.20576-34.11968 47.77984 47.77984 0 0 0-52.1728-11.3152l-0.256 0.1024-0.20992 0.1536-102.99392 57.94304-0.20992 0.10752-0.26112 0.2048a43.99616 43.99616 0 0 0-14.10048 52.40832 142.47424 142.47424 0 0 1 4.9408 14.12096 105.6256 105.6256 0 0 1 4.9408 29.696 113.98656 113.98656 0 0 1-113.50016 114.176h-4.34688c-17.26976 0.1024-26.89024 18.57536-29.85472 34.35008a466.432 466.432 0 0 0-8.58624 80.896 466.8672 466.8672 0 0 0 8.58624 80.95232c2.96448 15.82592 12.58496 34.35008 29.90592 34.35008h4.352a113.96096 113.96096 0 0 1 113.44896 114.176 105.3952 105.3952 0 0 1-4.9408 29.696 117.02784 117.02784 0 0 1-4.9408 14.11072 43.84256 43.84256 0 0 0 14.20288 52.41344l0.26112 0.1536 0.26112 0.15872 108.544 60.0832 0.256 0.10752 0.31232 0.1024a48.71168 48.71168 0 0 0 52.0192-11.15648c16.384-17.3312 56.22784-50.0224 89.46688-50.0224 32.97792 0 72.61696 32.06656 88.94464 49.03936a48.7936 48.7936 0 0 0 52.17792 10.79296l0.20992-0.1024 0.256-0.15872 104.86272-58.68544 0.26112-0.15872 0.20992-0.1536a43.93984 43.93984 0 0 0 14.14656-52.41344 142.18752 142.18752 0 0 1-4.992-14.11072 107.33056 107.33056 0 0 1-4.8896-29.696 113.98144 113.98144 0 0 1 113.49504-114.176h4.7872c10.61376 0 24.65792-8.97536 29.44512-34.35008h0.04608a478.67392 478.67392 0 0 0 8.58624-80.896 466.65216 466.65216 0 0 0-8.576-80.98304z m-203.8784 142.848a23.95136 23.95136 0 0 1-1.024 8.75008 189.58336 189.58336 0 0 1-73.07264 95.38048 185.856 185.856 0 0 1-107.28448 34.03264 189.48608 189.48608 0 0 1-178.51904-128.8448 24.15104 24.15104 0 0 1-1.024-7.59808 192.12288 192.12288 0 0 1 4.37248-124.21632 24.09472 24.09472 0 0 1 1.39776-6.82496 188.928 188.928 0 0 1 173.76768-116.49024 185.344 185.344 0 0 1 79.04768 17.664 189.29664 189.29664 0 0 1 96.54784 98.9952 23.94112 23.94112 0 0 1 1.536 8.38656 194.41152 194.41152 0 0 1 4.25472 120.75008z m-179.8656-196.98176a142.94016 142.94016 0 1 0 68.29056 267.89888 144.60928 144.60928 0 0 0-26.84416-261.57568 140.98944 140.98944 0 0 0-41.4464-6.33856z",
            //   onclick: setChartyAxis,
            // },
          },
        },
        dataZoom: [
          {
            id: "dataZoomX",
            type: "slider",
            xAxisIndex: [0],
            start: 0,
            end: 100,
            bottom: 10,
            filterMode: "filter",
            handleIcon:
              "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z",
            handleSize: "80%",
            handleStyle: {
              color: "#fff",
              shadowBlur: 3,
              shadowColor: "rgba(0, 0, 0, 0.9)", //rgba(0, 0, 0, 0.9)
              shadowOffsetX: 2,
              shadowOffsetY: 2,
            },
            backgroundColor: "#eee",
            borderColor: "#ccc",
            dataBackground: {
              lineStyle: {
                //color:'red',
              },
            },
          },
          {
            // 这个dataZoom组件,也控制x轴。
            type: "inside", // 这个 dataZoom 组件是 inside 型 dataZoom 组件
            start: 0, // 左边在 24% 的位置。
            end: 100, // 右边在 100% 的位置。
          },
        ],
        xAxis: {
          type: "time",
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
            },
          },
          axisLabel: {
            //color: '#fff',
            formatter: function (v, index) {
              //.log(value, index);
              var date = new Date(v);
              //console.log(date);
              var texts = [date.getHours(), date.getMinutes()];
              //var texts = [date.getHours(),"00"];
              return texts.join(":");
            },
          },
          axisLine: {
            lineStyle: {
              // color: '#fff'
            },
          },
          min: min,
          max: max,
          interval: interval,
        },
        yAxis: {
          name: yaxisName,
          nameLocation: "end",
          nameTextStyle: {
            align: "left",
          },
          type: "value",
          boundaryGap: [0, "100%"],
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
            },
          },
          axisLabel: {
            //color: '#fff',
          },
          axisLine: {
            lineStyle: {
              //color: '#fff'
            },
          },
          scale: true,
        },
        series: series_arr,
      };
 
      m_chartMain.setOption(main_chart_option);
    },
    initChartRight() {
      if (m_chartQH) {
        m_chartQH.clear();
      } 
      m_chartQH = echarts.init(document.getElementById("chartRight22"));
 
      let QH = [];
      let data = [
    {
        "X": 0,
        "Y": 25.396041522972556
    },
    {
        "X": 221.55894736842106,
        "Y": 24.996444466211308
    },
    {
        "X": 443.1178947368421,
        "Y": 24.57641143025572
    },
    {
        "X": 664.6768421052632,
        "Y": 24.134248374492763
    },
    {
        "X": 886.2357894736842,
        "Y": 23.668261258309396
    },
    {
        "X": 1107.7947368421053,
        "Y": 23.176756041092595
    },
    {
        "X": 1329.3536842105264,
        "Y": 22.658038682229318
    },
    {
        "X": 1550.9126315789474,
        "Y": 22.11041514110654
    },
    {
        "X": 1772.4715789473685,
        "Y": 21.532191377111225
    },
    {
        "X": 1994.0305263157895,
        "Y": 20.92167334963034
    },
    {
        "X": 2215.5894736842106,
        "Y": 20.27716701805085
    },
    {
        "X": 2437.1484210526314,
        "Y": 19.596978341759726
    },
    {
        "X": 2658.7073684210527,
        "Y": 18.879413280143936
    },
    {
        "X": 2880.266315789474,
        "Y": 18.122777792590444
    },
    {
        "X": 3101.825263157895,
        "Y": 17.32537783848622
    },
    {
        "X": 3323.3842105263157,
        "Y": 16.485519377218225
    },
    {
        "X": 3544.943157894737,
        "Y": 15.601508368173434
    },
    {
        "X": 3766.5021052631582,
        "Y": 14.671650770738811
    },
    {
        "X": 3988.061052631579,
        "Y": 13.694252544301325
    },
    {
        "X": 4209.62,
        "Y": 12.667619648247939
    }
];
      for (var i = 0; i < data.length; i++) {
        let item = data[i];
        
        QH.push({ value: [data[i].X, data[i].Y],  });
      }
 
      
      var option = {
        title: {
          text: "",
          top: "5%",
          right: "4%",
          textStyle: {
            fontWeight: "lighter", //lighter //normal
            fontSize: 12,
            textShadowColor: "#C28D21", //阴影颜色
            textShadowBlur: "2", //阴影的宽度
            textShadowOffsetX: "-0", //阴影向X偏移
            textShadowOffsetY: "-70", //阴影向Y偏移
          },
        },
        grid: {
          top: "5%",
          left: "2%",
          right: "4%",
          bottom: "5%",
          containLabel: true,
        },
        tooltip: {
          trigger: "item",
          axisPointer: {
            type: "cross",
          },
          formatter: function (params) {
            //console.log(params);
            if (!params) {
              return;
            }
            var data = params.value;
            return "流量:" + data[0] + ",扬程" + data[1] + "m";
            //return h+date.getFullYear() + '年' + (date.getMonth() + 1) + '月' + date.getDate() + '日 :  ' + params.value[1];
          },
        },
        xAxis: [
          {
            name: "", //流量(m³/h)
            nameLocation: "middle",
            nameGap: 29,
            nameTextStyle: {
              color: "#d4ce55",
            },
            splitLine: {
              show: true,
            },
            axisLine: {
              onZero: false,
              lineStyle: {
                //color: GlobalParas.chartTextColor
              },
            },
            type: "value",
          },
        ],
        yAxis: [
          {
            name: "", //"扬程(m)",
            nameLocation: "middle",
            nameGap: 39,
            nameTextStyle: {
              color: "#d4ce55",
            },
            axisLine: {
              onZero: false,
              lineStyle: {
                //color: GlobalParas.chartTextColor
              },
            },
            boundaryGap: ["20%", "20%"],
            type: "value",
          },
        ],
        series: [
          {
            itemStyle: {
              color: "#48dcd7",
            },
            showSymbol: false,
            data: QH,
            type: "line",
            smooth: true,
          },
        ],
      };
      // 使用刚指定的配置项和数据显示图表。
      
      m_chartQH.setOption(option);
    },
    initChartLeft1(recordList_ds) {
      if (m_chartMain1) {
        m_chartMain1.clear();
      }
      m_chartMain1 = echarts.init(document.getElementById("chartLeftOnLineModel"));
 
      let m_unitName = "MPa";
      let m_recordName = "压力";
 
      let m_chartRecordList = [];
      let m_alarmList = [];
      var series_arr = [];
      var yaxisName = "";
      var legendData = [];
      var tipUnitName = "";
      if (recordList_ds == null || recordList_ds.length == 0) return;
 
      yaxisName = m_recordName + "(" + m_unitName + ")";
      tipUnitName = m_unitName;
      //console.log(recordList_ds, 243)
      let baseDate =
        new Date(recordList_ds[0].DataTime).getFullYear() +
        "-" +
        (new Date(recordList_ds[0].DataTime).getMonth() + 1) +
        "-" +
        new Date(recordList_ds[0].DataTime).getDate();
 
      var lastTime = null;
      var ignore_time = 1000 * 60 * 10;
 
      var chart_series_record_arr = [];
      var chart_series_alarm_arr = [];
 
      let m_chartValueSeriesList = [];
      let teShuDian = ["3053", "3054", "3055", "3056", "3057", "3058"];
      var nn = recordList_ds.length;
      for (var i = 0; i < nn; i++) {
        var record = recordList_ds[i];
        var real_time = record.DataTime;
        var real_value = record.DataValue;
 
        var dataValue = { value: [real_time, real_value] };
        var alarmValue = null;
        if ((record.RecordStatus & 2) == 2) {
          alarmValue = { value: real_value, coord: [real_time, real_value] };
          // m_alarmList.push(alarmValue)
        }
 
        if (lastTime == null) {
          lastTime = new Date(real_time).getTime();
        }
        if (new Date(real_time).getTime() - lastTime > ignore_time) {
          if (chart_series_record_arr.length > 3) {
            m_chartValueSeriesList.push({
              record: chart_series_record_arr,
              alarm: chart_series_alarm_arr,
            });
          }
          chart_series_record_arr = [];
          chart_series_alarm_arr = [];
        }
 
        chart_series_record_arr.push(dataValue);
        if (alarmValue != null) {
          chart_series_alarm_arr.push(alarmValue);
        }
 
        lastTime = new Date(real_time).getTime();
      }
      m_chartValueSeriesList.push({
        record: chart_series_record_arr,
        alarm: chart_series_alarm_arr,
      });
 
      var color_curve = "#4169E1";
      let showSymbol = false;
      let min = null;
      let max = null;
      let interval = null;
 
      min = baseDate + " 00:00:00";
      max = baseDate + " 23:59:59";
      interval = 1000 * 60 * 60 * 2;
      //console.log(m_chartValueSeriesList)
      for (var i = 0; i < m_chartValueSeriesList.length; i++) {
        series_arr.push({
          name: m_recordName,
          type: "line",
          showSymbol: showSymbol,
          hoverAnimation: false,
          data: m_chartValueSeriesList[i].record,
          itemStyle: {
            color: color_curve,
          },
        });
      }
 
      var main_chart_option = {
        title: {
          text: "",
        },
        legend: {
          data: legendData,
          top: 30,
          right: 50,
        },
        tooltip: {
          trigger: "axis",
          formatter: function (params) {
            //console.log(params);
            var tip = "";
            var date = new Date(params[0].value[0]);
            tip += date.getHours() + ":" + date.getMinutes() + " <br/>";
            for (var i = 0; i < params.length; i++) {
              var node = params[i];
              if (i == params.length - 1) {
                tip +=
                  node.marker +
                  node.seriesName +
                  ":" +
                  (node.value[1] - 0) +
                  " " +
                  tipUnitName;
              } else {
                tip +=
                  node.marker +
                  node.seriesName +
                  ":" +
                  (node.value[1] - 0) +
                  " " +
                  tipUnitName +
                  " <br/>";
              }
            }
            return tip;
            //var params_record = params[0];
            //var date = new Date(params_record.value[0]);
            //return date.getHours() + ':' + date.getMinutes() + ' <br/>值: ' + (params_record.value[1] - 0) + " " + tipUnitName;
          },
          axisPointer: {
            animation: false,
          },
        },
        grid: {
          containLabel: true,
          x: "25",
          y: "65",
          x2: "30",
          y2: "50",
        },
        toolbox: {
          show: true,
          top: 0,
          right: 40,
          iconStyle: {
            color: "#87CEFA",
          },
          emphasis: {
            //iconStyle: {
            //    textFill: '#fff',
            //    color: '#fff',
            //    borderColor: '#ccc',
            //},
          },
          feature: {
            mark: { show: true },
            dataZoom: {
              show: true,
              yAxisIndex: "none",
            },
            dataView: {
              show: true,
              readOnly: true,
              optionToContent: function (opt) {
                var series_list = opt.series;
                var table =
                  '<table contenteditable="true"><tbody><tr>' +
                  '<td style="padding:2px 30px;text-align:center;">时间</td>' +
                  '<td style="padding:2px 30px;text-align:center;">监控值</td>' +
                  "</tr>";
 
                for (var i = 0; i < series_list.length; i++) {
                  var series = series_list[i];
                  for (var i = 0, l = series.data.length; i < l; i++) {
                    table +=
                      "<tr>" +
                      '<td  style="padding:2px 30px;text-align:center;">' +
                      series.data[i].value[0] +
                      "</td>" +
                      '<td  style="padding:2px 30px;text-align:center;">' +
                      series.data[i].value[1] +
                      "</td>" +
                      "</tr>";
                  }
                }
 
                table += "</tbody></table>";
                return table;
              },
            },
            magicType: { show: true, type: ["line", "bar", "stack", "tiled"] },
            restore: { show: true },
            saveAsImage: { name: "picture", show: true },
            // myTool1: {
            //   show: true,
            //   title: "设置Y轴坐标",
            //   icon: "path://M962.92864 602.1888c-9.09824 48.42496-43.42272 80.96256-85.41696 80.96256h-4.8128a54.66624 54.66624 0 0 0-54.0672 55.08096 49.7408 49.7408 0 0 0 2.4576 12.96896q1.08544 3.69664 2.50368 7.2704a100.53632 100.53632 0 0 1-34.78528 122.7776l-3.072 1.9968c-0.54784 0.3584-1.11616 0.70144-1.6896 1.024l-104.14592 58.368a28.672 28.672 0 0 1-2.56 1.2288l-1.024 0.512a100.65408 100.65408 0 0 1-40.61696 8.35072 105.01632 105.01632 0 0 1-75.81184-31.7696 141.89056 141.89056 0 0 0-33.75616-25.72288 26.39872 26.39872 0 0 0-12.288-3.072 23.38304 23.38304 0 0 0-12.17024 3.33312 145.88928 145.88928 0 0 0-33.76128 26.112 104.73984 104.73984 0 0 1-76.31872 32.3328 99.79392 99.79392 0 0 1-39.89504-8.09984l-0.87552-0.35328-3.22048-1.536q-0.88064-0.43008-1.7408-0.9216l-107.8272-59.95008a28.38016 28.38016 0 0 1-2.56-1.64352l-1.024-0.7168a100.52096 100.52096 0 0 1-34.01728-122.46016q1.3312-3.456 2.35008-7.01952a50.04288 50.04288 0 0 0 2.5088-13.02016 54.66624 54.66624 0 0 0-54.04672-55.05536h-4.34688c-42.30656 0-76.8-32.5376-85.888-80.96256a531.18464 531.18464 0 0 1-9.41056-90.50112 520.84736 520.84736 0 0 1 9.46176-90.54208c9.05728-48.41984 43.58144-80.96256 85.98528-80.96256h4.1984A54.66112 54.66112 0 0 0 205.312 285.11744a80.73216 80.73216 0 0 0-4.96128-20.23936 100.6336 100.6336 0 0 1 33.86368-122.15808l0.81408-0.5632 2.9696-1.95072c0.56832-0.3584 1.14688-0.70144 1.7408-1.024l102.16448-57.64608a30.6688 30.6688 0 0 1 2.50368-1.23392l1.024-0.512a99.584 99.584 0 0 1 40.70912-8.46336 103.7568 103.7568 0 0 1 76.88192 33.31072 150.1184 150.1184 0 0 0 35.80416 28.07808 23.35232 23.35232 0 0 0 21.73952 0.1536 148.08064 148.08064 0 0 0 36.46976-28.99968 103.69536 103.69536 0 0 1 77.34272-33.82272 99.6352 99.6352 0 0 1 40.00256 8.192l0.9216 0.41472 3.11808 1.47968q0.86016 0.4352 1.6896 0.92672l105.88672 59.28448a28.55936 28.55936 0 0 1 2.45248 1.536l1.024 0.7168a100.67968 100.67968 0 0 1 34.01728 122.46016c0 0.0512-1.1264 2.82112-2.3552 7.01952a49.92 49.92 0 0 0-2.50368 13.02016 54.67648 54.67648 0 0 0 54.0672 55.08096h4.24448c42.35776 0 76.88704 32.54272 85.9392 80.96256a525.312 525.312 0 0 1 9.46176 90.48576v0.05632a534.3744 534.3744 0 0 1-9.41568 90.50624z m-49.46432-173.92128c-2.96448-15.83104-12.63616-34.35008-30.00832-34.35008h-4.27008a113.96096 113.96096 0 0 1-113.44384-114.176 106.22464 106.22464 0 0 1 4.9408-29.696 133.4016 133.4016 0 0 1 4.94592-14.12096 43.87328 43.87328 0 0 0-14.15168-52.40832l-0.26112-0.1536-0.2048-0.1536-106.74176-59.33568-0.2048-0.1536-0.26112-0.10752a47.77984 47.77984 0 0 0-52.0192 11.72992c-16.69632 18.36544-57.2672 53.13536-91.5456 53.13536-13.824 0-31.05792-6.22592-49.664-18.00704a213.08928 213.08928 0 0 1-41.20576-34.11968 47.77984 47.77984 0 0 0-52.1728-11.3152l-0.256 0.1024-0.20992 0.1536-102.99392 57.94304-0.20992 0.10752-0.26112 0.2048a43.99616 43.99616 0 0 0-14.10048 52.40832 142.47424 142.47424 0 0 1 4.9408 14.12096 105.6256 105.6256 0 0 1 4.9408 29.696 113.98656 113.98656 0 0 1-113.50016 114.176h-4.34688c-17.26976 0.1024-26.89024 18.57536-29.85472 34.35008a466.432 466.432 0 0 0-8.58624 80.896 466.8672 466.8672 0 0 0 8.58624 80.95232c2.96448 15.82592 12.58496 34.35008 29.90592 34.35008h4.352a113.96096 113.96096 0 0 1 113.44896 114.176 105.3952 105.3952 0 0 1-4.9408 29.696 117.02784 117.02784 0 0 1-4.9408 14.11072 43.84256 43.84256 0 0 0 14.20288 52.41344l0.26112 0.1536 0.26112 0.15872 108.544 60.0832 0.256 0.10752 0.31232 0.1024a48.71168 48.71168 0 0 0 52.0192-11.15648c16.384-17.3312 56.22784-50.0224 89.46688-50.0224 32.97792 0 72.61696 32.06656 88.94464 49.03936a48.7936 48.7936 0 0 0 52.17792 10.79296l0.20992-0.1024 0.256-0.15872 104.86272-58.68544 0.26112-0.15872 0.20992-0.1536a43.93984 43.93984 0 0 0 14.14656-52.41344 142.18752 142.18752 0 0 1-4.992-14.11072 107.33056 107.33056 0 0 1-4.8896-29.696 113.98144 113.98144 0 0 1 113.49504-114.176h4.7872c10.61376 0 24.65792-8.97536 29.44512-34.35008h0.04608a478.67392 478.67392 0 0 0 8.58624-80.896 466.65216 466.65216 0 0 0-8.576-80.98304z m-203.8784 142.848a23.95136 23.95136 0 0 1-1.024 8.75008 189.58336 189.58336 0 0 1-73.07264 95.38048 185.856 185.856 0 0 1-107.28448 34.03264 189.48608 189.48608 0 0 1-178.51904-128.8448 24.15104 24.15104 0 0 1-1.024-7.59808 192.12288 192.12288 0 0 1 4.37248-124.21632 24.09472 24.09472 0 0 1 1.39776-6.82496 188.928 188.928 0 0 1 173.76768-116.49024 185.344 185.344 0 0 1 79.04768 17.664 189.29664 189.29664 0 0 1 96.54784 98.9952 23.94112 23.94112 0 0 1 1.536 8.38656 194.41152 194.41152 0 0 1 4.25472 120.75008z m-179.8656-196.98176a142.94016 142.94016 0 1 0 68.29056 267.89888 144.60928 144.60928 0 0 0-26.84416-261.57568 140.98944 140.98944 0 0 0-41.4464-6.33856z",
            //   onclick: setChartyAxis,
            // },
          },
        },
        dataZoom: [
          {
            id: "dataZoomX",
            type: "slider",
            xAxisIndex: [0],
            start: 0,
            end: 100,
            bottom: 10,
            filterMode: "filter",
            handleIcon:
              "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z",
            handleSize: "80%",
            handleStyle: {
              color: "#fff",
              shadowBlur: 3,
              shadowColor: "rgba(0, 0, 0, 0.9)", //rgba(0, 0, 0, 0.9)
              shadowOffsetX: 2,
              shadowOffsetY: 2,
            },
            backgroundColor: "#eee",
            borderColor: "#ccc",
            dataBackground: {
              lineStyle: {
                //color:'red',
              },
            },
          },
          {
            // 这个dataZoom组件,也控制x轴。
            type: "inside", // 这个 dataZoom 组件是 inside 型 dataZoom 组件
            start: 0, // 左边在 24% 的位置。
            end: 100, // 右边在 100% 的位置。
          },
        ],
        xAxis: {
          type: "time",
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
            },
          },
          axisLabel: {
            //color: '#fff',
            formatter: function (v, index) {
              //.log(value, index);
              var date = new Date(v);
              //console.log(date);
              var texts = [date.getHours(), date.getMinutes()];
              //var texts = [date.getHours(),"00"];
              return texts.join(":");
            },
          },
          axisLine: {
            lineStyle: {
              // color: '#fff'
            },
          },
          min: min,
          max: max,
          interval: interval,
        },
        yAxis: {
          name: yaxisName,
          nameLocation: "end",
          nameTextStyle: {
            align: "left",
          },
          type: "value",
          boundaryGap: [0, "100%"],
          splitLine: {
            show: true,
            lineStyle: {
              type: "dashed",
            },
          },
          axisLabel: {
            //color: '#fff',
          },
          axisLine: {
            lineStyle: {
              //color: '#fff'
            },
          },
          scale: true,
        },
        series: series_arr,
      };
 
      m_chartMain1.setOption(main_chart_option);
    },
    initChartRight1() {
      if (m_chartQH1) {
        m_chartQH1.clear();
      }
      m_chartQH1 = echarts.init(document.getElementById("chartRightOnLineModel"));
 
      let QH = [];
      let data =  [
    {
        "X": 0,
        "Y": 25.396041522972556
    },
    {
        "X": 221.55894736842106,
        "Y": 24.996444466211308
    },
    {
        "X": 443.1178947368421,
        "Y": 24.57641143025572
    },
    {
        "X": 664.6768421052632,
        "Y": 24.134248374492763
    },
    {
        "X": 886.2357894736842,
        "Y": 23.668261258309396
    },
    {
        "X": 1107.7947368421053,
        "Y": 23.176756041092595
    },
    {
        "X": 1329.3536842105264,
        "Y": 22.658038682229318
    },
    {
        "X": 1550.9126315789474,
        "Y": 22.11041514110654
    },
    {
        "X": 1772.4715789473685,
        "Y": 21.532191377111225
    },
    {
        "X": 1994.0305263157895,
        "Y": 20.92167334963034
    },
    {
        "X": 2215.5894736842106,
        "Y": 20.27716701805085
    },
    {
        "X": 2437.1484210526314,
        "Y": 19.596978341759726
    },
    {
        "X": 2658.7073684210527,
        "Y": 18.879413280143936
    },
    {
        "X": 2880.266315789474,
        "Y": 18.122777792590444
    },
    {
        "X": 3101.825263157895,
        "Y": 17.32537783848622
    },
    {
        "X": 3323.3842105263157,
        "Y": 16.485519377218225
    },
    {
        "X": 3544.943157894737,
        "Y": 15.601508368173434
    },
    {
        "X": 3766.5021052631582,
        "Y": 14.671650770738811
    },
    {
        "X": 3988.061052631579,
        "Y": 13.694252544301325
    },
    {
        "X": 4209.62,
        "Y": 12.667619648247939
    }
];
      for (var i = 0; i < data.length; i++) {
        let item = data[i];
        QH.push({ value: [data[i].X, data[i].Y], });
      }
 
      var option = {
        title: {
          text: "",
          top: "5%",
          right: "4%",
          textStyle: {
            fontWeight: "lighter", //lighter //normal
            fontSize: 12,
            textShadowColor: "#C28D21", //阴影颜色
            textShadowBlur: "2", //阴影的宽度
            textShadowOffsetX: "-0", //阴影向X偏移
            textShadowOffsetY: "-70", //阴影向Y偏移
          },
        },
        grid: {
          top: "5%",
          left: "2%",
          right: "4%",
          bottom: "5%",
          containLabel: true,
        },
        tooltip: {
          trigger: "item",
          axisPointer: {
            type: "cross",
          },
          formatter: function (params) {
            //console.log(params);
            if (!params) {
              return;
            }
            var data = params.value;
            return "流量:" + data[0] + ",扬程" + data[1] + "m";
            //return h+date.getFullYear() + '年' + (date.getMonth() + 1) + '月' + date.getDate() + '日 :  ' + params.value[1];
          },
        },
        xAxis: [
          {
            name: "", //流量(m³/h)
            nameLocation: "middle",
            nameGap: 29,
            nameTextStyle: {
              color: "#d4ce55",
            },
            splitLine: {
              show: true,
            },
            axisLine: {
              onZero: false,
              lineStyle: {
                //color: GlobalParas.chartTextColor
              },
            },
            type: "value",
          },
        ],
        yAxis: [
          {
            name: "", //"扬程(m)",
            nameLocation: "middle",
            nameGap: 39,
            nameTextStyle: {
              color: "#d4ce55",
            },
            axisLine: {
              onZero: false,
              lineStyle: {
                //color: GlobalParas.chartTextColor
              },
            },
            boundaryGap: ["20%", "20%"],
            type: "value",
          },
        ],
        series: [
          {
            itemStyle: {
              color: "#48dcd7",
              
            },
            showSymbol: false,
            data: QH,
            type: "line",
            smooth: true,
          },
        ],
      };
      // 使用刚指定的配置项和数据显示图表。
      m_chartQH1.setOption(option);
    },
    gobackActiveIndex() {
      this.activeIndex = 0;
    },
    finishTreadRecord(){
      this.finishTreadVisible=false;
      this.activeIndex = 3
      setTimeout(() => {
            this.initChartLeft1(testData.recordData.Data);
            this.initChartRight1();
          }, 300);
    },
    next() {
      if(this.activeIndex===2){
        this.finishTreadVisible=true;
        return
      }
      this.activeIndex++;
      if(this.activeIndex===2){
        setTimeout(() => {
            this.initChartLeft(testData.recordData.Data);
            this.initChartRight();
          }, 300);
      }
      
    },
    query() {
      console.log(this.searchWord, 105);
    },
    selectchange(value) {
      console.log(value, 186);
    },
    handleNodeClick(data) {
      console.log(data, 74);
 
      this.titleName = data.label + "-设备列表";
      if (this.activeIndex === 1) {
        this.titleName = data.label + "-故障列表";
      }
      this.getTableData();
    },
 
    getTableData(id) {},
    getExpand(node, id) {
      console.log(node, id, 222);
    },
    
   
  
    
   
  },
};
</script>
  <style scoped>
.boxright {
  flex: 1;
  height: 100%;
  overflow: auto;
  background: transparent;
  margin-left: 20px;
}
 
.dialogBottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.dialogBottomLeft {
  width: 50%;
  height: 300px;
  background-color: #fff;
}
.dialogBottomRight {
  width: calc(50% - 10px);
  height: 300px;
  margin-left: 10px;
  background-color: #fff;
}
</style>