hdw
2019-01-18 8306010ebd06cdef8237fa06c32463b7ecf3e3c6
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
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE HTML>
<html>
<head>
<!-- 默认使用最高内核 -->
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" >
<base href="<%=basePath%>">
<title><s:text name="Charge_discharge_data"></s:text>
</title>
 
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="css/basic.css" type="text/css" rel="stylesheet" />
<link href="css/charge_test_style.css" type="text/css" rel="stylesheet" />
<link href="css/loading.css" type="text/css" rel="stylesheet" />
<link href="jqueryui/jquery-ui.css" type="text/css" rel="stylesheet" />
<link href="css/collapse.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/echarts2.js"></script>
<script type="text/javascript" src="js/frame.js"></script> 
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
 
<script type="text/javascript" src="js/createTab.js"></script>
<script type="text/javascript" src="js/right-menu.js"></script>
<script type="text/javascript" src="js/Title.js"></script>
<script type="text/javascript" src="js/loading.js"></script>
<style type="text/css">
    #allGraph {
        position: absolute;
        top: -1000px;
        left: 0;
        width: 600px;
        height: 400px;
    }
    .chart-contain {
        width: 100%;
        height: 100%;
        background-color: #FFFFFF;
    }
    .chart {
        width: 100%;
        height: 100%;
    }
</style>
</head>
 
<body>
    <!--头部内容开始-->
    <jsp:include page="Top.jsp" flush="true"/>
    <!--头部内容结束-->
    <!--导航开始-->
    <jsp:include page="nav.jsp" flush="true"/>
    <!--导航结束-->
    <div id="main">
        <table id="all_content">
            <tr>
                <td id="ele_content">
                    <!-- 机房数电池组数 -->
                    <div id="mach_num">
                        <s:text name="Room_num"></s:text>
                        :<span id="room_num"></span>;&nbsp;
                        <s:text name="Batt_group_num"></s:text>
                        :<span id="batt_group_num"></span>
                    </div> <!--电池组菜单栏-->
                    <div id="lside"></div>
                    <div class="batt-listen">
                        <div class="count-num">
                            放电数:<span>0</span>
                            充电数:<span>0</span>
                        </div>
                        <div class="batt-list"></div>
                    </div>
                    </td>
                <td id="rside">
                    <div id="address_infor"></div>
                    <table id="content">
                        <tr>
                            <td><span><s:text name="Batte_state"></s:text></span>:<input type="text"
                                id="ele_state" readonly="readonly" />
                            </td>
                            <!-- 电池状态 -->
                            <td><span><s:text name="Terminal_vol"></s:text></span>:<span class="vis">隐</span><input
                                type="text" id="ele_tension" readonly="readonly" />
                            </td>
                            <!-- 组端电压 -->
                            <td><span><s:text name="Batt_current"></s:text></span>:<input type="text"
                                id="ele_current" readonly="readonly" />
                            </td>
                            <!-- 电池电流 -->
                            <td><span><s:text name="Test_date"></s:text></span>:<input type="text"
                                id="test_date" readonly="readonly" />
                            </td>
                            <!-- 测试日期 -->
                        </tr>
                        <tr>
                            <td><span><s:text name="Test_timeL"></s:text></span>:<input type="text"
                                id="test_time" readonly="readonly" />
                            </td>
                            <!-- 测试时长 -->
                            <td><span><s:text name="Test_capacity"></s:text></span>:<input
                                type="text" id="test_content" readonly="readonly" />
                            </td>
                            <!-- 测试容量 -->
                            <td><span><s:text name="Residual_capacity"></s:text></span>:<input
                                type="text" id="over_content" readonly="readonly" />
                            </td>
                            <!-- 剩余容量 -->
                            <td><span><s:text name="Endurance"/><s:text name="Time"/></span>:<input type="text"
                                id="reserve_time" readonly="readonly" />
                            </td>
                            <!-- 后备时间 -->
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td style="width: 300px !important;">
                                <table id="charge_infor" style="width: 300px !important;">
                                    <tr>
                                        <td id="charge_sec">
                                            <select id="charge_select_type">
                                                <option value="charge-discharge" selected = "selected" ><s:text name="Charge_discharge_data"/></option>        <!-- 充电/放电测试数据 -->
                                                <option value="charge"><s:text name="Discharge_data"/></option>                                                <!-- 充电测试数据 -->
                                                <option value="discharge"><s:text name="Charge_test_data"/></option>                                        <!-- 放电测试数据 -->
                                                <option value="Resistance-conductivity"><s:text name="Conductivity_Resistivity_data"/></option>                <!-- 电导电阻数据 -->
                                            </select>
                                            <div id="charge_sec_infor"></div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td id="charge_thr">
                                            <div id="charge_thr_infor">
                                                <!-- 真正的头部 -->
                                                <table id="charge_thr_th">
                                                    <thead>
                                                        <tr>
                                                            <th style="width:30%;"><s:text name="Number"></s:text>
                                                            </th>
                                                            <!-- 编号 -->
                                                            <th style="width:40%"><s:text name="Voltage"></s:text>(V)</th>
                                                            <!-- 电压 -->
                                                            <th style="width:30%"><input type="checkbox">
                                                            </th>
                                                        </tr>    
                                                    </thead>                                            
                                                    <tbody id="t_top">
                                                    </tbody>
                                                </table>
                                                <table class="res">
                                                    <thead>
                                                      <tr>
                                                        <th><s:text name="Number"/></th>                                    <!-- 编号 -->
                                                        <th><s:text name="Voltage"/></th>                                    <!-- 电压 -->
                                                        <th><s:text name="Temperature"/>(℃)</th>                            <!-- 温度 -->
                                                        <th><s:text name="Internal_resistance"/>(mΩ)</th>                    <!-- 内阻 -->
                                                        <th><s:text name="Conductance"/></th>                                <!-- 电导 -->
                                                        <th><s:text name="Conductivity_percentage"/>(%)</th>                <!-- 电导百分比 -->
                                                        <th><s:text name="Article_connection"/>(mΩ)</th>                    <!-- 连接条 -->
                                                      </tr>
                                                    </thead>
                                                    <tbody class="t_body">
                                                        
                                                    </tbody>
                                                </table>
                                            </div>
                                            </td>
                                    </tr>
                                </table></td>
                            <td id="r_echarts">
                                <!-- 放大表的容器 -->
                                <div id="big_echarts">
                                    <div id="big_echarts_container"></div>
                                </div>
                                <table id="table_echarts">
                                    <tr>
                                        <td>
                                            <div class="graph"><div id="ltop"></div></div>
                                        </td>
                                        <td>
                                            <div class="graph"><div id="lbottom"></div></div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <div class="graph"><div id="rtop"></div></div>
                                        </td>
                                        <td>
                                            <div class="graph"><div id="rbottom"></div></div>
                                        </td>
                                    </tr>
                                </table>
                                
                                
                                <form action="EchartPictureDowload.servlet" method="post" id="all_picture">
                                    <input type="hidden" name="pageName" value="exportTbal" /> 
                                    <input type="hidden" name="ltop_echart" id="ltop_echart" /> 
                                    <input type="hidden" name="rtop_echart" id="rtop_echart" /> 
                                    <input type="hidden" name="lbottom_echart" id="lbottom_echart" /> 
                                    <input type="hidden" name="rbottom_echart" id="rbottom_echart" />
                                    <input type="hidden" name="actucap_echart" id="actucap_echart"/>
                                    <input type="hidden" name="restcap_echart" id="restcap_echart"/>
                                    <input type="hidden" name="capperc_echart" id="capperc_echart"/>
                                    <input type="hidden" name="obj-bmd" id="obj-bmd"/>
                                    <input type="hidden" name="obj-title" id="obj-title"/>
                                    <input type="hidden" name="arr-data" id="arr-data"/>
                                </form>
                                
                                
                                <form action="EchartPictureDowload.servlet" method="post"    id="Big_picture">
                                    <input type="hidden" name="pageName" value="charge-test" /> 
                                    <input type="hidden" name="big_pic" id="big_pic" /> 
                                </form>
                                <div id="charge_bottom">
                                    <!-- <div id="slide">
                                        <div class="label">2012-12-06 00:00:00</div>
                                    </div> -->
                                    <div id="slider">
                                        <div class="label">2012-12-06 00:00:00</div>
                                    </div>
                                </div>
                            </td>
                        </tr>
                </table>
                </td>
            </tr>
        </table>
    </div>
    <!-- 当在图片上右键时 显示菜单-->
    
    <!-- 鼠标右键菜单显示 -->
    <div id="right_menu">
        <ul>
            <li><a href="javascript:"><s:text name="Check_the_battery_card"></s:text></a></li>                        <!-- 查看电池组机历卡 -->
            <li><a href="upload.jsp" target="_blank"><s:text name="Upload_FBO/IDC_data"></s:text></a></li>                        <!-- 上传'FBO/IDC'数据 -->
            <li><a href="uploadresis.jsp" target="_blank"><s:text name="Upload_resistance_conductivity_data"></s:text></a></li>            <!-- 上传电阻电导数据 -->
            <li><a href="eleBrdwMaint.jsp" target="_blank"><s:text name="Batt_failure_maintenance_record_query" /></a></li>                <!-- 电池故障维护记录查询 -->
            <li><a href="javascript:targetBattReport();"><s:text name="Battery_statistical_analysis_queries"></s:text></a></li>        <!-- 电池统计分析查询-->
            <!-- <li><a href="eleMonomer.jsp"><s:text name="Batt_statistical_analysis_query"></s:text></a></li>                 电池单体统计分析查询 -->
            <!-- <li><a href="javascript:" class="more_menu"><s:text name="Add_battery_test"/><span class="angle">&gt;&gt;</span></a>    添加到蓄电池组放电测试
                <div class="child_menu">
                    <p><s:text name="Add_switch_check_test"/></p>                                                    添加到拉闸动环核对性放电测试
                    <p><s:text name="Add_check_test"/></p>                                                            添加到核对性放电测试
                    <p><s:text name="Add_capacity_test"/></p>                                                        添加到容量实验放电测试
                </div>
            </li> -->
            <li style="display:none;"><a href="javascript:"><s:text name="Search_engine_or_the_batt_group"></s:text></a></li>                <!-- 搜索机房或电池组-->
            <li><a href="javascript:" id="all_show"><s:text name="Expand_all"></s:text></a></li>                                    <!-- 全部展开 -->
            <li><a href="javascript:" id="all_hide"><s:text name="Collapse_all"></s:text></a></li>                                <!-- 全部收缩 -->
        </ul>
    </div>
    <!-- 电池组机历卡详细信息-->
    <div id="card_infor">
        <span><s:text name="The_battery_pack_machine_through_the_card"/></span>            <!-- 电池组机历卡 -->
        <table>
            <tr>
                <th id="card_infor_left"><s:text name="Parameter_name"/></th>            <!-- 参数名称 -->
                <th><s:text name="Parameter_value"/></th>                                <!-- 参数值 -->
            </tr>
            <tr>
                <td><s:text name="Computer_room_ID"/></td>                                <!-- 机房ID -->
                <td id="StationId"></td>
            </tr>
            <tr>
                <td><s:text name="Computer_name"/></td>                    <!-- 机房名称 -->
                <td id="StationName"></td>
            </tr>
            <tr>
                <td><s:text name="Computer_room_IP"/></td>                <!-- 机房IP -->
                <td id="StationIP"></td>
            </tr>
            <tr>
                <td><s:text name="Batt_group"/>ID</td>                                <!-- 机房ID -->
                <td id="batt_group_id"></td>
            </tr>
            <tr>
                <td><s:text name="Battery_name"/></td>                    <!-- 电池组名称 -->
                <td id="BattGroupName"></td>
            </tr>
            <tr>
                <td><s:text name="Battery_number"/></td>                <!-- 电池组序号 -->
                <td id="BattGroupNum"></td>
            </tr>
            <tr>
                <td><s:text name="Battery_brand"/></td>                    <!-- 电池品牌 -->
                <td id="BattProducer"></td>
            </tr>
            <tr>
                <td><s:text name="Battery_model"/></td>                    <!-- 电池型号 -->
                <td  id="BattModel"></td>
            </tr>
            <tr>
                <td><s:text name="Nominal_capacity"/>(AH)</td>            <!-- 标称容量 -->
                <td id="MonCapStd"></td>
            </tr>
            <tr>
                <td><s:text name="Nomina_voltage_monomer"/>(V)</td>        <!-- 标称单体电压 -->
                <td id="MonVolStd"></td>
            </tr>
            <tr>
                <td><s:text name="Monomer_All"/></td>                    <!-- 单体数量(节) -->
                <td id="MonCount"></td>
            </tr>
            <tr>
                <td><s:text name="Put_into_use_time"/>(y-M-d)</td>        <!-- 投入使用时间(年-月-日) -->
                <td id="BattInUseDate"></td>
            </tr>
            <tr>
                <td><s:text name="Guarantee"/><s:text name="Time_limit"/>(<s:text name="Day"/>)</td>        <!-- 保修期限(天) -->
                <td id="BattGuarantDayCount"></td>
            </tr>
            <tr>
                <td><s:text name="Battery_float_charging_valve"/>(A)</td>    <!--     电池浮充电流阀值 -->
                <td id="BattFloatCurrent"></td>
            </tr>
            <tr>
                <td><s:text name="Battery_voltage_threshold"/>(V)</td>            <!-- 电池充电电压阀值 -->
                <td id="FloatVolLevel"></td>
            </tr>
            <tr>
                <td><s:text name="Head"/></td>                                    <!-- 负责人 -->
                <td></td>
            </tr>
        </table>
        <input type="button" name="" id="out_card_infor" value="<s:text name='Return'/>">
    </div>
    
    <!-- 搜索机房或电池组 -->
    <div id="search_room" >
        <span><s:text name="Search_engine_or_the_battery_pac"/></span>            <!-- 搜索机房或电池组 -->
        <div id="input_container">
            <input type="text" name="" id="search_input" placeholder="<s:text name='Please_enter_the_key_words'/>" autocomplete="off"  value="">
            <select id='search-type'>
                <option value='1'>机房</option>
                <option value='0'>电池组</option>
            </select>
        </div>
        <p><s:text name="Computer_room_or_battery_name"/></p>                    <!-- 机房或电池组名称 -->
        <div id="search_info">
            
        </div>
        <div class="btn_container">
            <input type="button" name="" id="en_search" value="<s:text name='Determine'/>">
            <input type="button" name="" id="out_search" value="<s:text name='Exit'/>">
        </div>
    </div>    
    <!-- 整体的遮罩层 -->
    <div id="allShade"></div>
    
    <!-- 导出当前图到Excel右键菜单 -->
    <div id="echarts_menu">
        <ul class="export-ul">
            <li><a href="javascript:"><s:text name='Monomer_voltage'/></a></li>                                    <!-- 单体电压 -->
            <li><a href="javascript:"><s:text name='Monomer'/><s:text name='Actual_capacity'/></a></li>            <!-- 单体实际容量 -->
            <li><a href="javascript:"><s:text name='Monomer'/><s:text name='Residual_capacity'/></a></li>        <!-- 单体剩余容量 -->
            <li><a href="javascript:"><s:text name='Monomer'/><s:text name='Percent_total_capacity'/></a></li>    <!-- 单体容量百分比 -->
        </ul>
        
        <ul>
            <li><a href="javascript:" class="export-a"></a></li>
            <li><a href="javascript:ExportAll()"><s:text name="Export"/><s:text name="Test_data"/><s:text name="Report"/></a></li>        <!-- 导出测试数据报表-->
        </ul>
    </div>
    
    <!-- 导出放大之后的图到Excel中 -->
    <div id="bigecharts_menu">
        <ul><li><a href="javascript:ExportBigpic()"><s:text name="Export" /><s:text name="Bar_graph" />/<s:text name="Line_graph" /></a></li></ul>
    </div>
    
    <div id="bigEchartsCon"></div>
    <!-- 清除浮动 -->
    <div class="clear"></div>
    <div id="allGraph">
        <div class="chart-contain">
            <div class="chart"></div>
        </div>
    </div>
</body>
<script type="text/javascript" src="jqueryui/jquery-ui.js"></script>
<script type="text/javascript" src="js/collapse.js"></script>
<script type="text/javascript">
    var permits;
    <%    Object obj=session.getAttribute("permits");
        if(obj != null){
            String permits =obj.toString();%>
            permits=<%=permits%>;
            //console.info(json);
    <%    }%>
    //console.info(permits);
    var isCanExport = false;
    
    var BattinfObj;
    var Battimeinfo;    //每个时刻电池的信息
    var slide_index=0;    //滑块停留的位置
    var battinlist = [];        //电池组信息数组
    var Monnum_list;    //声明电池编号数组
    var Monvol_list;    //声明电池电压数组
    var SlideLength;    //滑块距离左端的距离
    var AllBataDate;    //格式化之后的该电池组中所有电池的测试信息
    var Mon_reacaplist=new Array();        //当前的实际容量数组
    var Mon_overcaplist=new Array();    //当前的剩余容量数组
    var Mon_percaplist=new Array();        //当前容量百分比数组
    
    var BattData;        //生成折线图的二维数组
    var TestTime;        //时间数组
    var BattGroupVol = new Array();    //存放电池组组端电压的数组
    //var BattOnlineVol;    //存放电池组在线电压的数组
    var BattGroupCurr;    //存放电池组电流的数组
    var AllTestData;    //原始的测试数据
    var thrname;        //三张折线图的title
    var tname;            //条形图的title
    var dbname;            //鼠标双击的图名
    
    var Restitle;            //电阻条形图title
    var Serpercenttitle;    //电导百分比折线图title
    var Montitle;            //电压条形图title
    var Sertitle;            //电导条形图title
    var li_index=0;            //用于标记当前选中的是单体电压(0),单体实际容量(1),单体剩余容量(2),单体容量百分比(3)
    
    var oChargeBtm=document.getElementById("charge_bottom");
    var Olside = document.getElementById("lside");    //电池组菜单栏
    
    var allGraph = echarts.init($('#allGraph .chart-contain .chart').get(0));
    //console.info(allGraph);
    
    var Ocharge_sec_infor=document.getElementById("charge_sec_infor");                //测试记录显示
    var lsideLength=Olside.offsetWidth;
    //console.info(lsideLength);
    
    var isFirLoadPage = 1;    // 判断是否是第一次加载页面
    
    //console.info(SlideLength);
    var Ot_top = document.getElementById("t_top");
    
    loading.showLoading($('#lside'));
    // 给页面添加等待内容
    $(document).ready(function() {
        // 给页面添加等待内容 
        searchAllBattNum($('#batt_group_num'));
        loading.showLoading($('#charge_sec_infor'));
        
        clearfourPicture();
    });
    
    function getQueryString(name) { 
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); 
        var r = window.location.search.substr(1).match(reg); 
        if (r != null) 
            return unescape(r[2]); 
        return null; 
    } 
    
    //查询所有下拉菜单
    function findBattin(){
        $.post("BattInfAction_findMenu", null, function(data) {
            //data = eval("(" + data + ")");
            data = data.result;
            data=eval("("+data+")");
            //console.info(data);
            if(data.code==1 && data.data.length>0){
                data=data.data;
                //battinlist = data;
                //console.info(battinlist);
                //alert(battinlist.length);
                //createMenu();
            }
        });
    }
    
    function Inornot(arr,name,length){
        var flag=false;            
        for(var i=0;i<length;i++){    
            //alert(arr[i]+"&&"+name);            
            if(arr[i]==name){
                flag=true;
                break;
            }
        }
        return flag;
    }
    
    var Rtdatalist;
    var BattGroupId=0;
    var fir_index=0,sec_index=0;
    var firarr=new Array();
    var secarr=new Array();
    //var time;
    
    var MenuList=new Array();
    var menu_index=0;
    //生成下拉菜单
    function createMenu() {
        if (battinlist.length > 0) {            
            var Olside = document.getElementById("lside");
            Olside.innerHTML = "";
            var ul = createEle("ul");
            //console.info(battinlist[0]);                
            for ( var i = 0; i < battinlist.length; i++) {
                if(fir_index>0 && Inornot(firarr, battinlist[i].StationName,fir_index)){
                    continue;
                }
                
                //console.info(battinlist[i]);
                var li1 = createEle("li");
                var a1 = createEle("a");
                //console.info(battinlist[i]);                    
                a1.innerHTML ="<strong class='arrow down'></strong>"+battinlist[i].StationName;
                a1.setAttribute("class", "fir");
                //设置a标签的class改为class="fir"  
                a1.setAttribute("id",battinlist[i].StationName);
                a1.setAttribute("name",battinlist[i].StationId);
                
                firarr[fir_index++]=battinlist[i].StationName;    
                
                MenuList[menu_index]=new Array();
                MenuList[menu_index][0]=battinlist[i].StationId;
                MenuList[menu_index][1]=battinlist[i].StationName;
                MenuList[menu_index++][2]=0;
                                    
                ul1 = createEle("ul");
                secarr=new Array();
                for(var j=i;j<battinlist.length;j++){
                    if(battinlist[j].StationName!=battinlist[i].StationName){
                        continue;
                    }
                    if(sec_index>0 && Inornot(secarr, battinlist[j].BattGroupName1,sec_index)){
                            continue;
                    }
                    li2 = createEle("li");
                    a2 = createEle("a");
                    
                    a2.innerHTML =$.trim(battinlist[j].BattGroupName1).length==0?"":"<strong class='mark'>+</strong>"+ battinlist[j].BattGroupName1;
                    secarr[sec_index++]=battinlist[j].BattGroupName1;
                    a2.setAttribute("class", "sec");
                    //设置a标签的class改为class="sec"
                    a2.setAttribute("id",battinlist[j].StationId);
                    a2.setAttribute("value",battinlist[j].StationName);
                    ul2 = createEle("ul");
                    
                    if($.trim(battinlist[j].BattGroupName1).length == 0){                        
                        MenuList[menu_index]=new Array();
                        MenuList[menu_index][0]=battinlist[j].StationId;
                        MenuList[menu_index++][1]=battinlist[j].BattGroupName1;
                        
                        //console.info(MenuList);
                    }
                    
                    for ( var k = 0; k < battinlist.length; k++) {
                            if (battinlist[i].StationName == battinlist[k].StationName && battinlist[j].BattGroupName1 == battinlist[k].BattGroupName1) {
                                var li3 = createEle("li");
                                var a3 = createEle("a");
                                a3.innerHTML = battinlist[k].BattGroupName;
                                a3.setAttribute("class", "thr");
                                a3.setAttribute("id",battinlist[k].BattGroupId);
                                a3.setAttribute("value",battinlist[k].BattGroupName1);
                                
                                MenuList[menu_index]=new Array();
                                MenuList[menu_index][0]=battinlist[k].StationId;
                                MenuList[menu_index][1]=battinlist[k].BattGroupName;
                                MenuList[menu_index][2]=battinlist[k].BattGroupName1;
                                MenuList[menu_index++][3]=battinlist[k].BattGroupId;
                                //设置a标签的class改为class="thr"
                                li3.appendChild(a3);
                                ul2.appendChild(li3);
                            }
                        }
                    
                    li2.appendChild(a2);
                    li2.appendChild(ul2);
                    ul1.appendChild(li2);
                }
                li1.appendChild(a1);            
                li1.appendChild(ul1);
                ul.appendChild(li1);
            }
            Olside.appendChild(ul);
            clearSec();    
        }
        
        // 对空白的二级导航进行清理
        function clearSec() {
            $('#lside').find('.sec').each(function(){
                if($(this).text().trim().length == 0) {
                    $(this).hide();
                }
            });
        }
            
        //使拖拉的块(#r_b)一直处在div的可视区域
        $(document).ready(function(){
            $("#lside").scroll(function(){
                var scrollHeight=$("#lside").scrollTop();        //获取滚动条滚动的高度
                // console.info(scrollHeight);
                var scrollWidth=$("#lside").scrollLeft();        //获取滚动条滚动的宽度
                // console.log(scrollWidth);
                $("#r_b").css("top",scrollHeight);        //设置(上下)拖拉块的位置
                $("#r_b").css("right",-scrollWidth);
            });
        });
 
        
        
        //动态的设置左导航的高度
        $(document).ready(function(){        
            var rHeight=$("#rside").height();
            var batt_listen = $('#ele_content .batt-listen').height();
            
            $("#lside").css("height",rHeight-30 -batt_listen+"px");
            
        });
 
        //初始化左导航
        $(document).ready(function(){
            //console.info(2222);
            //根据域名中传递过来的battgroupid找到指定的电池组        
            var thr_id=getQueryString("battgroupId");
            if(thr_id!=undefined){
                BattGroupId=thr_id;
                //获得一级菜单并展示二级菜单
                var secTag =$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().next();
                var secTagA = $('#'+thr_id).parent().parent().siblings().first();
                //console.info(secTagA.text()+'******');
                if(secTagA.text().trim().length == 0) {
                    secTagA.hide();
                }
                secTag.show();
                //$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().next().show();
                //获得二级菜单并展示三级菜单
                $('#'+thr_id).parent().parent().siblings().first().next().show();
                $('#'+thr_id).css('background-color','#9bbaf3');
                //一级菜单展开样式
                $('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').removeClass("down");
                $('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').addClass("up");
                $('#'+thr_id).parent().parent().siblings().first().children('.mark').text('-');
                $('#'+thr_id).parent().parent().siblings().first().children('.mark').addClass('black');
                //alert($('#'+thr_id).parent().parent().siblings().first().text());
                location.hash="#"+thr_id;
            }else{
                $('.fir:first').next().css('display','block');
                $('.sec:first').next().css('display','block');
                $('.thr:first').css('background-color','#9bbaf3');
                $('#address_infor').text($('.fir:first').text()+"-"+$('.sec:first').text()+"-"+$('.thr:first').text());
                
                //初始化内容
                $(".arrow").eq(0).removeClass("down");
                $(".arrow").eq(0).addClass("up");
                $(".mark").eq(0).text("-");
                $(".mark").eq(0).addClass("black");
                BattGroupId=$('.thr:first').attr("id");
            }                
            for(var i=0;i<$('.fir:first').next().children().length;i++)
            {
                if($('.fir:first').next().children().eq(i).children().eq(0).text()=='')
                {
                    $('.fir:first').next().children().eq(i).children().eq(0).css('display','none');
                }
            }
            findBattinfObj();
            AllBataDate=new Array();
            clearfourPicture();
            findBatttestdata_infByBattGroupId();
            searchAll_lowAction();            //获取阀值
        });
        
        // 使用jquery实现左导航的显示和隐藏
        $(document).ready(function(){
            //二级左菜单的显示和隐藏
            $('.fir').click(function(){
                $('.thr').css('background-color','');
                $('.fir').css('background-color','');
                $('.sec').css('background-color','');
                $(this).css('background-color','#9bbaf3');
                $(this).css('color','black');
                // alert($(this).next().children().eq(0).children().eq(0).text());
                //修复二级为空时的bug
                for(var i=0;i<$(this).next().children().length;i++)
                {
                    if($(this).next().children().eq(i).children().eq(0).text()=='')
                    {
                        $(this).next().children().eq(i).children().eq(0).css('display','none');
                        $(this).next().children().eq(i).children().eq(0).next().slideToggle();
                    }
                }
                $(this).next().slideToggle();
            });
            
            //三级左菜单的显示和隐藏
            $('.sec').click(function(){
                $('.thr').css('background-color','');
                $('.fir').css('background-color','');
                $('.sec').css('background-color','');
                //alert($(this).parent().parent().siblings().get(0).tagName);
                $(this).css('background-color','#9bbaf3');
                $(this).next().slideToggle();
            });
            // 三级菜单选中时背景色改变
            $('.thr').click(function(){
                $('.thr').css('background-color','');
                $('.fir').css('background-color','');
                $('.sec').css('background-color','');
                $(this).css('background-color','#9bbaf3');
                
                isCanExport = false;
                
                //显示电池的详细信息
                $('#address_infor').text($(this).parent().parent().parent().parent().siblings().first().text()+"-"+$(this).parent().parent().siblings().first().text()+"-"+$(this).text());
            
                BattGroupId=$(this).attr("id");
                $("#t_top").get(0).innerHTML="";
                $("#charge_thr_infor .t_body").get(0).innerHTML="";
                Ocharge_sec_infor.innerHTML="";
                if($("#charge_select_type option:selected").val()=='Resistance-conductivity'){
                    findBattinfObj();                    
                    reflushBattStatus(BattinfObj);
                    findBattresdata_infActiondata();
                }else{    
                    findBatttestdata_infByBattGroupId();            
                }                
                clearfourPicture();
            });
        });
        
        //屏蔽浏览器右键菜单功能
        $(document).ready(function(){
            document.oncontextmenu=function(){
                return false;
            };
        });
        // 菜单栏鼠标右键菜单显示
        $(document).ready(function(){
            $('.thr').mousedown(function(e){
                //利用jquery的方式获取当前点击的是否是右键
                if(e.which==3)
                {
                    BattGroupId=$(this).attr("id");                    
                    var disX=(e||event).clientX+10;            //得到鼠标点击X的位置
                      var disY=(e||event).clientY+10;            //得到鼠标点击Y的位置
                      var scrollY=$(document).scrollTop();        //获取浏览器滚动的高度
 
                      var oRightMenu=document.getElementById("right_menu");
                      $(this).click();
                      
                      //显示菜单内容
                      $("#right_menu").show();
                      $("#right_menu .more_menu").hide();
                      //使菜单跟随鼠标位置
                      oRightMenu.style.left=disX+'px';
                      oRightMenu.style.top=disY+scrollY+'px';
                      
                      setPosition($("#right_menu"),disX, disY);
                }
            });
            
            //利用not选中器使不是点击.thr时就隐藏菜单
            $("body:not('.thr')").click(function(){
                if($("#right_menu").is(':hidden') && $("#echarts_menu").is(':hidden') && $("#bigecharts_menu").is(':hidden'))
                {    //屏蔽浏览器右键菜单功能
                    document.oncontextmenu=function(){
                        return false;
                    };
                }else{
                    //隐藏右键菜单
                    $("#right_menu").hide();
                    $("#echarts_menu").hide();
                    $("#bigecharts_menu").hide();
                }
            });
        });
        //使遮罩层和弹出层一直处在页面内
        $(document).ready(function(){
            $(document).scroll(function(){
                var scrollY=$(document).scrollTop();
                $('#allShade').css('top',scrollY+"px");
            });
        });
       
        
        //点击返回按钮显示主页面隐藏弹出
        $(document).ready(function(){
            //退出电池组机历卡
            $('#out_card_infor').click(function(){
                $('#card_infor').hide();    //隐藏电池组机利卡
                $('#allShade').hide();
            });
            //退出上传FBO和IDE数据
            $('#out_upload_fbo').click(function(){
                $('#upload_fbo').hide();    //隐藏上传
                $('#allShade').hide();
            });
            //退出搜索机房或电池组
            $('#out_search').click(function(){
                $('#search_room').hide();
                $('#allShade').hide();
                $('#search_input').val('');
                document.getElementById("search_info").innerHTML="";
            });
        });    
         //显示和隐藏查询选项事件
        $(document).ready(function(){
            //点击上传FBO和IDE数据内的显示和隐藏
            $("#upload_fbo p").click(function(){
                $("#upload_fbo .show_hide_opt").slideToggle(1000);
            });
        });        
            
        }
        
        //创建指定的小图
        function createallpicture(){
            if($('#big_echarts').css("display")=='block'){
                 showBigPicture();
             }else{
                 var checkvalue=$("#charge_select_type option:selected").val();
                 if(checkvalue=='Resistance-conductivity'){
                     CreateResEchart('ResEchart',oLTop,Monnum_list,monres_list,Restitle);
                    CreateSerpercentChart("mySerpercentChart",oRTop,Monnum_list,percentage_list,Serpercenttitle);
                    CreateMonEchart('MonEchart',oLBottom,Monnum_list,mon_vol_list,Montitle);
                    CreateSerEchart('SerEchart',oRBottom,Monnum_list,monser_list,Sertitle);
                 }else{
                     createEchartBar(AllData,slide_index,li_index);
                     //var title=getTitle(allMonVol[allMonVol.length-1],"Voltage");
                    //CreateEchart(oLBottom,Voltage,Monnum_list,allMonVol[slide_index],title);                    //生成左下条形图
                    CreateLineEchartTop('myLineChartTop',oLTop,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname);            //生成左上折线图
                    CreateRightLineEchart('myRightLineChart',rtop, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname);    //生成右上折线图
                     UpdatamyLineChart(checkArray);
                 }                     
             }
        }
        
        
        //根据当前选中的三级菜单查询其相关信息
        function findBattinfObj(){
            if(battinlist!=undefined && battinlist.length>0){
                
                for(var i=0;i<battinlist.length;i++){
                    if(battinlist[i].BattGroupId==BattGroupId){
                        BattinfObj=battinlist[i];
                        break;
                    }
                }
            }else{
                BattinfObj=undefined;
            }            
        }
        
        //根据当前放大的图表拉动页面后显示放大后的图片
        function showBigPicture(){
            //console.info(dbname);
            var checkvalue=$("#charge_select_type option:selected").val();
            if(dbname=="ltop"){
                if(checkvalue=='Resistance-conductivity'){
                    CreateResEchart('BigResEchart',big_echarts_container,Monnum_list,monres_list,Sertitle);
                }else{                
                    CreateLineEchartTop('mybigLineChartTop',obig_echarts_container,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname);            //生成左上折线图        
                }
            }else if(dbname=="rtop"){
                if(checkvalue=='Resistance-conductivity'){
                    CreateSerpercentChart('mybigSerpercentChart',obig_echarts_container,Monnum_list,percentage_list,Serpercenttitle);
                }else{
                    CreateRightLineEchart('mybigRightLineChart',obig_echarts_container, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname);    //生成右上折线图
                }
            }else if(dbname=="lbottom"){
                if(checkvalue=='Resistance-conductivity'){
                    CreateMonEchart('BigMonEchart',obig_echarts_container,Monnum_list,mon_vol_list,Montitle);
                }else{
                    //console.info(Monnum_list);
                    CreateBigEchart(obig_echarts_container,Voltage,Monnum_list,Monvol_list,Titleobj.getAllTile("Voltage"));        //生成左下条形图
                }
            }else if(dbname=="rbottom"){
                if(checkvalue=='Resistance-conductivity'){
                    CreateSerEchart('BigSerEchart',obig_echarts_container,Monnum_list,monser_list,Sertitle);
                }else{
                    UpdatamyLineChart(checkArray);
                }
            }
        }
        
        //初始化页面解决页面的bug
        $(document).ready(function(){
            $("#lside").scrollTop(0);        //初始化左导航上下滑动的位置
            $("#lside").scrollLeft(0);        //初始化左导航左右滑动的位置
        });
        
        var batttext_type = ['节能放电','停电放电','节能充电','停电充电'];
        //根据电池组id查询电池的测试信息
        function findBatttestdata_infByBattGroupId(){
            $ajax("post","Batttestdata_infAction_findByInfo","bti.BattGroupId="+BattGroupId,function(data){
                data=eval("("+data+")");
                //console.info(data.result);
                data=data.result;
                data=eval("("+data+")");
                var Ocharge_sec_infor=document.getElementById("charge_sec_infor");
                Ocharge_sec_infor.innerHTML="";
                
                if(data.code==1 && data.data.length>0){
                    data=data.data;
                    var temp  = checktestRecord(data);
                    collapse($('#charge_sec_infor'), temp);
                }else{
                    var temp  = checktestRecord(new Array());
                    collapse($('#charge_sec_infor'), temp); 
                    AllBataDate=undefined;
                }
                //setbackground();
            });
        }
        
        function checktestRecord(list){
            var temp = new Array();
            //console.info(list);
            var jienengDisCobj = {
                title:'节能放电',
                items:new Array()
            };
            var tingdianDisCobj = {
                title:'停电放电',
                items:new Array()
            };
            var jienengCobj = {
                title:'节能充电',
                items:new Array()
            };
            var tingdianCobj = {
                title:'停电充电',
                items:new Array()
            };
            
            for(var i =0 ;list!=undefined && i<list.length;i++){
                if(list[i].test_type == 3){
                    if(list[i].test_starttype == 3){    
                        //节能放电
                        jienengDisCobj.items.push({
                            txt:list[i].test_starttime,
                            val:list[i].test_record_count
                        });
                    }else{
                        //停电放电
                        tingdianDisCobj.items.push({
                            txt:list[i].test_starttime,
                            val:list[i].test_record_count
                        });
                    }
                }else if(list[i].test_type == 2){
                    if(list[i].test_starttype == 3){
                        //节能充电
                        jienengCobj.items.push({
                            txt:list[i].test_starttime,
                            val:list[i].test_record_count
                        });
                    }else{
                        //停电充电
                        tingdianCobj.items.push({
                            txt:list[i].test_starttime,
                            val:list[i].test_record_count
                        });
                    }                    
                }
            }
            if($('#charge_select_type').val() == 'charge-discharge'){
                temp.push(jienengDisCobj);
                temp.push(tingdianDisCobj);
                temp.push(jienengCobj);
                temp.push(tingdianCobj);
            }else if($('#charge_select_type').val() == 'charge'){
                temp.push(jienengCobj);
                temp.push(tingdianCobj);
            }else if($('#charge_select_type').val() == 'discharge'){
                temp.push(jienengDisCobj);
                temp.push(tingdianDisCobj);
            }
            //console.info(temp);
            return temp;
        }
        
           $(document).ready(function(){
               $("#charge_sec_infor").on('dblclick','li a',function(){
                   var AllCheck=$("#charge_thr_th input[type='checkbox']");
                   
                   AllCheck.checked="checked";
                   var selectvalue=$("#charge_select_type option:selected").val();
                   if(selectvalue=='Resistance-conductivity'){
                       findbattredata($(this).attr('value'));
                   }else{
                       isCanExport = true;
                       //createWait($('#r_echarts'));
                       loading.showLoading($('#r_echarts'));                       
                       createPicture($(this).attr('value'));                           
                       findtestdatastop($(this).attr('value'));
                       
                       $('#slider').slider({
                           value: 100
                       });
                   }
               });
           });        
        
        $("#charge_sec_infor").on("click","li",function(){
            $("#charge_sec_infor li").css("background-color","");
               $(this).css("background-color","#9bbaf3");
        });
        
        function toInformationArray(list){
            Monnum_list = new Array();    //初始化电池编号数组
            Monvol_list = new Array();    //初始化电池电压数组
            checkArray  = new Array();
            for(var i=0;i<list.length;i++){
                Monnum_list[i]="#"+list[i].mon_num;
                Monvol_list[i]=list[i].mon_vol.toFixed(3);
                checkArray.push(1);
            }
        }
        
        
        //查询指定的电池组id下指定测试次数的测试数据
        /* function createPicture(record_count){
            //alert(record_count);
            $ajax("post","BatttestdataAction_findByInfo","btd.BattGroupId="+BattGroupId+"&btd.test_record_count="+record_count, function(data){
                data=eval("("+data+")");
                data=data.result;
                data=eval("("+data+")");
                if(data.code==1){
                    data=data.data;
                    AllTestData=data;
                    //console.info(AllTestData);                    
                    formatAlldata();
                }                
            });
        } */
        //查询指定的电池组id下指定测试次数的测试数据
        function createPicture(record_count){
            $.ajax({     
                   type: "post",                 
                url: "BatttestdataAction!findhistory",                
                async:true,                
                dataType:'text',
                data:"json="+JSON.stringify({
                        BattGroupId:BattGroupId,
                        test_record_count:record_count
                    }),        
                success: function(data){ 
                    data = eval("("+data+")");
                    var model = eval("("+data.result+")");
                    //console.info(model);
                    if(model.code==1){
                        data=model.data;
                        AllTestData = model.data;
                        //console.info(AllTestData);                    
                        formatAlldata();
                    }
                    loading.hideLoading($('#r_echarts'));
                },                
                error:function(){                    
                    noContent.showNoContent("查询失败,请检查网络连接!");
                    loading.hideLoading($('#r_echarts'));
                }            
            });
            
        }
        
        
        //更新电池组状态栏
        function reflushBattStatus(list){    
            //console.info(list);        
            var checkvalue=$("#charge_select_type option:selected").val();    
            var ele_state=document.getElementById("ele_state");            //电池状态  充电;放电;...
            var ele_tension = document.getElementById("ele_tension");    //组端电压
            var ele_current=document.getElementById("ele_current");        //电池电流
            var test_date=document.getElementById("test_date");            //测试日期
            var test_time=document.getElementById("test_time");            //测试时长
            var test_content=document.getElementById("test_content");    //测试容量
            var over_content=document.getElementById("over_content");    //剩余容量
            var reserve_time=document.getElementById("reserve_time");    //后备时间
            if(list!=undefined && checkvalue!="Resistance-conductivity"){
                //console.info(list);
                ele_state.value=list.test_type==3?discharging:list.test_type==2?charging:"else";;
                
                ele_tension.value="在线:"+list.online_vol.toFixed(1)+"V;"+"组端:"+list.group_vol.toFixed(1)+"V";
                ele_current.value=list.test_curr.toFixed(1)+"A";
                test_date.value=list.test_starttime;
                test_time.value=formatSeconds(list.test_timelong);
                test_content.value=list.test_cap.toFixed(1)+"AH";
                
                
                var battinf=getBattinfById();
                var arr = batt_test_data[slide_index];
                //console.info("MonCapStd:"+battinf.MonCapStd+";test_curr:"+list.test_curr+";test_cap:"+list.test_cap+";maxvol:"+Math.max.apply(null, Monvol_list)+";minvol:"+Math.min.apply(null, Monvol_list)+";monvolstd:"+battinf.MonVolStd);
                var over_cap=GetMonomerCap(battinf.MonCapStd,GetHourRate(battinf.MonCapStd,list.test_curr),list.test_cap,Math.max.apply(null, arr),Math.min.apply(null, arr),battinf.MonVolStd,CapType_Rest);
                //console.info(over_cap);
                if(list.test_type == 2){
                    over_content.value="---";
                }else{
                    over_content.value=over_cap.toFixed(1)+"AH";
                }
                reserve_time.value=formatTime1(GetRestTimeSecond(over_cap,list.test_curr).toFixed(0));
                //alert(formatTime1(120));
            }else if(list != undefined && checkvalue=="Resistance-conductivity"){
                //当选中的是电阻电导数据时
                //console.info(list);
                ele_state.value=list.MonCount;
                ele_tension.value=list.MonVolStd.toFixed(1)+"V";
                ele_current.value=list.MonCapStd+"A";
                test_date.value=list.MonResStd.toFixed(3)+"mΩ";
                test_time.value=list.MonSerStd;
                test_content.value=list.BattProducer;
                over_content.value=list.BattInUseDate;
                reserve_time.value="";
            }else{
                
                ele_state.value="";
                ele_tension.value="";
                ele_current.value="";
                test_date.value="";
                test_time.value="";
                test_content.value="";
                over_content.value="";
                reserve_time.value="";
                                
            }        
        }
        
        var oChargeThrInfor=document.getElementById("charge_thr_infor");
        var batteststopDataList = new Array();
        //根据指定的测试数据查询结束时的指定电池组的数据
        function findtestdatastop(record_count){            
            $ajax("post","BatttestdatastopAction_findByInfo","btds.BattGroupId="+BattGroupId+"&btds.test_record_count="+record_count, function(data){
                data=eval("("+data+")");
                data=data.result;
                data=eval("("+data+")");
                if(data.code==1){
                    data=data.data;
                    //console.info(data);
                    batteststopDataList = data;
                    toInformationArray(data);
                    var arr = new Array();
                    //console.info(data);
                    for(var i=0;i<data.length;i++){
                        arr[data[i].mon_num-1]=data[i].mon_vol.toFixed(3);
                    }                                        
                    createBattVoltable(arr);
                    //reflushBattStatus(data[0]);                    
                }                
            });
        
        
            
           
            //选中th内的复选框表格内的复选框都选中
               $(document).ready(function(){
                   var aInput=oChargeThrInfor.getElementsByTagName("input");
                   //初始化input
                   for(var i=0;i<aInput.length;i++)
                   {
                       aInput[i].checked=true;
                   }
                   //定义如果th内的复选框被选中则表格内的全部被选中否则全部取消
                   function CheckAll(){
                       if(aInput[0].checked==true)
                       {
                           for(var i=1;i<aInput.length;i++)
                           {
                               aInput[i].checked=true;
                           }
                       }else{
                           for(var i=1;i<aInput.length;i++)
                           {
                               aInput[i].checked=false;
                           }
                       }
                   }
                   aInput[0].onclick=CheckAll;
            });        
        }
        
        /* var arrTh=[
                "单体电压(V)",
                "实际容量(AH)",
                "剩余容量(AH)",
                "容量百分比(%)",
          ]; */
          var arrTh=[
                "<s:text name='Monomer_voltage'/>(V)",
                "<s:text name='Actual_capacity'/>(AH)",
                "<s:text name='Residual_capacity'/>(AH)",
                "<s:text name='Percent_total_capacity'/>(%)",
          ];
        
        var checkArray;        //复选框的选中数组
        function createBattVoltable(data){
            if(data!=undefined){
                        
                Ot_top.innerHTML="";
                for(var i=0;i<data.length;i++){
                    
                    var tr=createEle("tr");
                    var td1=createEle("td");
                    var td2=createEle("td");
                    var td3=createEle("td");
                    
                    td1.innerHTML=i+1;
                    td2.innerHTML=data[i];
                    if(checkArray[i]==1){
                        td3.innerHTML='<input type="checkbox" checked="checked"/>';
                    }else{
                        td3.innerHTML='<input type="checkbox"/>';
                    }
                    
                    tr.appendChild(td1);
                    tr.appendChild(td2);
                    tr.appendChild(td3);
                    
                    Ot_top.appendChild(tr);
                }
                    
                    
                    
                //checkArray=new Array();        //根据数组内的值判断是否显示折线1为显示
                //根据复选框更新图表内容
                $(document).ready(function(){
                    var myCheckbox=$("#t_top input[type='checkbox']");
                    var AllCheck=$("#charge_thr_th th input[type='checkbox']");
                    // console.log(AllCheck.length);
                    
                    myCheckbox.click(function(){
                        for(var i=0;i<myCheckbox.length;i++)
                        {
                            if(myCheckbox.eq(i).is(':checked'))
                            {
                                checkArray[i]=1;
                            }else{
                                checkArray[i]=0;
                            }
                        }
                        UpdatamyLineChart(checkArray);
                    });
                    AllCheck.click(function(){
                        if(AllCheck.is(':checked'))
                        {
                            for(var i=0;i<myCheckbox.length;i++)
                            {
                                checkArray[i]=1;
                            }
                        }else{
                            for(var i=0;i<myCheckbox.length;i++)
                            {
                                checkArray[i]=0;
                            }
                        }
                        //console.info(456);
                        UpdatamyLineChart(checkArray);
                    });
                });
                
                var vol_max=Math.max.apply(Math,data);
                var vol_min=Math.min.apply(Math,data);
                var ele=$('#t_top>tr');
                //console.info("max:"+vol_max);
                //console.info("min:"+vol_min);
                var maxflag=true,minflag=true;
                for(var i=0;i<data.length;i++){
                    if(vol_max==data[i] && maxflag){
                        ele.eq(i).find("td").eq(1).css("background","green");
                        maxflag=false;
                    }else if(vol_min==data[i] &&minflag){
                        ele.eq(i).find("td").eq(1).css("background","red");
                        minflag=false;
                    }
                }
                
            }
        }
        
        //根据电压表中选中的电池组显示在右下折线图中
        function UpdatamyLineChart(arr){
            if(arr!=undefined){            
                var lname=new Array();
                //var sdata=getArrByCheckBox(AllData);
                var sdata = getArrayByCheck(batt_test_voldata);
                var lname = getArrayByCheck(Monnum_list);
                for(var i=0;i<arr.length;i++){
                    if(arr[i]==1){
                        lname.push(Monnum_list[i]);
                    }
                }
                
                
                
                if($('#bigEchartsCon').css('display')=='block' && dbname=="rbottom"){                    
                    var bigEchartsCon= $('#bigEchartsCon').get(0);
                    //console.info(sdata);    
                    CreateLineEchart('mybigLineChart',bigEchartsCon,lname,TestTime,sdata,max,min,thrname);        //生成右下折线图
                    $('#bigEchartsCon').css('background-color','#fff');
                }else{
                    //console.info(sdata);                    
                    CreateLineEchart('myLineChart',oRBottom,lname,TestTime,sdata,max,min,thrname);
                }
            }else{
                CreateLineEchart('myLineChart',oRBottom,[],[],[],100,50);
            }
        }
        
        function findMonCount(battGroupId){            
            if(battGroupId>0){
                for(var i=0;i<battinlist.length;i++){
                    //console.info(battinlist[i]);
                    if(battGroupId==battinlist[i].BattGroupId){
                        return battinlist[i].MonCount;
                    }
                }
            }
            return -1;
        }
        
        window.onload = function() {
            //findBattin();
            
        };
        
        //根据电池组编号和测试次数查询电导数据
        function findbattredata(testcount){
            loading.showLoading($('#r_echarts'));
            //console.info(testcount);
            if(testcount!=undefined && BattGroupId!=undefined){
                $.post("BattresdataAction_serchByCondition","brd.BattGroupId="+BattGroupId+"&brd.test_record_count="+testcount,function(data){
                    data=data.result;
                    data=eval("("+data+")");
                    if(data.code==1 && data.data.length>0){
                        data=data.data;
                        //console.info(data);
                        getArray(data);
                        createRestab();
                        
                        CreateResEchart('ResEchart',oLTop,Monnum_list,monres_list,Restitle);
                        CreateSerpercentChart('mySerpercentChart',oRTop,Monnum_list,percentage_list,Serpercenttitle);
                        CreateMonEchart('MonEchart',oLBottom,Monnum_list,mon_vol_list,Montitle);
                        CreateSerEchart('SerEchart',oRBottom,Monnum_list,monser_list,Sertitle);
                    }
                });
            }else{
                loading.hideLoading($('#r_echarts'));
            }
            loading.hideLoading($('#r_echarts'));
        }
        
        //创建制定的电导记录生成表格
        function createRestab(){
            var tbody=$("#charge_thr_infor .t_body")[0];
            tbody.innerHTML="";
            for(var i=0;i<monres_list.length;i++){
                var tr=createEle("tr");
                
                var td1=createEle("td");
                var td2=createEle("td");
                var td3=createEle("td");
                var td4=createEle("td");
                var td5=createEle("td");
                var td6=createEle("td");
                var td7=createEle("td");
                
                td1.innerHTML=i+1;
                td2.innerHTML=mon_vol_list[i];
                //td2.style.backgroundColor="red";
                if(mon_vol_list[i]==Math.min.apply(Math,mon_vol_list)){
                    td2.style.backgroundColor="red";
                }else if(mon_vol_list[i]==Math.max.apply(Math,mon_vol_list)){
                    td2.style.backgroundColor="green";
                }                                
                td3.innerHTML=montmp_list[i];
                if(montmp_list[i]==Math.min.apply(Math,montmp_list)){
                    td3.style.backgroundColor="red";
                }else if(montmp_list[i]==Math.max.apply(Math,montmp_list)){
                    td3.style.backgroundColor="green";
                }
                td4.innerHTML=monres_list[i];
                if(monres_list[i]==Math.max.apply(Math,monres_list)){
                    td4.style.backgroundColor="red";
                }else if(monres_list[i]==Math.min.apply(Math,monres_list)){
                    td4.style.backgroundColor="green";
                }                
                td5.innerHTML=monser_list[i];
                if(monser_list[i]==Math.min.apply(Math,monser_list)){
                    td5.style.backgroundColor="red";
                }else if(monser_list[i]==Math.max.apply(Math,monser_list)){
                    td5.style.backgroundColor="green";
                }                
                td6.innerHTML=percentage_list[i];
                if(percentage_list[i]==Math.min.apply(Math,percentage_list)){
                    td6.style.backgroundColor="red";
                }else if(percentage_list[i]==Math.max.apply(Math,percentage_list)){
                    td6.style.backgroundColor="green";
                }
                td7.innerHTML=conn_res_list[i];
                if(conn_res_list[i]==Math.min.apply(Math,conn_res_list)){
                    td7.style.backgroundColor="red";
                }else if(conn_res_list[i]==Math.max.apply(Math,conn_res_list)){
                    td7.style.backgroundColor="green";
                }
                
                tr.appendChild(td1);
                tr.appendChild(td2);
                tr.appendChild(td3);
                tr.appendChild(td4);
                tr.appendChild(td5);
                tr.appendChild(td6);
                tr.appendChild(td7);
                
                tbody.appendChild(tr);
            }
        }
        
        var monres_list;        //电池单体电阻数组
        var    percentage_list;    //电导百分比数组
        var mon_vol_list;        //电池单体电压数组
        var monser_list;        //电池单体电导数组
        var montmp_list;        //电池单体温度数组
        var conn_res_list;        //连接条数组
        var ResTitleobj;        //内阻标题对象
        var VolTitleobj;        //单体电压对象
        var SerTitleobj;        //电导标题对象
        var SerPerTitleobj;        //电导百分比对象
                
        function getArray(list){
            if(list!=undefined && list.length>0){
                monres_list=new Array();        
                percentage_list=new Array();
                mon_vol_list=new Array();    
                montmp_list=new Array();    
                monser_list=new Array();
                conn_res_list=new Array();
                Monnum_list=new Array();
                ResTitleobj=new Title();        //内阻标题对象
                VolTitleobj=new Title();        //单体电压对象
                SerTitleobj=new Title();        //电导标题对象
                SerPerTitleobj=new Title();        //电导百分比对象
                
                var index;
                var sum_ser=0,sum_res=0;sum_respercentage=0,sum_vol=0,sum_serpercent=0;
                var batt=getBattinfById();
                //console.info(batt);
                for(var i=0;i<list.length;i++){
                    index = (list[i].mon_num/10).toFixed(0)-1;                    
                    Monnum_list[index]="#"+(index+1);
                    //percentage_list[index]=list[i].conn_res.toFixed(1);
                    monres_list[index]=list[i].mon_res.toFixed(3);
                    montmp_list[index]=list[i].mon_tmp.toFixed(1);
                    mon_vol_list[index]=list[i].mon_vol.toFixed(3);
                    conn_res_list[index]=list[i].conn_res.toFixed(3);
                    monser_list[index]=list[i].mon_ser.toFixed(0);
                    percentage_list[index]=(batt.MonSerStd==0?0:((list[i].mon_ser/batt.MonSerStd)*100)).toFixed(1);
                                        
                    sum_ser+=parseFloat(monser_list[index]);
                    sum_res+=parseFloat(monres_list[index]);
                    sum_respercentage+=parseFloat(percentage_list[index]),
                    sum_serpercent+=parseFloat(percentage_list[index]);
                    sum_vol+=parseFloat(mon_vol_list[index++]);
                }
                //console.info(Monnum_list);
                
                ResTitleobj.setMax(Math.max.apply(Math, monres_list));
                ResTitleobj.setMin(Math.min.apply(Math, monres_list));
                ResTitleobj.setAvg(sum_res/monres_list.length.toFixed(3));
                var low=getLow(3,2);
                //console.info(batt);
                if(low.low_method==0){
                    //根据标称值计算
                    ResTitleobj.setAlow(((2-low.low_value)*batt.MonResStd).toFixed(3));
                    low=getLow(3,3);
                    ResTitleobj.setClow(((2-low.low_value)*batt.MonResStd).toFixed(3));                    
                }else{
                    //根据平均值计算
                    ResTitleobj.setAlow(((2-low.low_value)*ResTitleobj.getAvg()).toFixed(3));
                    low=getLow(3,3);
                    ResTitleobj.setClow(((2-low.low_value)*ResTitleobj.getAvg()).toFixed(3));                
                }
                var count=0;
                for(var i=0;i<monres_list.length;i++){
                    if(parseFloat(ResTitleobj.getAlow())<parseFloat(monres_list[i])){
                        //console.info(title.getAlow()+"<"+array[i]);
                        count++;
                    }
                }
                ResTitleobj.setLc(count);
                ResTitleobj.setLp((count*100/monres_list.length).toFixed(1));                
                //设置电电阻数据的条形图title;
                Restitle=ResTitleobj.getAllTile("Resistance");
                //console.info(ResTitleobj);
                
                
                SerPerTitleobj.setMax(Math.max.apply(Math, percentage_list).toFixed(1));
                SerPerTitleobj.setMin(Math.min.apply(Math, percentage_list).toFixed(1));
                SerPerTitleobj.setAvg((sum_respercentage/percentage_list.length).toFixed(1));
                var low=getLow(3,2);
                if(low.low_method==0){
                    //根据标称值计算
                    SerPerTitleobj.setAlow((low.low_value*batt.monSerStd).toFixed(0));
                    low=getLow(3,3);
                    SerPerTitleobj.setClow((low.low_value*batt.monSerStd).toFixed(0));                    
                }else{
                    //根据平均值计算
                    SerPerTitleobj.setAlow((low.low_value*SerPerTitleobj.getAvg()).toFixed(0));
                    low=getLow(3,3);
                    SerPerTitleobj.setClow((low.low_value*SerPerTitleobj.getAvg()).toFixed(0));                
                }
                getLpLc(percentage_list,SerPerTitleobj);
                //console.info(SerPerTitleobj);
                //设置电电导百分比数据的条形图title;
                Serpercenttitle=SerPerTitleobj.getAllTile("Serpercent");
                //console.info(Serpercenttitle);
                //Serpercenttitle="MonSerPercent:MAX="+tmax+"%;MIN="+tmin+"%;AVG="+tavg+"%;Low=;LC=;LP=";
                
                VolTitleobj.setMax(Math.max.apply(Math, mon_vol_list));
                VolTitleobj.setMin(Math.min.apply(Math, mon_vol_list));
                VolTitleobj.setAvg(sum_vol/mon_vol_list.length.toFixed(3));
                var low=getLow(1,1);
                if(low.low_method==0){
                    //根据标称值计算
                    VolTitleobj.setAlow((low.low_value*batt.monVolStd).toFixed(3));
                    low=getLow(1,0);
                    VolTitleobj.setClow((low.low_value*batt.monVolStd).toFixed(3));                    
                }else{
                    //根据平均值计算
                    VolTitleobj.setAlow((low.low_value*VolTitleobj.getAvg()).toFixed(3));
                    low=getLow(1,0);
                    VolTitleobj.setClow((low.low_value*VolTitleobj.getAvg()).toFixed(3));                
                }
                getLpLc(mon_vol_list,VolTitleobj);
                //设置电电压数据的条形图title;
                Montitle=VolTitleobj.getAllTile("Voltage");
                
                SerTitleobj.setMax(Math.max.apply(Math, monser_list));
                SerTitleobj.setMin(Math.min.apply(Math, monser_list));
                SerTitleobj.setAvg((sum_ser/monser_list.length).toFixed(0));
                var low=getLow(3,2);
                if(low.low_method==0){
                    //根据标称值计算
                    SerTitleobj.setAlow((low.low_value*batt.monSerStd).toFixed(0));
                    low=getLow(3,3);
                    SerTitleobj.setClow((low.low_value*batt.monSerStd).toFixed(0));                    
                }else{
                    //根据平均值计算
                    SerTitleobj.setAlow((low.low_value*SerTitleobj.getAvg()).toFixed(0));
                    low=getLow(3,3);
                    SerTitleobj.setClow((low.low_value*SerTitleobj.getAvg()).toFixed(0));                
                }
                getLpLc(monser_list,SerTitleobj);
                //console.info(SerTitleobj);
                //设置电电导数据的条形图title;
                Sertitle=SerTitleobj.getAllTile("Conductance");
                
            }            
        }
        
        //根据title对象和数组获取Lplc的
        function getLpLc(array,titleobj){
            var count=0;
            for(var i=0;i<array.length;i++){
                //console.info(titleobj.getAlow()+"+++"+array[i]);
                if(parseFloat(titleobj.getAlow())>=parseFloat(array[i])){
                    count++;
                }
            }
            titleobj.setLc(count);
            titleobj.setLp((count*100/array.length).toFixed(1));
        }
        
        //根据当前选中的电池组id查询当前电池组的基本信息
        function getBattinfById(){
            if(battinlist!=undefined && BattGroupId!=undefined){
                for(var i=0;i<battinlist.length;i++){
                    for(var k=0;k<battinlist[i].length;k++){
                        if(BattGroupId==battinlist[i][k].BattGroupId){
                            return battinlist[i][k];
                        }
                    }
                }
            }
            return undefined;
        }
        
        function clearfourPicture(){
            
            var checkvalue=$("#charge_select_type option:selected").val();
            //alert(123);
            if(checkvalue=='Resistance-conductivity'){
                //alert(123);
                monres_list=[];        
                percentage_list=[];
                Monvol_list=[];
                monser_list=[];
                CreateResEchart('ResEchart',oLTop,[],[],'');
                CreateSerpercentChart("mySerpercentChart",oRTop,[],[],'');
                CreateMonEchart('MonEchart',oLBottom,[],[],'');
                CreateSerEchart('SerEchart',oRBottom,[],[],'');
                
            }else{
                //alert("不是电导");
                //CreateResEchart(oLTop,Voltage,[],[],100,0);
                allMonVol=[];
                BattGroupVol=[];
                BattGroupCurr=[];
                AllBataDate=[];
                Monvol_list=[];
                CreateEchart(oLBottom,Voltage,[],[],"");        //生成条形图
                CreateLineEchartTop('myLineChartTop',oLTop,[], [], [[],[]],100,50);            //生成左上折线图
                CreateRightLineEchart('myRightLineChart',rtop, batt_curr, [], [], 100,0);        //生成右上折线图
                CreateLineEchart('myLineChart',oRBottom,[],[],[],100,50);
                
            }
        }
        
        var RL_max;                    //右下最大值
        var RL_min;                    //右下最小值
        var AllData;
        
        var batt_test_data = new Array();                //左下条形图中的所有数组
        var batt_test_voldata = new Array();            //右下折线图中的所有数组
        var batt_test_tmpdata = new Array();            //右下折线图中的所有数组
        var batt_test_evary_record = new Array();        //记录当前测试记录的每笔的组端测试值
        
        var recordAlldata = new Array();                ///记录每一笔数据所有单体的信息用于导出报表中的导出放电记录
        
        //格式化从数据库中查询出来的数据
        function formatAlldata(){
            BattData=new Array();            //右下折线图中的所有数组
            TestTime=new Array();            //横坐标轴
            BattGroupVol=new Array();        //组端电压
            BattOnlineVol = new Array();    //在线电压
            BattGroupCurr=new Array();        //测试电流
            Battimeinfo=new Array();
            AllBataDate=new Array();    
            
            batt_test_data = new Array();                //左下条形图中的所有数组
            batt_test_voldata = new Array();            //右下折线图中的单体电压所有数组
            batt_test_tmpdata = new Array();            //右下折线图中的单体温度所有数组
            batt_test_evary_record = new Array();        //记录当前测试记录的每笔的组端测试值
            //console.info(AllTestData);
            
            if(AllTestData!=undefined){
                if(Monnum_list != undefined && Monnum_list.length>0){
                    AllData=new Array();
                    
                    var evarycord = new Array();
                    for(var i=0;i<Monnum_list.length;i++){
                        batt_test_voldata[i] = new Array();
                        batt_test_tmpdata[i] = new Array();
                        evarycord[i] = new Object();
                    }
                    max=Number.NEGATIVE_INFINITY;            //无穷小值
                    min=Number.POSITIVE_INFINITY;            //无穷大值
                    var test_record_num = 0;
                    //console.info(AllTestData.length);
                    var batt_index = -1;
                    
                    //console.info("***************");
                    BattGroupVol[0] = new Array();
                    BattGroupVol[1] = new Array();
                    for(var i=0;i<AllTestData.length;i++){
                        if(AllTestData[i].record_num != test_record_num){
                            //console.info(AllTestData[i]);
                            BattGroupVol[0].push(AllTestData[i].group_vol.toFixed(1));        //组端电压
                            BattGroupVol[1].push(AllTestData[i].online_vol.toFixed(1));        //在线电压
                            BattGroupCurr.push(AllTestData[i].test_curr.toFixed(1));        //组端电流
                            TestTime.push(formatSeconds(AllTestData[i].test_timelong));
                            batt_test_evary_record.push(AllTestData[i]);
                            
                            batt_test_data[++batt_index] = new Array();
                            test_record_num = AllTestData[i].record_num;
                            if(test_record_num > 1){
                                batt_test_data[batt_index]=batt_test_data[batt_index-1].slice(0);
                                setArrayvalue(batt_test_voldata,batt_index);
                                setArrayvalue(batt_test_tmpdata,batt_index);                                
                            }
                        }
                        if(max<AllTestData[i].mon_vol){
                            max = AllTestData[i].mon_vol;
                        }
                        if(min>AllTestData[i].mon_vol){
                            min = AllTestData[i].mon_vol;
                        }
                        //console.info(AllTestData[i]);
                        batt_test_data[batt_index][AllTestData[i].mon_num-1] = AllTestData[i].mon_vol;
                        batt_test_voldata[AllTestData[i].mon_num-1][batt_index] = AllTestData[i].mon_vol;
                        batt_test_tmpdata[AllTestData[i].mon_num-1][batt_index] = AllTestData[i].mon_tmp.toFixed(1);
                    }
                    //console.info(batt_test_tmpdata);                    
                    //console.info(batt_test_voldata);                    
                }
                
                                
                slide_index=batt_test_data.length-1;
                Monvol_list = batt_test_data[batt_test_data.length-1];                
                
                thrname="PXA "+TestTime[TestTime.length-1];
                var title=getTitle(Monvol_list,"Voltage");                
                reflushBattStatus(AllTestData[AllTestData.length-1]);
                
                var batt =  getBattinfById();
                console.info(batt);
                var tempmin = Math.floor(getMinFromArr(Monvol_list)*0.9);
                //var tempmax = (batt.MonVolStd*1.25).toFixed(3);
                var tempmax = Math.ceil(Math.max(getMaxFromArr(Monvol_list),batt.MonVolStd)*1.15);
                //console.info(Math.max(tempmax,(batt.MonVolStd*1.25).toFixed(1)));
                //console.info("tempmax:"+tempmax+"\tempmin:"+tempmin);
                CreateEchart(oLBottom,Voltage,Monnum_list,Monvol_list,title,tempmax,tempmin);
                
                //生成左下条形图
                CreateLineEchartTop('myLineChartTop',oLTop,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname);            //生成左上折线图
                CreateRightLineEchart('myRightLineChart',rtop, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname);    //生成右上折线图
                CreateLineEchart('myLineChart',oRBottom,Monnum_list,TestTime,batt_test_voldata,max,min,thrname);        //生成右下折线图
                echarts.connect('group1');
            }else{
                clearfourPicture();
            }
            
            setCapList();
            //removeWait($('#main'));
            loading.hideLoading($('#r_echarts'));
        }
        
        function clearMyArr(arr){
            if(arr != null && arr.length>0){
            
            }
        }
        
        var batt_actionCap_list = new Array();     //实际容量 数组
        var batt_restCap_list = new Array();    //剩余容量数组
        var batt_CapPercent_list = new Array();    //容量百分比数组
        function setCapList(){
            if(batt_test_data!=undefined && batt_test_evary_record!=undefined){
                var batt = getBattinfById(BattGroupId);
                for(var i=0;i<batt_test_data.length;i++){
                    batt_actionCap_list[i] = new Array();    //实际容量 数组
                    batt_restCap_list[i] = new Array();        //剩余容量数组
                    batt_CapPercent_list[i] = new Array();    //容量百分比数组
                    var vol_list = batt_test_data[i];
                    var max_vol = Math.max.apply(null, vol_list);
                    for(var j=0;j<vol_list.length;j++){
                        var actionvalue = GetMonomerCap(batt.MonCapStd,GetHourRate(batt.MonCapStd,batt_test_evary_record[i].test_curr),batt_test_evary_record[i].test_cap,max_vol,vol_list[j],batt.MonVolStd,CapType_Real);
                        var restvalue = GetMonomerCap(batt.MonCapStd,GetHourRate(batt.MonCapStd,batt_test_evary_record[i].test_curr),batt_test_evary_record[i].test_cap,max_vol,vol_list[j],batt.MonVolStd,CapType_Rest);
                        //console.info(vol_list);
                        batt_actionCap_list[i].push(actionvalue.toFixed(0));                //实际容量 数组
                        batt_restCap_list[i].push(restvalue.toFixed(0));                    //剩余容量数组
                        batt_CapPercent_list[i].push((actionvalue*100/batt.MonCapStd).toFixed(0));    //容量百分比
                    }
                }
            }
            //console.info(batt_CapPercent_list);
        }
        
        //设置数组index处的值和上一个值
        function setArrayvalue(list,index){
            if(list!=undefined && index > 0){
                for(var i=0;i<list.length;i++){
                    list[i][index] = list[i][index-1];
                }
            }
        }
       
        //获取上下左右的图表的位置
        var oLTop=document.getElementById("ltop");
        var oRTop=document.getElementById("rtop");
        var oLBottom=document.getElementById("lbottom");
        var oRBottom=document.getElementById("rbottom");
        
        
      
 
        //使测试内容和图表的高度一致
        $(document).ready(function(){
            var rHeight=$('#r_echarts').height();
            $('#charge_thr_infor').css('height',rHeight-270+'px');
        });
        
        var oall_picture=document.getElementById("all_picture");
        var oltop_echart=document.getElementById("ltop_echart");
        var ortop_echart=document.getElementById("rtop_echart");
        var olbottom_echart=document.getElementById("lbottom_echart");
        var orbottom_echart=document.getElementById("rbottom_echart");
        //导出电池组电压折线图
        function ExportLtop(){
            //if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
                //oltop_echart.value=myLineChartTop.getDataURL("png");
            $('#big_pic').get(0).value=$("#ltop canvas")[0].toDataURL("image/png");
            $('#Big_picture').get(0).submit();
            //}            
        };
        
        //导出右上折线图
        function ExportRtop(){
            //if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
                //ortop_echart.value=myRightLineChart.getDataURL("png");
                $('#big_pic').get(0).value=$("#rtop canvas")[0].toDataURL("image/png");
                $('#Big_picture').get(0).submit();
            //}            
        };
        
        //导出左下条形图
        function ExportLbottom(){
            //if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
                //olbottom_echart.value=myChart.getDataURL("png");
                $('#big_pic').get(0).value=$("#lbottom canvas")[0].toDataURL("image/png");
                $('#Big_picture').get(0).submit();
            //}            
        };
        
        //导出右下折线图
        function ExportRbottom(){
            //if(confirm($("#echarts_menu li a").eq(0).text()+"?")){
                //orbottom_echart.value=myLineChart.getDataURL("png");
                $('#big_pic').get(0).value=$("#rbottom canvas")[0].toDataURL("image/png");
                $('#Big_picture').get(0).submit();
            //}            
        };
        
        //导出所有图
        function ExportAll(){
            if(isCanExport){
                ExportTbl();            
            }else{
                alert("请先选择一组测试记录");
            }
        };
     
        
        //导出报表
        function ExportTbl() {
            var lastarray = new Array();
            lastarray.push(Monnum_list);
            
            
            //组端电压折线图
            createGraphByOpt(allGraph, myLineChartTop.getOption());
            var oltop = allGraph.getDataURL({
                pixelRatio: 1,
                backgroundColor: '#fff'
            });
            //console.info(oltop);
            
            // 电池电流折线图
            createGraphByOpt(allGraph, myRightLineChart.getOption());
            var ortop = allGraph.getDataURL({
                pixelRatio: 1,
                backgroundColor: '#fff'
            });
            
            // 单体电压折线图
            createGraphByOpt(allGraph, myLineChart.getOption());
            var olbottom = allGraph.getDataURL({
                pixelRatio: 1,
                backgroundColor: '#fff'
            }); 
            
            var temp = Titleobj;
            
            lastarray.push(getListByindex(batt_test_data,0));                        //获取起始单体电压
            
            //单体电压柱状图
            var arr1=getArrByIndex(slide_index,0);
            var title=getTitle(arr1,"Voltage");
            lastarray.push(arr1);                                //获取单体截止电压
            
            var lowObj = Titleobj;                                //落后单体电压信息
            
            var opt1 = getGraphOpt(Voltage,Monnum_list,arr1,title);                    //生成左下条形图
            createGraphByOpt(allGraph, opt1);
            var orbottom1 = allGraph.getDataURL({
                pixelRatio: 1,
                backgroundColor: '#fff'
            });
            
            //单体实际容量
            var arr2=getArrByIndex(slide_index,1);
            lastarray.push(arr2);
            var title=getTitle(arr2,"Actual_capacity");
            var opt2 = getGraphOpt(Actual_capacity,Monnum_list,arr2,title);                    //生成左下条形图
            createGraphByOpt(allGraph, opt2);
            var orbottom2 = allGraph.getDataURL({
                pixelRatio: 1,
                backgroundColor: '#fff'
            });
            
            //单体剩余容量
            var arr3=getArrByIndex(slide_index,2);
            lastarray.push(arr3);
            var title=getTitle(arr3,"Residual_capacity");
            var opt3 = getGraphOpt(Residual_capacity,Monnum_list,arr3,title);                    //生成左下条形图
            createGraphByOpt(allGraph, opt3);
            var orbottom3 = allGraph.getDataURL({
                pixelRatio: 1,
                backgroundColor: '#fff'
            });
            
            //单体容量百分比
            var arr4=getArrByIndex(slide_index,3);
            lastarray.push(arr4);
            var title=getTitle(arr4,"Percent_total_capacity");
            var opt4 = getGraphOpt(Percent_total_capacity,Monnum_list,arr4,title);                    //生成左下条形图
            createGraphByOpt(allGraph, opt4);
            var orbottom4 = allGraph.getDataURL({
                pixelRatio: 1,
                backgroundColor: '#fff'
            });
            Titleobj = temp;
            
            var batt=getBattinfById();
            var testdata = AllTestData[AllTestData.length-1]; 
            
            oltop_echart.value = oltop;                // 组端电压折线图
            ortop_echart.value = ortop;                // 电池电流折线图
            olbottom_echart.value = olbottom;        // 单体电压折线图
            orbottom_echart.value = orbottom1;        //单体电压柱状图
            $('#actucap_echart').val(orbottom2);    //单体实际容量
            $('#restcap_echart').val(orbottom3);    //单体剩余容量
            $('#capperc_echart').val(orbottom4);    //单体容量百分比
            
            //console.info("*********");
            $('#obj-bmd').val(JSON.stringify({
                binf:batt,
                sdata:testdata
            }));
            
            $('#obj-title').val(JSON.stringify(lowObj));            
            $('#arr-data').val(JSON.stringify(lastarray));
            
            //console.info(batt);
            //console.info(testdata);
            //console.info(lowObj);
            //console.info(lastarray);
            //console.info("*********");
            oall_picture.submit();
        }
        
        //从list集合中获取指定位置的数组
        function getListByindex(list,index){
            var arr = new Array();
            if(list != undefined && list.length > index){
                arr = list[index];
            }
            return arr;
        }
        
        function ExportBigpic(){
            document.getElementById("big_pic").value=$("#bigEchartsCon canvas")[0].toDataURL("image/png");
               document.getElementById("Big_picture").submit();
        }
        
        //当选中折线条形图是显示右键菜单
        $('#table_echarts div').mousedown(function(e){
               //利用jquery的方式获取当前点击的是否是右键
               if(e.which==3){
                  var disX=(e||event).clientX+10;            //得到鼠标点击X的位置
                  var disY=(e||event).clientY+10;            //得到鼠标点击Y的位置
                  var scrollY=$(document).scrollTop();        //获取浏览器滚动的高度
                  var rHeight=disY+scrollY;
                  //console.info(disX+"   "+rHeight);
                  $('#echarts_menu').css('top',rHeight+'px');
                  $('#echarts_menu').css('left',disX+'px');
                  var checkvalue=$("#charge_select_type option:selected").val();
                   if(this.id=="ltop"){
                       $("#echarts_menu ul.export-ul").hide();
                       if(checkvalue=='Resistance-conductivity'){
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Resistance+Bar_graph); 
                       }else{
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Voltage+Line_graph); 
                       }
                       $("#echarts_menu li a.export-a").eq(0).click(ExportLtop);                      
                   }else if(this.id=="rtop"){
                       $("#echarts_menu ul.export-ul").hide();
                       if(checkvalue=='Resistance-conductivity'){
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Conductivity_percentage+Line_graph); 
                       }else{
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+batt_curr+Line_graph);
                       }
                       $("#echarts_menu li a").eq(0).click(ExportRtop);
                   }else if(this.id=="lbottom"){
                       if(checkvalue=='Resistance-conductivity'){
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Voltage+Bar_graph); 
                       }else{
                           $("#echarts_menu ul.export-ul").show();
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Bar_graph);
                       }
                       $("#echarts_menu li a.export-a").eq(0).click(ExportLbottom);
                   }else if(this.id=="rbottom"){
                       $("#echarts_menu ul.export-ul").hide();
                       if(checkvalue=='Resistance-conductivity'){
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Batt_group+Conductance+Bar_graph); 
                       }else{
                           $("#echarts_menu li a.export-a").eq(0).text(Export+Batt+Voltage+Line_graph);
                       }
                       $("#echarts_menu li a.export-a").eq(0).click(ExportRbottom);
                   }
                   $("#echarts_menu").show();
                   setPosition($("#echarts_menu"),disX, disY);
               }
        });
        
         $('#bigEchartsCon').mousedown(function(e){
               //利用jquery的方式获取当前点击的是否是右键
               if(e.which==3){
                  var disX=(e||event).clientX+10;            //得到鼠标点击X的位置
                  var disY=(e||event).clientY+10;            //得到鼠标点击Y的位置
                  var scrollY=$(document).scrollTop();        //获取浏览器滚动的高度
                  var rHeight=disY+scrollY;
                  //console.info($('#big_echarts').css('display'));
                  if($('#bigEchartsCon').css('display') != 'none'){
                      $('#bigecharts_menu').css('top',rHeight+'px');
                      $('#bigecharts_menu').css('left',disX+'px');
                      $('#bigecharts_menu').show();
                      //console.info("设置菜单位置");
                  }
              }
          });
        
           var obig_echarts_container=document.getElementById("big_echarts_container");
        $('#table_echarts .graph>div').dblclick(function(){
            var $bigEcharts=$('#bigEchartsCon').get(0);
            var graph = $(this).parent();
            var _n=0;                //用于记录当前放大的是哪个图
            var checkvalue=$("#charge_select_type option:selected").val();
            //console.info(this.id);
            if(this.id=="ltop"){
                //双击的是左上折线图
                dbname="ltop";
                if(checkvalue=='Resistance-conductivity'){
                    if(Monnum_list!=undefined && monres_list!=undefined && monres_list.length>0){
                        /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        CreateResEchart('BigResEchart',$bigEcharts,Monnum_list,monres_list,Restitle);
                        $('#bigEchartsCon').css('background-color','#fff'); */
                        toggleGraph(graph, BigResEchart);
                        _n=1;
                    }
                }else{
                    if(TestTime!=undefined && BattGroupVol!=undefined && BattGroupVol.length>0){
                        //console.info($("#ltop canvas")[0].toDataURL("image/png"));
                          /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        
                        CreateLineEchartTop('mybigLineChartTop',$bigEcharts,group_vol, TestTime, BattGroupVol,getMaxFromArr(BattGroupVol),getMinFromArr(BattGroupVol),thrname);            //生成左上折线图    
                        $('#bigEchartsCon').css('background-color','#fff'); */
                        toggleGraph(graph, myLineChartTop);
                        _n=2;        
                    }
                }
            }else if(this.id=="rtop"){
                //双击的是右上折线图
                dbname="rtop";
                if(checkvalue=='Resistance-conductivity'){
                    if(Monnum_list!=undefined && percentage_list!=undefined && percentage_list.length>0){
                        /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        CreateSerpercentChart('mybigSerpercentChart',$bigEcharts,Monnum_list,percentage_list,Serpercenttitle);
                        $('#bigEchartsCon').css('background-color','#fff'); */
                        toggleGraph(graph, mybigSerpercentChart);
                        _n=3; 
                    }
                }else{
                    if(TestTime!=undefined && BattGroupCurr!=undefined && BattGroupCurr.length>0){
                        /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        CreateRightLineEchart('mybigRightLineChart',$bigEcharts, batt_curr, TestTime, BattGroupCurr, (Math.max.apply(null, BattGroupCurr)).toFixed(2),(Math.min.apply(null, BattGroupCurr)).toFixed(2),thrname);    //生成右上折线图
                        $('#bigEchartsCon').css('background-color','#fff'); */
                        toggleGraph(graph, myRightLineChart);
                        _n=4; 
                    }
                }
            }else if(this.id=="lbottom"){
                dbname="lbottom";
                //双击的是左下条形图
                if(checkvalue=='Resistance-conductivity'){
                    if(Monnum_list!=undefined && mon_vol_list!=undefined && mon_vol_list.length>0){
                        /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        CreateMonEchart('BigMonEchart',$bigEcharts,Monnum_list,mon_vol_list,Montitle);
                        $('#bigEchartsCon').css('background-color','#fff'); */
                        toggleGraph(graph, BigMonEchart);
                        _n=5; 
                    }
                }else{
                    if(Monnum_list!=undefined && Monvol_list!=undefined && Monvol_list.length>0){
                        /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        var arr=getArrByIndex(slide_index, li_index);
                        console.info(arr);
                        var title = "";
                        var text = "";
                        
                        switch(li_index){
                            case 0:{
                                text = Voltage;
                                title = Titleobj.getAllTile("Voltage");
                                
                            }break;
                            case 1:{
                                text = Actual_capacity;
                                title = Titleobj.getAllTile("Actual_capacity");
                            }break;
                            case 2:{
                                text = Residual_capacity;
                                title = Titleobj.getAllTile("Residual_capacity");
                            }break;
                            case 3:{
                                text = Percent_total_capacity;
                                title = Titleobj.getAllTile("Percent_total_capacity");
                            }break;
                        }
                    
                        CreateBigEchart($bigEcharts,text,Monnum_list,arr,title);        //生成左下条形图
                        $('#bigEchartsCon').css('background-color','#fff'); */
                        maxflag=true;
                        minflag=true;
                        toggleGraph(graph, myChart);
                        _n=6;
                    }
                }
            }else if(this.id=="rbottom"){
                //双击的是右下折线图
                dbname="rbottom";
                if(checkvalue=='Resistance-conductivity'){
                    if(Monnum_list!=undefined && mon_vol_list!=undefined){
                        /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        CreateSerEchart('BigSerEchart',$bigEcharts,Monnum_list,monser_list,Sertitle);
                        $('#bigEchartsCon').css('background-color','#fff'); */
                        toggleGraph(graph, BigSerEchart);
                        _n=7;
                    }
                }else{
                    if(Monnum_list!=undefined && TestTime!=undefined){
                        /* $('#bigEchartsCon').show();
                        var scrollY=$(document).scrollTop();
                        $('#bigEchartsCon').css('top',scrollY+'px');
                        $('body').css('overflow-y','hidden');
                        //CreateLineEchart(obig_echarts_container,Monnum_list,TestTime, BattData,max,min,thrname);        //生成右下折线图
                        
                        UpdatamyLineChart(checkArray); */
                        toggleGraph(graph, myLineChart);                        
                        _n=8;
                    }
                }                
            }else{
                dbname=undefined;
            }
            
            /* //双击隐藏放大的图表
            $('#bigEchartsCon').dblclick(function(){
                switch(_n){
                    case 0:;break;
                    case 1:BigResEchart.clear();break;
                    case 2:mybigLineChartTop.clear();break;
                    case 3:mybigSerpercentChart.clear();break;
                    case 4:mybigRightLineChart.clear();break;
                    case 5:BigMonEchart.clear();break;
                    case 6:myBigChart.clear();break;
                    case 7:BigSerEchart.clear();break;
                    case 8:mybigLineChart.clear();break;
                }
                $('#bigEchartsCon').hide();
                $('body').css('overflow-y', 'scroll');
                //createallpicture();                
            }); */
        });
        
       //查询电池组电导的测试记录
       function findBattresdata_infActiondata(){
               //alert(BattGroupId);
               if(BattGroupId!=undefined){
                   $.post("Battresdata_infAction_serchByCondition","brdi.BattGroupId="+BattGroupId,function(data){
                       //alert(data.result);
                       data=data.result;
                       data=eval("("+data+")");
                       if(data.code==1 && data.data.length>0){
                           data=data.data;
                        Ocharge_sec_infor.innerHTML="";
                        var ul=createEle("ul");
                        
                        for(var i=0;i<data.length;i++){
                            var li=createEle("li");                        
                            li.innerHTML=i+1+":"+Conductance+"-"+data[i].test_starttime;
                            li.setAttribute("value", data[i].test_record_count);
                            li.setAttribute("class", data[i].test_type==3?"discharge":"charge");
                            ul.appendChild(li);
                        }
                        Ocharge_sec_infor.appendChild(ul);
                       }
                       //setbackground();
                   });
               }    
       } 
       
       //下拉选择框选中事件
       $('#charge_select_type').change(function(){
               isCanExport = false;
               var checkvalue=$("#charge_select_type option:selected").val();
               clearfourPicture();
               changeBattInfo(checkvalue);
               document.getElementById("charge_sec_infor").innerHTML="";
               if(checkvalue=='Resistance-conductivity'){
                   //选中电阻电导数据
                   findBattinfObj();
                   reflushBattStatus(BattinfObj);
                   $('#charge_thr_th').css('visibility','hidden');
                $('#charge_thr_infor .res').css('display','block');
                   findBattresdata_infActiondata();
                   $('#charge_bottom').hide();
                   
               }else{
                   reflushBattStatus(undefined);
                   $('#charge_thr_th').css('visibility','visible');
                   $('#charge_thr_th #t_top').text('');
                $('#charge_thr_infor .res').css('display','none');
                   findBatttestdata_infByBattGroupId();
                   $('#charge_bottom').show();
               } 
       });
       
       
       
       //根据下拉框改变页面上端的电池基本信息
       function changeBattInfo(checkval){
               if(checkval=='Resistance-conductivity'){
                   $("#content td span").eq(0).text("<s:text name='Monomer_All' />");                    /* 单体数量 */
                   $("#content td span").eq(1).text("<s:text name='Monomer_voltage' />");                /* 单体电压 */
                   $("#content td span").eq(2).text("");                
                   $("#content td span").eq(3).text("<s:text name='Nominal_capacity' />");                /* 标称容量 */
                   $("#content td span").eq(4).text("<s:text name='Nominal_resistance' />");            /* 标称内阻 */
                   $("#content td span").eq(5).text("<s:text name='Nominal_conductance' />");            /* 标称电导 */
                   $("#content td span").eq(6).text("<s:text name='Battery_brand' />");                /* 电池品牌 */
                   $("#content td span").eq(7).text("<s:text name='Installation_date' />");            /* 安装日期 */
                   $("#content td span").eq(8).text("<s:text name='Maintenance_advice' />");            /*维护建议 */
               }else{
                   $("#content td span").eq(0).text("<s:text name='Batte_state' />");                    /* 电池状态 */
                   $("#content td span").eq(1).text("<s:text name='Terminal_vol' />");    
                   $("#content td span").eq(2).text("&n");                
                   $("#content td span").eq(3).text("<s:text name='Batt_current' />");                    /* 电池电流 */
                   $("#content td span").eq(4).text("<s:text name='Test_date' />");                    /* 测试日期 */
                   $("#content td span").eq(5).text("<s:text name='Test_timeL' />");                    /* 测试时长 */
                   $("#content td span").eq(6).text("<s:text name='Test_capacity' />");                /* 测试容量 */
                   $("#content td span").eq(7).text("<s:text name='Residual_capacity' />");            /* 剩余容量 */
                   $("#content td span").eq(8).text("<s:text name='Endurance' /><s:text name='Time'/>");                    /* 续航时间 */
               }
       }
        
        
       //格式化右下折线图的数组
        function getAlldata(list){
            max=0;
            min=1000;
            if(list!=undefined && list.length>0){
                for(var i=0;i<list.length;i++){
                    for(var j=0;j<list[i].length;j++){
                        //console.info(list[i][j]);
                        if(list[i][j]==undefined || list[i][j]==''){
                            list[i][j]=list[i][j-1];
                        }
                        if(max<list[i][j]){
                            max=list[i][j];
                        }
                        if(min>list[i][j]){
                            min=list[i][j];
                        }
                    }
                }
            }
            return list;
        }
        
        //格式化左下条形图中数组的电压
        function getAllVol(list){
            if(list!=undefined && list.length>0){
                for(var i=0;i<list.length;i++){
                    for(var j=0;j<list[0].length;j++){
                        if(list[i][j]==undefined){
                            list[i][j]=list[i-1][j];
                        }
                    }
                }
            }
            return list;
        }    
        
        //格式化单个数组
        function getAllBattGroupVol(list){
            if(list!=undefined && list.length>0){
                for(var i=0;i<list.length;i++){
                    if(list[i]==undefined || list[i]==''){
                        list[i]=list[i-1];
                    }
                }
            }
            return list;
        }
        
        var Titleobj;
        //获取左下条形图中的数组
        function getTitle(array,units){
            var title="";
            //a=new Title();
            //alert(Titleobj);
            Titleobj = new Title();
            var sum=0;
            if(array != undefined && array.length>0){
                Titleobj.setMax(Math.max.apply(null,array));
                Titleobj.setMin(Math.min.apply(null,array));
                for(var i=0;i<array.length;i++){
                    sum+=parseFloat(array[i]);                    
                }
                var batt=getBattinfById();
                //console.info(batt);
                if("Resistance"==units){
                    Titleobj.setAvg((sum/array.length).toFixed(3));            
                    var low=getLow(3,2);
                    if(low.low_method==0){
                        //根据标称值计算
                        Titleobj.setAlow(((2-low.low_value)*batt.MonResStd).toFixed(3));
                        low=getLow(3,3);
                        Titleobj.setClow(((2-low.low_value)*batt.MonResStd).toFixed(3));                    
                    }else{
                        //根据平均值计算
                        Titleobj.setAlow(((2-low.low_value)*title.getAvg()).toFixed(3));
                        low=getLow(3,3);
                        Titleobj.setClow(((2-low.low_value)*title.getAvg()).toFixed(3));                
                    }
                    var count=0;
                    for(var i=0;i<array.length;i++){
                        if(parseFloat(Titleobj.getAlow())<parseFloat(array[i])){
                            //console.info(title.getAlow()+"<"+array[i]);
                            count++;
                        }
                    }
                    Titleobj.setLc(count);
                    Titleobj.setLp((count*100/array.length).toFixed(1));
                    //console.info(title);
                }else{ 
                    if("Voltage"==units){
                        Titleobj.setAvg((sum/array.length).toFixed(3));            
                        var low=getLow(1,1);
                        if(low.low_method==0){
                            //根据标称值计算
                            Titleobj.setAlow((low.low_value*batt.MonVolStd).toFixed(3));
                            low=getLow(1,0);
                            Titleobj.setClow((low.low_value*batt.MonVolStd).toFixed(3));                    
                        }else{
                            //根据平均值计算
                            Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(3));
                            low=getLow(1,0);
                            Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(3));                
                        }                
                    }else if("Temperature"==units){
                        Titleobj.setAvg((sum/array.length).toFixed(1));            
                        var low=getLow(1,1);
                        if(low.low_method==0){
                            //根据标称值计算
                            Titleobj.setAlow((low.low_value*batt.MonTmpStd).toFixed(1));
                            low=getLow(1,0);
                            Titleobj.setClow((low.low_value*batt.MonTmpStd).toFixed(1));                    
                        }else{
                            //根据平均值计算
                            Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(1));
                            low=getLow(1,0);
                            Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(1));                
                        }
                    }else if("Conductance"==units){
                        Titleobj.setAvg((sum/array.length).toFixed(0));            
                        var low=getLow(3,2);
                        if(low.low_method==0){
                            //根据标称值计算
                            Titleobj.setAlow((low.low_value*batt.MonSerStd).toFixed(0));
                            low=getLow(3,3);
                            Titleobj.setClow((low.low_value*batt.MonSerStd).toFixed(0));                    
                        }else{
                            //根据平均值计算
                            Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
                            low=getLow(3,3);
                            Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));                
                        }
                    }else if("Actual_capacity"==units){
                        Titleobj.setAvg((sum/array.length).toFixed(0));
                        var low=getLow(2,2);
                        if(low.low_method==0){
                            //根据标称值计算
                            Titleobj.setAlow((low.low_value*batt.MonCapStd).toFixed(0));
                            //console.info(batt);
                            low=getLow(2,3);
                            Titleobj.setClow((low.low_value*batt.MonCapStd).toFixed(0));                    
                        }else{
                            //根据平均值计算
                            Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
                            low=getLow(2,3);
                            Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));                
                        }
                    }else if("Residual_capacity" == units){
                        Titleobj.setAvg((sum/array.length).toFixed(0));
                        var low=getLow(1,1);
                        if(low.low_method==0){
                            //根据标称值计算
                            Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
                            //console.info(batt);
                            low=getLow(1,0);
                            Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));                    
                        }else{
                            //根据平均值计算
                            Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(0));
                            //console.info(batt);
                            low=getLow(1,0);
                            Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(0));            
                        }
                        
                    }else if("Percent_total_capacity" == units){
                        Titleobj.setAvg((sum/array.length).toFixed(2));
                        var low=getLow(2,2);
                        if(low.low_method==0){
                            //根据标称值计算
                            Titleobj.setAlow((low.low_value*batt.MonCapStd).toFixed(2));
                            //console.info(batt);
                            low=getLow(2,3);
                            Titleobj.setClow((low.low_value*batt.MonCapStd).toFixed(2));                    
                        }else{
                            //根据平均值计算
                            Titleobj.setAlow((low.low_value*Titleobj.getAvg()).toFixed(2));
                            low=getLow(2,3);
                            Titleobj.setClow((low.low_value*Titleobj.getAvg()).toFixed(2));                
                        }
                    }
                    var count=0;
                    for(var i=0;i<array.length;i++){
                        if(parseFloat(Titleobj.getAlow())>parseFloat(array[i])){
                            count++;
                        }
                    }
                    Titleobj.setLc(count);
                    Titleobj.setLp((count*100/array.length).toFixed(1));
                }
                
                //console.info(Title);
                title=Titleobj.getAllTile(units);                
            }            
            return title;
        }    
        
        
        //查询对于国际化中所需要的值
        var charging;        //充电
        var discharging;    //放电
        var Conductance;    //电导
        
        var Voltage;        //电压
        var Export;            //导出
        var Bar_graph;        //条形图
        var Line_graph;        //折线图
        var Batt_group;        //电池组
        var Batt;            //电池
        var Voltage;        //电压
        var Current;        //电流
        var Resistance;        //电阻
        var Conductivity_percentage;    //电导百分比
        
                
        $(document).ready(function(){
            $.post("I18nAction_findValue","key=Conductance",function(data){
                Conductance=data.value;
            });
            
            $.post("I18nAction_findValue","key=Resistance",function(data){
                Resistance=data.value;
            });
            
            $.post("I18nAction_findValue","key=Charging",function(data){
                charging=data.value;
            });
            
            $.post("I18nAction_findValue","key=Discharging",function(data){
                discharging=data.value;
            });
            
            $.post("I18nAction_findValue","key=Voltage",function(data){
                Voltage=data.value;
            });
            
            $.post("I18nAction_findValue","key=Export",function(data){
                Export=data.value;
            });
            
            $.post("I18nAction_findValue","key=Bar_graph",function(data){
                Bar_graph=data.value;
            });
            
            $.post("I18nAction_findValue","key=Line_graph",function(data){
                Line_graph=data.value;
            });
            
            $.post("I18nAction_findValue","key=Batt_group",function(data){
                Batt_group=data.value;
            });
            
            $.post("I18nAction_findValue","key=Batt",function(data){
                Batt=data.value;
            });
            
            $.post("I18nAction_findValue","key=Voltage",function(data){
                Voltage=data.value;
            });
            
            $.post("I18nAction_findValue","key=Current",function(data){
                Current=data.value;
            });      
            
            $.post("I18nAction_findValue","key=Conductivity_percentage",function(data){
                Conductivity_percentage=data.value;
            });          
        });
        
        var low_list;                //所有的阀值数组
        //查询所有的阀值
        function searchAll_lowAction(){
            $.post("Batt_param_lowAction_searchAll",null,function(data){
                model=eval("("+data.result+")");
                if(model.code==1 && model.data.length>0){
                    low_list=model.data;
                }else{
                    low_list=undefined;
                }
                //console.info(low_list);
            });
        }
        
    //根据low_type,low_nametype获取阀值
    function getLow(lowtype,lownametype){
        if(lowtype!=undefined && low_list!=undefined && lownametype!=undefined){
            for(var i=0;i<low_list.length;i++){
                if(lowtype==low_list[i].low_type && lownametype==low_list[i].low_nametype){
                    return low_list[i];
                }
            }
        }
    }
    
    //
    function getArrByCheckBox(arr){
        var temp=new Array();
        if(arr != undefined && checkArray != undefined){
            for(var i = 0; i < arr.length ;i++){
                for(var j = 0;j<arr[i].length;j++){
                    if(checkArray[j]==1){
                        if(temp[j] == undefined){
                            temp[j] = new Array();
                        }
                        temp[j].push(arr[i][j].mon_vol.toFixed(3));
                    }
                }
            }
        }
        return temp;
    }
    
    function getArrayByCheck(list){
        var temp = new Array();
        if(list!=undefined && checkArray != undefined){
            for(var i = 0;i<checkArray.length;i++){
                if(checkArray[i]==1){
                    temp.push(list[i]);                
                }
            }
        }
        return temp;
    }
    
    //从AllArr中取出指定位置的数组
    function getArrByIndex(index,li_index){
        switch(li_index){
            case 0:return batt_test_data[index];break;        //获取指定位置的电压值
            case 1:return batt_actionCap_list[index];break; 
            case 2:return batt_restCap_list[index];break;
            case 3:return batt_CapPercent_list[index];break;
        }    
        return arr;
    }
    
    //当切换单体电压/实际容量/剩余容量/容量百分比菜单时
    $('#echarts_menu').on('click','ul.export-ul li',function(){
        var tmp = $(this).index();    
        if(tmp != li_index){
            li_index=tmp;
            //console.info(slide_index);
            createEchartBar(AllData,slide_index,li_index);
        }
    });    
    
    //根据当前选中情况生成左下条形图
    function createEchartBar(AllData,slide_index,li_index){
        var arr=getArrByIndex(slide_index,li_index);
        //console.info(arr);
        var max = getMaxFromArr(arr);
        var min = getMinFromArr(arr);
        switch(li_index){
            case 0:{
                Monvol_list=arr;
                var title=getTitle(Monvol_list,"Voltage");
                var batt = getBattinfById();
                //console.info(batt);
                max = Math.ceil(Math.max(batt.MonVolStd,max)*1.15);
                min = Math.floor(min*0.9);
                console.info("max:"+max+" min:"+min);
                CreateEchart(oLBottom,Voltage,Monnum_list,Monvol_list,title,max,min);                    //生成左下条形图
                updataSecCol($('#charge_thr_th'), arrTh[li_index], Monvol_list);
                console.info(Monvol_list);
            };break;
            case 1:{
                var title=getTitle(arr,"Actual_capacity");
                CreateEchart(oLBottom,Actual_capacity,Monnum_list,arr,title,(max*1.15).toFixed(3),(min*0.9).toFixed(3));                    //生成左下条形图
                updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
            };break;
            case 2:{
                //console.info(arr);
                //console.info("max:"+max+"   min:"+min);
                var title=getTitle(arr,"Residual_capacity");
                CreateEchart(oLBottom,Residual_capacity,Monnum_list,arr,title,(max*1.15).toFixed(3),(min*0.9).toFixed(3));                    //生成左下条形图
                updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
            };break;
            case 3:{
                var title=getTitle(arr,"Percent_total_capacity");
                CreateEchart(oLBottom,Percent_total_capacity,Monnum_list,arr,title,(max*1.115).toFixed(3),(min*0.9).toFixed(3));                    //生成左下条形图
                updataSecCol($('#charge_thr_th'), arrTh[li_index], arr);
            };break;
        }
    }
        
    var maxText = '<s:text name="Maxvalue" />';        //最大值                            //最大值
    var minText = '<s:text name="Minvalue" />';        //最小值
    var avgText = '<s:text name="Average" />';         //平均值
    var lowText = '<s:text name="Lowvalue" />';        //落后值
    var lcText = '<s:text name="Lcvalue" />';        //落后数量
    var lpText = '<s:text name="Lpvalue" />';         //落后数量比  
    var Residual_capacity = '<s:text name="Residual_capacity" />';    //剩余容量
    var Actual_capacity = '<s:text name="Actual_capacity" />';      //实际容量
    var Percent_total_capacity = '<s:text name="Percent_total_capacity" />';     //容量百分比
    var group_vol = ['<s:text name="Group_voltage"/>','<s:text name="On-line_voltage"/>'];
    var batt_curr = '<s:text name="Batt_current"/>';
    
    // 更新表格第二列
    function updataSecCol(tbl, thTxt, tdData) {
        tbl.find('tr th').eq(1).text(thTxt);
        tbl.find('tbody tr').each(function(i) {
            //console.info(i+"=="+tdData[i]);
            $(this).find('td').eq(1).text(tdData[i]);
        });
    }
    
    /**
        设置滑块的提示框
        @param object ele jquery对象
        @param string val  字符串日期格式
        @param num left 滑块的left值
    */
    function setSlideLabel(ele, val, left) {
        var winWidth = $(window).width();
        var label = ele.find('.label');    // 
        var slider = ele.width();    // 容器的宽度
        label.text(val);    // 给label添加值
 
        var labelWidth = label.width();    // 获取label的长度
        var marginLeft = slider*left/100 - labelWidth/2;
        label.css('left', marginLeft).show();
        var labelLeft = label.offset().left;    // 获取label这屏幕中的位置
        var shiftWidth = winWidth - labelLeft;    // 获取label距离屏幕右侧的距离
        
        if(shiftWidth < labelWidth) {    // 判断label是否超出屏幕的右侧
            label.offset(function(n, c) {
                var newPos = new Object();
                newPos.top = c.top;    // 距离顶部的距离不变
                newPos.left = winWidth - labelWidth-10;    // 距离屏幕右侧的距离
                return newPos;    // 返回最新的位置
            });
        }
    }
    
    // 实时-历史切换定位到具体电池组
    $(function() {
        $('body').on('click', '#nav a[href="control.jsp"]', function() {
            var batt = getBattinfById();
            //console.info(batt.StationId);
            $(this).attr('href', 'control.jsp?battgroupId='+BattGroupId+'&stationId='+batt.StationId);
        });
    }); 
    
    // 图表
    function createGraphByOpt (eChart, opt) {
        eChart.clear();
        opt.animation = false;
        eChart.setOption(opt);
    }
    // 获取opt
    function getGraphOpt(lname, xdata, sdata, tname) {
        maxBigflag = true;
        minBigflag = true;
        var option={
            tooltip:{
                trigger: 'axis',
                    axisPointer : {            // 坐标轴指示器,坐标轴触发有效
                        type : 'line',        // 默认为直线,可选为:'line' | 'shadow'
                        color:"white"
                    }
            },
            title : {   
                text: tname,
                x: "center", //标题水平方向位置
                textStyle: {  
                    fontSize:11  
                }
            },
            xAxis:{
                data:xdata
            },
            grid: {
                left: '1%',
                right: '5%',
                bottom: '2%',
                containLabel: true
            },
            yAxis:[{
                name:"y",
                type:'value',
                min:(Math.min.apply( Math, sdata )*0.99).toFixed(3),
                max:(Math.max.apply( Math, sdata )*1.01).toFixed(3),
    //            max:Math.ceil(ymax),
    //            min:Math.floor(ymin-1.0),
                axisLabel:{
                    formatter:function(value){
                        //解决原点处带符号问题
                        if(value==0)
                        {
                            return value;
                        }else{
                            return value;
                        }
                    }
                }
            }],
            series:[{
                type:'bar',
                name:lname,
                data:sdata,
                //显示柱状的数值
                itemStyle:{
                    width:0.5,
                    emphasis:{
                        color:'#54d3e6'
                    },
                    
                    normal:{
                        label:{
                            show:false
                        },
                    color: function(value) {
                            var max=Math.max.apply( Math, sdata );
                            var min=Math.min.apply( Math, sdata );                            
                             if(maxBigflag==true && value.value==max)
                            {
                                 maxBigflag=false;
                                return 'green';
                            }
                            else if(minBigflag==true && value.value==min)
                            {
                                minBigflag=false;
                                return 'red';
                            }else
                            {
                                var clow=Titleobj.getClow();
                                var alow=Titleobj.getAlow();
                                if(parseFloat(value.value)<parseFloat(clow)){
                                    return "#BFA0D1";            //设置更换颜色
                                }else if(parseFloat(value.value)<parseFloat(alow)){
                                    return "#ffff00";            //设置告警颜色
                                } 
                                //console.info(title.getClow());
                                return '#b4d3fa';                //设置为普通的颜色
                            }
                            max=0;
                            min=0;
                           }
                    }
                },
                //显示平均值
                markLine:{
                    data:[
                        {
                            type:'average',
                            name:avg_string,
                            itemStyle:{
                                normal:{
                                    color:'#54d3e6'
                                }
                            }
                        },
                        sdata!=undefined && sdata.length>0?[
                             {name: alarm_string, value: Titleobj.getAlow(),xAxis:xdata[0], yAxis:Titleobj.getAlow(),itemStyle:{ normal:{color:'#ffff00'} }},
                             {name: alarm_string,value: Titleobj.getAlow(),xAxis:xdata[xdata.length-1], yAxis: Titleobj.getAlow()}
                         ]:[ 
                             {name: '', value:''},
                             {name: '', value:''}
                            ],
                        sdata!=undefined && sdata.length>0?[ 
                             {name: change_string, value:Titleobj.getClow(),xAxis:xdata[0], yAxis: Titleobj.getClow(),itemStyle:{ normal:{color:'#ff66cc'} }},
                             {name: change_string, value:Titleobj.getClow(),xAxis:xdata[xdata.length-1], yAxis: Titleobj.getClow()}
                         ]:[ 
                             {name: '', value:''},
                             {name: '', value:''}
                            ]
                    ]
                }
            }]
        };
        return option;
    }
    
    // 改变列表宽度
    $(function() {
        $('#ele_content').resizable({
            minWidth: 240,
            maxWidth: 600,
            handles: 'e',
            edge: 10,
            start: function() {
                maxflag = true;
                minflag = true;
                $('.graph>div').text('');
            },
            stop: function() {
                var checkvalue=$("#charge_select_type option:selected").val();
                //alert(123);
                if(checkvalue=='Resistance-conductivity'){
                    ResEchart = setCanvas(ResEchart);
                    mySerpercentChart = setCanvas(mySerpercentChart);
                    MonEchart = setCanvas(MonEchart);
                    SerEchart = setCanvas(SerEchart);
                }else {
                    myChart = setCanvas(myChart);
                    myLineChartTop = setCanvas(myLineChartTop);
                    myRightLineChart = setCanvas(myRightLineChart);
                    myLineChart = setCanvas(myLineChart);
                    myLineChartTop.group = 'group1';
                    myRightLineChart.group = 'group1';
                    myLineChart.group = 'group1';
                    echarts.connect('group1');        
                }                
            }
        });
        var lastslide = 0;
        // 滑块定位
        $('#slider').slider({
            value: 100,
            start: function(event, ui) {
                //setSlideLabel($('#slider'), '2012-12-22 00:00:00', ui.value);
            },
            slide: function(event, ui) {
                if(batt_test_evary_record!=undefined && batt_test_evary_record.length>0){
                    slide_index = Math.floor((batt_test_evary_record.length-1)*ui.value/100);
                    //console.info(slide_index+" ===  "+batt_test_evary_record.length);
                     setSlideLabel($('#slider'), formatSeconds(batt_test_evary_record[slide_index].test_timelong),ui.value);
                }else{
                    setSlideLabel($('#slider'), '00:00:00',ui.value);            
                }                
                if(slide_index != lastslide){
                    //console.info(slide_index);
                    updateEchartAndTable();
                    lastslide = slide_index;
                }
            },
            stop: function(event, ui) {
                //console.info(ui.value);
                upadateEchartsTitle();
                $('#slider .label').hide();
            }
        });        
    });
    
      
    //根据滑块更新数据
    function UpdatedataBySlide(percentage){
        if(batt_test_evary_record!=undefined && batt_test_evary_record.length>0){
            slide_index = Math.floor(batt_test_evary_record.length*percentage);
                 //console.info(slide_index+"=="+batt_test_evary_record.length);
                 setSlideLabel($('#slide'), formatSeconds(batt_test_evary_record[slide_index].test_timelong));
            //console.info(li_index);
        }else{
            setSlideLabel($('#slide'), '00:00:00');            
        }             
    }
    
    function upadateEchartsTitle(){
        if(batt_test_evary_record!=undefined && batt_test_evary_record.length>0){ 
            thrname="PXA "+formatSeconds(batt_test_evary_record[slide_index].test_timelong);
            reflushltop(thrname);            //更新左上折线图中的title
            reflushlrtop(thrname);            //更新右上折线图的title
            reflushlrLine(thrname);            //更新右下折线图的title
        }
    }
 
    function updateEchartAndTable(){
        if(batt_test_data!=undefined && batt_test_data.length>0){        
            list = getArrByIndex(slide_index,li_index);
            //console.info(index);
            if(list!=undefined && list.length>0){                    
                //console.info(slide_index+"###");
                tname=getTitle(list, li_index==0?"Voltage":li_index==1?"Actual_capacity":li_index==2?"Residual_capacity":"Percent_total_capacity");
                //var d1 = new Date();
                var max = getMaxFromArr(list);
                var min = (getMinFromArr(list)*0.9).toFixed(3);
                if(li_index == 0){
                    var batt = getBattinfById();
                    max = Math.ceil(Math.max(batt.MonVolStd,max)*1.15);
                    min = Math.floor(min);
                }else{
                    max = (max*1.15).toFixed(3);
                }
                
                reflush(list,tname,max,min);            //更新条形图
                
                createBattVoltable(list); 
                //更新电池状态                
                reflushBattStatus(batt_test_evary_record[slide_index]);                
                if(dbname=="lbottom" && $('#big_echarts').css("display")=='block'){
                    reflushBig(list,tname);
                }
            }                      
        }
    }
 
    // 设置已经生成的canvas
    function setCanvas(graph) {
        var opts = graph.getOption();
        graph.group = 'group1';
        graph = echarts.init(graph._dom);
        graph.setOption(opts);
        return graph;
    }
    
    //  放大和恢复echarts图表
    function toggleGraph(ele, echarts) {
        if(ele.hasClass('big')) {
            ele.removeClass('big');
        }else {
            ele.addClass('big');
        }
        echarts.resize();
        
    }
    
    $(function(){
        //启动查询电池充放电状态的线程
        searchBattState();
        window.setInterval(function(){
            searchBattState();
        }, 6000);
    });
    function searchBattState(){
        $.ajax({     
            type: "post",                 
            url: "Batt_rtstateAction!serchDisOrChargr",                
            async:true,                
            dataType:'text',
            data:null,        
            success: function(data){ 
                data = eval('('+data+')');
                var model = eval('('+data.result+')');
                //console.info("************");
                //console.info(model);
                //console.info("************");
                var arr = new Array();
                if(model.code == 1){
                    console.info(model.data);
                    for(var i = 0;i<model.data.length;i++){
                        if(model.data[i].batt_test_type == 3){
                            arr.push({
                                note: model.data[i].note,
                                val:model.data[i].BattGroupId,
                                isCharge:0
                            });
                        }else if(model.data[i].batt_test_type == 2){
                            arr.push({
                                note: model.data[i].note,
                                val:model.data[i].BattGroupId,
                                isCharge:1
                            });
                        }
                    }
                }    
                //console.info(arr);
                var batt_list = $('#ele_content .batt-listen .batt-list');
                createBattListen(batt_list, arr);        
            },
            error:function(a){
                
            }                
        });
    }
    
    // 生成充放电监测模块内容
    function createBattListen(ele, list) {
        //console.info(list);
        ele.text("");
        var discharge_num = 0;
        var charge_num = 0;
        var ul = $('<ul></ul>');
        for(var i = 0; i < list.length; i++) {
            var li = "";
            if(list[i].isCharge) {
                li = $('<li><a href="javascript:;" class="batt-charge" value="'+list[i].val+'" note="'+list[i].note+'">'+list[i].val+'电池组充电测试!</a></li>');
                charge_num++;
            }else {
                li = $('<li><a href="javascript:;" class="batt-discharge" value="'+list[i].val+'" note="'+list[i].note+'">'+list[i].val+'电池组放电测试!</a></li>');
                discharge_num++;
            }
            ul.append(li);
        }
        $('#ele_content .batt-listen .count-num').find('span').eq(0).text(discharge_num);
        $('#ele_content .batt-listen .count-num').find('span').eq(1).text(charge_num);
        ele.append(ul);
    }
    // 点击电池充放电监测列表触发事件
    $(function() {
        var batt_list = $('#ele_content .batt-listen .batt-list');
        batt_list.on('click', 'a', function(){
            batt_list.find('a').removeClass('active');
            $(this).addClass('active');
            locationBattPos($(this).attr('note'), $(this).attr('value'));
        });
    });
    
    function BattlocationById(battid){
        if(battid!=undefined){
            BattGroupId = battid;
            $('#lside a').css({'background-color':'#fff'});
            //获得一级菜单并展示二级菜单
            var secTag =$('#'+battid).parent().parent().siblings().first().parent().parent().siblings().first().next();
            var secTagA = $('#'+battid).parent().parent().siblings().first();
            //console.info(secTagA.text()+'******');
            if(secTagA.text().trim().length == 0) {
                secTagA.hide();
            }
            secTag.show();
            //$('#'+thr_id).parent().parent().siblings().first().parent().parent().siblings().first().next().show();
            //获得二级菜单并展示三级菜单
            $('#'+battid).parent().parent().siblings().first().next().show();
            $('#'+battid).css('background-color','#9bbaf3');
            //一级菜单展开样式
            $('#'+battid).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').removeClass("down");
            $('#'+battid).parent().parent().siblings().first().parent().parent().siblings().first().children('.arrow').addClass("up");
            $('#'+battid).parent().parent().siblings().first().children('.mark').text('-');
            $('#'+battid).parent().parent().siblings().first().children('.mark').addClass('black');
            //alert($('#'+thr_id).parent().parent().siblings().first().text());
            location.hash="#"+battid;
            $('#'+battid).click();
        }
    }
    
    //跳转到指定的电池组统计分析查询
    function targetBattReport(){
        var batt = getBattinfById();
        console.info(batt);        
        window.open("eleAnalyse.jsp?battgroupId="+BattGroupId+"&stationId="+batt.StationId);
    }
    
    // 使用jquery实现左导航的显示和隐藏
    $(document).ready(function(){
        //二级左菜单的显示和隐藏
        $('#lside').on('click','.fir', function(){
            $('.thr').css('background-color','');
            $('.fir').css('background-color','');
            $('.sec').css('background-color','');
            $(this).css('background-color','#9bbaf3');
            $(this).css('color','black');
            // alert($(this).next().children().eq(0).children().eq(0).text());
            if ($(this).next().length == 0) {
                
                searchkBattByStationid($(this).attr('name'));
            }else {
                //修复二级为空时的bug
                for(var i=0;i<$(this).next().children().length;i++)
                {
                    if($(this).next().children().eq(i).children().eq(0).text()=='')
                    {
                        $(this).next().children().eq(i).children().eq(0).remove();
                        $(this).next().children().eq(i).children().eq(0).next().slideToggle();
                    }
                }
                $(this).next().slideToggle(function() {
                    //console.info($(this));
                    changeFirImg($(this));
                });
            }
        });
        //三级左菜单的显示和隐藏
        $('#lside').on('click', '.sec', function(){
            $('.thr').css('background-color','');
            $('.fir').css('background-color','');
            $('.sec').css('background-color','');
            // alert($(this).parent().parent().siblings().get(0).tagName);
            $(this).css('background-color','#9bbaf3');
            $(this).next().slideToggle();
        });
        // 三级菜单背景色改变
        $('#lside').on('click', '.thr', function(){
            $('.thr').css('background-color','');
            $('.fir').css('background-color','');
            $('.sec').css('background-color','');
            $(this).css('background-color','#9bbaf3');
            //显示电池的详细信息
            $('#address_infor').text($(this).parent().parent().parent().parent().siblings().first().text()+"-"+$(this).parent().parent().siblings().first().text()+"-"+$(this).text());
        
            BattGroupId=$(this).attr("id");
            getBattStr();
            findBattinfObj();
            AllBataDate=new Array();
            clearfourPicture();
            findBatttestdata_infByBattGroupId();
            searchAll_lowAction();            //获取阀值
        });
    });
    
    
    $(function() {
        //全部展开
        $('#all_show').click(function(){
            $('#lside .fir').each(function() {
                var nextLength = $(this).next('ul').length;
                if(nextLength == 0) {
                    searchkBattByStationid($(this).attr('name'));
                }else {
                    $(this).children('.arrow').removeClass('down').addClass('up');
                    $(this).next().slideDown();
                }
                
            });
        });
        //全部收缩
        $('#all_hide').click(function(){
            $('.fir').next().slideUp();
            //$('.sec').next().slideUp();
            $("#lside").scrollTop(0);
            $(".arrow").removeClass("up");
            $(".arrow").addClass("down");
            $(".mark").text("+");
            $(".mark").removeClass("black");
        });
    });
    
    // 点击屏幕隐藏图表右键菜单
    $(function(){
        $('body').click(function() {
            $('#echarts_menu').hide();
        });
    });
    searchAll_lowAction();            //获取阀值
    seachAllStation();
    //查询所有机房
    function seachAllStation(){
        $.ajax({     
            type: "post",                 
            url: "BattInfAction!serchAllStation",                
            async:true,                
            dataType:'text',
            data:null,    
            success: function(data){                                        
                data = eval('('+data+')');
                var model = eval('('+data.result+')');
                console.info(model);
                if(model.code == 1){
                    console.info("查询成功");
                    createLsideFir($('#lside'), model.data);    // 生成一级导航
                    searchAll_lowAction();
                    var stationId=getQueryString("stationId"); //  获取机房的ID
                    if(stationId != undefined && stationId>0) {
                        isFirLoadPage = 0;
                        searchkBattByStationid(stationId);
                    }else {
                        searchkBattByStationid(model.data[0].StationId);
                    }
                    
                }
            },
            error:function(){
                
            }                 
        });
    }
    
    //根据机房id查询电池组
    function searchkBattByStationid(stationid){
        addLoadingToMenu(stationid);
        $.ajax({     
            type: "post",                 
            url: "BattInfAction!serchBattByStation",                
            async:true,                
            dataType:'text',
            data:"json = "+JSON.stringify({
                StationId:stationid
            }),    
            success: function(data){                                        
                data = eval('('+data+')');
                var model = eval('('+data.result+')');
                removeLoadingMenu(stationid);    // 移除数据加载等待
                if(model.code == 1){
                    battinlist.push(model.data);
                    createLsideSec(model.data);
                }
            },
            error:function(){
                
            }                 
        });
    }
    
    /**
     * 生成左侧一级导航
     * @param  array mList 一级导航的数据机房名称,机房ID
     * [{StationName:string,StationId:string}...]
     */
    function createLsideFir(contain,mList){
        // 清除contain的内容
        contain.text('');
        var _ul = $('<ul></ul>');    
        // 遍历mList根据其数据生成页面中的内容
        for (var i = 0; i < mList.length; i++) {
            var _li = $('<li></li>');
            var _a = $('<a href="javascript:;" id="'+mList[i].StationName+'" class="fir" name="'+mList[i].StationId+'"><strong class="arrow down"></strong><span></span>'+mList[i].StationName+'</a>');
            _li.append(_a);
            _ul.append(_li);
        }
 
        contain.append(_ul);
        loading.hideLoading(contain);
        // 在id为mach_num的div显示内容
        var MachineRoom = $('.fir').length;
        $('#room_num').text(MachineRoom);
    }
    /**
     * 生成左侧二级导航
     * @param  array mList 一级导航的数据机房名称,机房ID
     * [{StationName:string,StationId:string,BattGroupId:string,BattGroupName:string}...]
     */
     function createLsideSec(mList, batterId){
         var _stationId = mList[0].StationId;
         //console.info(_stationId);
         // 根据_stationId的值确定要生成二级导航的位置
         var _fir = $('#lside .fir');
         
         _fir.each(function() {
             if($(this).attr('name') == _stationId) {
                 $(this).next('ul').remove();
                 $(this).children('strong.arrow').removeClass('down').addClass('up');
                 
                 var _ul = $('<ul style="display:block"></ul>');
                 var _li = $('<li></li>');
                 var _a = $('<a href="javascript:;" class="sec" id="'+mList[0].StationId+'" value="'+mList[0].StationName+'" style="display:none"></a>');
                 _li.append(_a);
                 var __ul = $('<ul style="display: block"></ul>');
                 var tagStr = "";
                 // 遍历mList生成第二级内容
                 for(var _i = 0; _i < mList.length; _i++) {
                      tagStr +=    '<li><a href="javascript:;" class="thr" id="'+mList[_i].BattGroupId+'">'+mList[_i].BattGroupName+'</a></li>';
                     
                 }
                 var __li = $(tagStr);
                 __ul.append(__li);
                 _li.append(__ul);
                 _ul.append(_li);
                 $(this).after(_ul);
                 var battId = getQueryString('battgroupId');
                 if(isFirLoadPage) {
                     isFirLoadPage = 0;
                     //console.info(123);
                     var firTag = $('#lside .fir').eq(0).next().find('.thr').eq(0);
                     var firId = firTag.attr('id');
                     firTag.css('background-color', '#9bbaf3');
                     BattGroupId = firId;
                 }else if(battId != undefined && batterId == undefined){
                     $(this).next().find('.thr').each(function() {
                         if($(this).attr('id') == battId) {
                             $(this).css('background-color', '#9bbaf3');
                             BattGroupId = battId;
                             location.hash = '#'+battId;
                         }
                     });
                 }else if(batterId > 0){
                     $(this).next().find('.thr').each(function() {
                         if($(this).attr('id') == batterId) {
                             $('#lside a').css('background-color', "");
                             $(this).css('background-color', '#9bbaf3');
                             BattGroupId = batterId;
                             location.hash = '#'+batterId;
                         }
                     });
                 }
                 getBattStr();
                 findBattinfObj();
                AllBataDate=new Array();
                findBatttestdata_infByBattGroupId();
             }
         });
     }
     
     // 根据左导航的状态确定一级菜单的图表
     function changeFirImg(ele) {
         var _status = ele.get(0).style.display;
         if(_status == 'block') {
             ele.siblings('a').children('.arrow').removeClass('down').addClass('up');
         }else {
             ele.siblings('a').children('.arrow').removeClass('up').addClass('down');
         }
     }
     
     // 根据机房id和电池组id定位
     function locationBattPos(stationid, battId) {
         var _firTag = $('#lside .fir[name="'+stationid+'"]');
         
         if(_firTag.next('ul').length == 0) {
             addLoadingToMenu(stationid);
             $.ajax({     
                type: "post",                 
                url: "BattInfAction!serchBattByStation",                
                async:true,                
                dataType:'text',
                data:"json = "+JSON.stringify({
                    StationId:stationid
                }),    
                success: function(data){                                        
                    data = eval('('+data+')');
                    var model = eval('('+data.result+')');
                    removeLoadingMenu(stationid);    // 移除数据加载等待
                    if(model.code == 1){
                        battinlist.push(model.data);
                        createLsideSec(model.data, battId);
                    }
                },
                error:function(){
                    
                }                 
            }); 
         }else {
             var _ul = _firTag.next();
             _ul.slideDown();
             _ul.find('.thr').each(function() {
                 if($(this).attr('id') == battId) {
                     $('#lside a').css('background-color', "");
                    $(this).css('background-color', '#9bbaf3');
                    BattGroupId = battId;
                    location.hash = '#'+battId;
                }
             });
             getBattStr();
             findBattinfObj();
            AllBataDate=new Array();
            findBatttestdata_infByBattGroupId();
         }
     }
     
     $('#search_room').unbind('click').on('click','#en_search',function(){
         console.info('****');
         var li_active = $("#search_info ul li.active");
         if(li_active.attr('name') == 'batt'){
             //点击的电池组
             locationBattPos(li_active.attr('stationid'), li_active.attr('value'));
             $('#search_room').hide();
               $('#allShade').hide();
         }else if(li_active.attr('name') == 'station'){
             //点击的机房
             locationBattPos(li_active.attr('stationid'));
             $('#search_room').hide();
               $('#allShade').hide();
         }else{
             alert("请选择一个机房或者电池组!");
         }
         
         
     });
     
     // 向页面的左侧添加加载等待
     function addLoadingToMenu(stationId) {
         var ele = $('#lside .fir[name="'+stationId+'"]');
         var marginLeft = $('#lside').width()/2 - 95;    // 获取容器的高度
         console.info($('#lside').width());
         var _div = $('<div class="loading-menu"></div>');
         var _img = $('<img src="image/right-menu-loading.gif" alt="数据加载中..." />');
         _div.append(_img);
         _div.css({
             'width': '100%',
             'padding': '10px 0'
         }); 
         _img.css({
             'margin-left':marginLeft+'px'
         });
         ele.after(_div);
     }
     
     // 清除左侧的数据等待
     function removeLoadingMenu(stationId) {
         var ele = $('#lside .fir[name="'+stationId+'"]');
         ele.next('.loading-menu').remove();
     }
     
     // 根据电池组ID获取当前的机房+电池的字符串
     function getBattStr() {
         var battInfo = getBattinfById();
         console.info(battInfo);
         var battStr = battInfo.StationName+'-'+battInfo.BattGroupName;
         $('#address_infor').text(battStr);
     }
</script>
<script type="text/javascript" src="js/charge.js"></script>
</html>