fei.wang
2025-04-16 36125140602fc90ddad1cbd8cc82f88872fab9a6
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
<template>
    <view>
        <u-search v-show="show" class="searchbg" shape="true" bg-color="rgba(255, 255, 255, 0.5)" placeholder="请输入名称"
            :show-action="false" v-model="keyword" @search="searchxinxi"
            :style="{top: topheight+'px',position: 'absolute',width: '50%',left: '25%'}"></u-search>
        <!-- #ifdef APP-PLUS || H5 -->
        <view :style="{top: topheight+'px',position: 'absolute',width: '100%','z-index': '999999999999999999999999'}">
            <!-- <u--image
 
    :showLoading="true"
    src="../../static/img/red.png"
    width="25px"
    height="25px"
    @click="click"
  ></u--image>禁区 -->
 
            <div class="area"
                style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;">
                <image src="../../static/img/red.png"
                    style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px">禁区</image>
            </div>
            <div class="area"
                style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;">
                <image src="../../static/img/green.png"
                    style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px">安全区</image>
            </div>
            <div class="area"
                style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;">
                <image src="../../static/img/blue.png"
                    style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px"> 施工区</image>
            </div>
            <div class="area"
                style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;">
                <image src="../../static/img/qingse.png"
                    style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px"> 保护区</image>
            </div>
        </view>
 
 
        <view style="margin-top: 120px;position: fixed;  z-index: 9999999999999999999999;">
            <!-- {{warnlist}} -->
            <!-- {{warnlist.length}} -->
            <view v-for="(item,index) in warnlist" :key="index" style="margin-top: 10px;">
                <!-- {{item.warnstatus}} -->
                <u-alert type="warning" :closable="true" :description="item"></u-alert>
            </view>
        </view>
        <!-- <u-button @click="draw" icon="../../static/drawfence.png"
            style=" border-color: #5b5b5b;background-color: rgba(115, 115, 115, 0); width: 31px;height: 31px; position:absolute;top: 70%; left:15px;z-index: 999999999999999;"></u-button> -->
        <u-button @click="draw" icon="../../static/drawf.png" :style="{ 
        borderColor: '#5b5b5b', 
        backgroundColor: 'rgba(115, 115, 115, 0)', 
        width: '32px', 
        height: '31px', 
        position: 'absolute', 
        top: buttonTop + 'px', 
        left: buttonLeft + 'px', 
        zIndex: 999999999999999 
      }">
        </u-button>
        <u-modal style="position: absolute;z-index: 99999999999999;" buttonReverse confirmText="下一步" cancelText="取消"
            :show="drawshow" @cancel="cancelmodal" @confirm="startdraw" ref="uModal" :showCancelButton="true"
            :closeOnClickOverlay="true">
            <u-icon name="close" style="position: absolute;right: 10px;top:10px" @click="closemodal"></u-icon>
            <view style="max-height: 600px; overflow-y: auto;">
 
                <u--form style="" labelPosition="left" :model="model" :rules="rules2" ref="uForm">
                    <u-form-item required label="终端编号:" borderBottom ref="item1" labelWidth="80px">
                        <u-badge v-if="tagonlie==1 && code!=''" :isDot="true" type="success"></u-badge>
                        <u-badge v-else-if="tagonlie==0 && code!=''" :isDot="true" type="info"></u-badge>
                        <!-- <u--input v-model="code" border="none" placeholder="请输入终端编号" @blur="seachcode"></u--input> -->
                        <tn-input v-model="code" type="select" @click="showtagid = true" placeholder="请选择终端编号" />
                        <tn-select v-model="showtagid" mode="single" :list="tagidlist" @confirm="confirmtagid"
                            :searchShow="true"></tn-select>
                    </u-form-item>
                    <u-form-item label="选择场景:" prop="fencetype" borderBottom ref="item1" labelWidth="80px">
                        <u-radio-group v-model="model.fencetype" placement="row">
                            <u-radio :customStyle="{marginRight: '8px'}" v-for="(item, index) in radiolist1"
                                :key="index" :label="item.name" :name="item.name" @change="radioChange">
                            </u-radio>
                        </u-radio-group>
                    </u-form-item>
 
                    <view v-if='isperties'>
                        <u-form-item v-show='isperties' label="绘制方式:" prop="fencetype" borderBottom ref="item1"
                            labelWidth="80px">
                            <u-radio-group v-model="drawway" placement="row">
                                <u-radio :customStyle="{marginRight: '8px'}" v-for="(item, index) in radiolist2"
                                    :key="index" :label="item.name" :name="item.name">
                                </u-radio>
                            </u-radio-group>
                        </u-form-item>
 
                    </view>
 
 
                    <view v-else>
                        <u-form-item label="操作提示:" borderBottom ref="item1" labelWidth="80px">
                            <span style="color:red">将标签放在地面测量导线边缘坐标,同时用激光测量导线距离地面的高度</span>
 
                        </u-form-item>
                        <u-form-item label="新增塔:" borderBottom ref="item1" labelWidth="80px">
                            <u-number-box v-model="tanum" :min="2" :max="4    " @change="valChange"></u-number-box>
                        </u-form-item>
                        <view v-for="i in tanum" :key="i">
                            <u-form-item :label="'塔' + (i) + '坐标A:'" borderBottom ref="item1" labelWidth="80px">
                                <tn-input v-show="zuobiaolist[i-1][0]!=''" v-model="zuobiaolist[i-1][0]"
                                    inputAlign="right" style="width:400rpx"></tn-input>
                                <!-- <tn-button v-show="zuobiaolist[i-1][0]==''" backgroundColor="#55aaff" fontColor="#ffffff"
                                size="small" @click="acquisitionxy(i,0)">采集坐标</tn-button> -->
                                <uni-tooltip :content="content" placement="top" style="width:100px">
                                    <!-- <button size="mini" @click="acquisition">采集</button> -->
 
                                    <u-button style="width:100px" type="primary" v-show="zuobiaolist[i-1][0]==''"
                                        :disabled="disabled" size="mini"
                                        @click="acquisitionxy(i,0,'zb')">采集坐标</u-button>
                                </uni-tooltip>
                            </u-form-item>
                            <u-form-item :label="'塔' + (i) + '坐标B:'" borderBottom ref="item1" labelWidth="80px">
                                <tn-input v-show="zuobiaolist[i-1][1]!=''" v-model="zuobiaolist[i-1][1]"
                                    inputAlign="right" style="width:400rpx"></tn-input>
                                <uni-tooltip :content="content" placement="top" style="width:100px">
                                    <u-button style="width:100px" type="primary" v-show="zuobiaolist[i-1][1]==''"
                                        :disabled="disabled" size="mini"
                                        @click="acquisitionxy(i,1,'zb')">采集坐标</u-button>
                                    <!-- <tn-button disabled v-show="zuobiaolist[i-1][1]==''" backgroundColor="#55aaff" fontColor="#ffffff"
                                size="small" @click="acquisitionxy(i,1)">采集坐标</tn-button> -->
                                </uni-tooltip>
                            </u-form-item>
                            <u-form-item label="导线高:" borderBottom ref="item1" labelWidth="80px">
                                <u--input v-model="zuobiaolist[i-1][3]" border="none" placeholder="请输入导线高:"></u--input>
                            </u-form-item>
 
                            <view v-if="i>=1 && i<tanum">
                                <!-- {{i<=tanum}}
                                {{saglist[i-1]}}
                                {{saglist[i-1][0]}} -->
                                <u-form-item :label="'弧垂' + (i) + '坐标A:'" borderBottom ref="item1"
                                    :labelWidth="labelWidth">
                                    <tn-input v-show="saglist[i-1][0]!=''" v-model="saglist[i-1][0]" inputAlign="right"
                                        style="width:400rpx"></tn-input>
                                    <uni-tooltip :content="content" placement="top" style="width:100px">
 
                                        <u-button style="width:100px" type="primary" v-show="saglist[i-1][0]==''"
                                            :disabled="disabled" size="mini"
                                            @click="acquisitionxy(i,0,'sag')">采集坐标</u-button>
                                    </uni-tooltip>
                                </u-form-item>
                                <u-form-item :label="'弧垂' + (i) + '坐标B:'" borderBottom ref="item1"
                                    :labelWidth="labelWidth">
                                    <tn-input v-show="saglist[i-1][1]!=''" v-model="saglist[i-1][1]" inputAlign="right"
                                        style="width:400rpx"></tn-input>
                                    <uni-tooltip :content="content" placement="top" style="width:100px">
                                        <u-button style="width:100px" type="primary" v-show="saglist[i-1][1]==''"
                                            :disabled="disabled" size="mini"
                                            @click="acquisitionxy(i,1,'sag')">采集坐标</u-button>
                                    </uni-tooltip>
                                </u-form-item>
                                <u-form-item label="弧垂高:" borderBottom ref="item1" labelWidth="80px">
                                    <u--input v-model="saglist[i-1][3]" border="none" placeholder="请输入弧垂高:"></u--input>
                                </u-form-item>
                            </view>
                        </view>
 
                    </view>
 
                </u--form>
            </view>
        </u-modal>
        <u-modal style="position: absolute;z-index: 99999999999999;" buttonReverse confirmText="保存围栏" cancelText="返回上一步"
            :show="savefence" @cancel="cancelsave" @confirm="save" ref="uModal" :showCancelButton="true"
            :closeOnClickOverlay="true">
            <!-- <u-icon name="close" style="position: absolute;right: 10px;top:10px" @click="closemodal"></u-icon> -->
            <u--form style="" labelPosition="left" :model="model" ref="uForm" :rules="rules2">
                <u-form-item required label="围栏名称:" prop="name" borderBottom ref="item1" labelWidth="80px">
                    <u--input v-model="model.name" border="none" placeholder="请输入围栏名称"></u--input>
                </u-form-item>
 
 
                <u-form-item required label="围栏类型:" prop="type" borderBottom ref="item1" :labelWidth="labelWidth">
                    <tn-input v-model="model.type" type="select" @click="show1 = true" placeholder="请输入选择围栏类型" />
                    <tn-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet>
                </u-form-item>
                <u-form-item required label="关联部门:" prop="department" borderBottom ref="item1" :labelWidth="labelWidth">
                    <tn-input v-model="model.department" type="select" @click="show2 = true" placeholder="请选择关联部门" />
                    <tn-action-sheet :list="bumenList" v-model="show2" @click="bymenCallback"></tn-action-sheet>
                </u-form-item>
 
                <u-form-item required label="围栏高度:" prop="height" borderBottom ref="item1" labelWidth="80px">
                    <u--input v-model="model.height" border="none" placeholder="请输入围栏高度"></u--input>m
                </u-form-item>
 
                <u-form-item required label="预警距离:" prop="distance" borderBottom ref="item1" labelWidth="80px">
                    <u--input v-model="model.distance" border="none" placeholder="请输入预警距离"></u--input>m
                </u-form-item>
                <!-- <u-form-item required label="预警语音:" prop="nowarnmes" borderBottom ref="item1" labelWidth="80px">
                    <u--input v-model="model.nowarnmes" border="none" placeholder="请输入预警语音"></u--input>
                </u-form-item>
                <u-form-item required label="告警语音:" prop="warnmes" borderBottom ref="item1" labelWidth="80px">
                    <u--input v-model="model.warnmes" border="none" placeholder="请输入告警语音"></u--input>
                </u-form-item> -->
                <u-form-item required label="电压等级:" prop="dianya" borderBottom ref="item1" labelWidth="80px">
                    <tn-input v-model="model.juli" type="select" @click="show4 = true" placeholder="请选择电压等级" />
                    <tn-action-sheet :list="rangeLevel" v-model="show4" @click="changeRangeLevel"></tn-action-sheet>
                    <!-- <uni-data-select v-model="model.dianya" :localdata="rangeLevel"
                        @change="changeRangeLevel"></uni-data-select> -->
                    <!-- <u--input v-model="model.dianya" border="none" placeholder="请输入电压等级"></u--input> -->
                </u-form-item>
                <u-form-item required label="安全距离:" prop="dianya" borderBottom ref="item1" labelWidth="80px">
                    <u--input v-model="model.dianya" border="none" placeholder="请输入安全距离"></u--input>m
                </u-form-item>
                <u-form-item label="是否启用:" borderBottom ref="item1" labelWidth="80px">
                    <!-- <u--input v-model="model.name" border="none" placeholder="请输入围栏名称"></u--input> -->
                    <u-switch v-model="isplay" @change="isopen"></u-switch>
                </u-form-item>
                <u-form-item v-if="model.fencetype == '变电作业'" label="地面校准:" borderBottom ref="item1">
                    <span style="color:red">将标签放在地面,点击获取围栏地面高度</span>
                </u-form-item>
                <u-form-item v-if="model.fencetype == '变电作业'" label="地面高度:" borderBottom ref="item1" labelWidth="80px">
                    <tn-input v-show="model.fenceFloorHe!='-1'" v-model="model.fenceFloorHe"
                        inputAlign="right"></tn-input>
                    <!-- <uni-tooltip :content="content" placement="top" style="width:100px"> -->
                    <u-button style="width:100px" type="primary" v-show="model.fenceFloorHe=='-1'" size="mini"
                        @click="fenceHe()">已经放好</u-button>
                    <!-- <tn-button disabled v-show="zuobiaolist[i-1][1]==''" backgroundColor="#55aaff" fontColor="#ffffff"
                                size="small" @click="acquisitionxy(i,1)">采集坐标</tn-button> -->
                    <!-- </uni-tooltip> -->
                </u-form-item>
            </u--form>
        </u-modal>
        <!-- 连续绘制弹窗 -->
        <u-modal :show="ldrawshow" :title="ldrawtitle" :content='ldrawcontent' confirmText="开始绘制" cancelText="返回上一步"
            :showCancelButton="true" @cancel="ldrawcancel" @confirm="ldrawconfirm" buttonReverse></u-modal>
 
        <!-- <tn-popup v-model="lockguiji" :mask="false" mode="bottom" closeBtn :maskCloseable="false"> -->
 
        <u-button v-show="end" style="position: absolute;z-index: 99999999999999;bottom:15%;width:50%;left:25%"
            type="primary" shape="circle" text="结束绘制" @click="endsave()"></u-button>
        <!-- 打点绘制弹窗 pointdrawshow-->
        <u-modal style="position: absolute;z-index: 99999999999999;" buttonReverse confirmText="打点完成" cancelText="返回上一步"
            :show="pointdrawshow" @cancel="cancelpoint" @confirm="savepoint" ref="uModal" :showCancelButton="true"
            :closeOnClickOverlay="true">
            <view style="max-height: 300px; overflow-y: auto;">
                <u--form style="" labelPosition="left" :model="model" :rules="rules2" ref="uForm">
                    <u-form-item label="新增点:" borderBottom ref="item1" labelWidth="80px">
                        <u-number-box v-model="pointnum" :min="4" @change="onchange"></u-number-box>
                    </u-form-item>
                    <view v-for="(item, index) in pointlist" :key="index">
                        <u-form-item :label="'点' + (index+1) + '坐标:'" borderBottom ref="item1" labelWidth="80px">
                            <tn-input v-show="pointlist[index]!=index" v-model="pointlist[index]"
                                style="width:400rpx"></tn-input>
                            <uni-tooltip :content="pointcontent" placement="top" style="width:100px">
                                <u-button style="width:100px" type="primary" v-if="pointlist[index]==index"
                                    :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">采集坐标</u-button>
 
                                <u-button style="width:100px" type="primary" v-else-if="pointlist[index]==''"
                                    :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">采集坐标</u-button>
                            </uni-tooltip>
                        </u-form-item>
                    </view>
                </u--form>
 
            </view>
            <!-- <u-icon name="close" style="position: absolute;right: 10px;top:10px" @click="closemodal"></u-icon> -->
 
        </u-modal>
 
        <!-- </tn-popup> -->
        <!-- <view v-show="lockguiji"
            style=" position: absolute;z-index: 99999999999999;background-color: #cad1fd;bottom: 80px;width: 80%;left: 15%;">
            <view style="display: flex;">
 
                <span style="margin-right: 10px;">当前:{{dqnum}}</span>
                <span style="margin-right: 10px;">{{plackTime}}</span>
            </view>
            <view style="display: flex;">
                <span>速度:</span>
                <uni-data-select style="width: 40%;" placeholder="选择速度" v-model="model.sudu" :localdata="range"
                    @change="change"></uni-data-select>
            </view>
        </view> -->
        <div id="mars3dContainer" class="mars3d-container" :marsset='marsset' :change:marsset="mars3d.getmarsData"
            :amapPoints='amapPoints' :change:amapPoints="mars3d.getData" :threeortwo='threeortwo'
            :change:threeortwo="mars3d.get3wei" :amapPointData='amapPointData'
            :change:amapPointData="mars3d.getPointData" :amapldrawData='amapldrawData'
            :change:amapldrawData="mars3d.getDrwaData" :amapFencePoints='amapFencePoints'
            :change:amapFencePoints="mars3d.getFenceData" :amapdeFencePoints='amapdeFencePoints'
            :change:amapdeFencePoints="mars3d.getFenceDatade" :amapGPSPoints='amapGPSPoints'
            :change:amapGPSPoints="mars3d.getgpsData" :point='point' :change:point="mars3d.getmarsPoint"
            :fenceposition='fenceposition' :change:fenceposition="mars3d.getmarsfencePoint"></div>
        <!-- #endif -->
        <!-- #ifndef APP-PLUS || H5 -->
        <!-- #endif -->
        <successCom ref="refSuccess" style="position: absolute;z-index: 9999999999999999;"></successCom>
    </view>
</template>
<script>
    import successCom from '@/components/success.vue'
    import {
        findtagid,
        findWarnmes,
        submitper,
        findbumen,
        acquisition,
        findtagIdPerson,
        findBaiDuGuiJi,
        findAllFence,
        getBaseGPSCesium,
        findPerson,
        MarsHome,
        getGPSCesium,
        getGPS
    } from '@/config/api.js';
 
    // 逻辑层
    export default {
        components: {
            successCom
        },
        data() {
            return {
                warnlist: [],
                warnidlist: [],
                warnidslist: [],
                labelWidth: 100,
                pointlock: false, //踩点获取数据开关
                pointcontent: '',
                pointdisabled: false,
                pointlist: [0, 1, 2, 3],
                pointnum: 4,
                pointdrawshow: false,
                end: false,
                ldrawshow: false,
                ldrawtitle: '操作提示:',
                ldrawcontent: '请手持终端,等待RTK绿色后行走为一个闭合围栏。准备完毕后点击开始绘制,完成后点击结束绘制',
 
                isperties: true,
                drawway: '打点绘制',
                content: '请先输入终端编号',
                disabled: true,
                savefence: false,
                bumenList: [],
                show1: false,
                show2: false,
                typeList: [{
                        text: '保护区'
                    },
                    {
                        text: '禁入区'
                    },
                    {
                        text: '工作区'
                    },
                    {
                        text: '安全区'
                    },
                ],
                warnmesList: [{
                        text: '出去告警'
                    },
                    {
                        text: '进入告警'
                    },
                    {
                        text: '工作区'
                    },
                    {
                        text: '安全区'
                    },
                ],
                list: [
                    [
                        0, 1
                    ],
                    [
                        2, 3
                    ],
                    [
                        4, 5
                    ]
                ],
 
                zuobiaolist: [
                    [
                        '', '', '', ''
                    ],
                    // height1:'',
                    [
                        '', '', '', ''
                    ],
                    [
                        '', '', '', ''
                    ],
                    // height1:'',
                    [
                        '', '', '', ''
                    ],
                    // height3:'',
                ],
                saglist: [
                    [
                        '', '', '', ''
                    ],
                    [
                        '', '', '', ''
                    ],
                    [
                        '', '', '', ''
                    ],
 
                    // height3:'',
                ],
                // list: [
                //     [
                //         0, 1
                //     ],
                //     [
                //         2, 3
                //     ],
                //     [
                //         4, 5
                //     ]
                // ],
 
                // zuobiaolist: [
                //     [
                //         '1A', '1B', '1','11'
                //     ],
                //     // height1:'',
                //     [
                //         '2A', '2B', '2','22'
                //     ],
                //     [
                //         '3A', '3B', '3','33'
                //     ],
                //     // height1:'',
                //     [
                //         '4A', '4B', '4','44'
                //     ],
                //     // height3:'',
                // ],
                // saglist: [
                //     [
                //         'H5A', 'H5B', '5','55'
                //     ],
                //     [
                //         'H6A', 'H6B', '6','66'
                //     ],
                //     [
                //         'H7A', 'H7B', '7','77'
                //     ],
 
                //     // height3:'',
                // ],
                tanum: 2,
                color1: '#e2e2e2',
                color2: '#8b8b8b',
                color5: '#8b8b8b',
                color10: '#8b8b8b',
                color20: '#8b8b8b',
                color50: '#8b8b8b',
                color100: '#8b8b8b',
                sudu: 'x1',
                plackTime: '',
                dqnum: '',
                lockguiji: false,
                shownotify: true,
                cancelText: '暂停',
                isRunning: true,
                plackControl: '',
                countNum: 0,
                LocusData: '',
                // isPlack: false,
                value: '',
                startdatetime: '',
                stopdatetime: '',
                rangeLevel: [{
                    value: '0.95m',
                    text: '10kV(0.95m)'
                }, {
                    value: '1.05m',
                    text: '20kV(1.05m)'
                }, {
                    value: '1.15m',
                    text: '35kV(1.15m)'
                }, {
                    value: '1.4m',
                    text: '66kV(1.4m)'
                }, {
                    value: '1.65m',
                    text: '110kV(1.65m)'
                }, {
                    value: '2.55m',
                    text: '220kV(2.55m)'
                }, {
                    value: '3.25m',
                    text: '330kV(3.25m)'
                }, {
                    value: '4.66m',
                    text: '500kV(4.55m)'
                }, {
                    value: '6.70m',
                    text: '750kV(6.70m)'
                }, {
                    value: '8.25m',
                    text: '1000kV(8.25m)'
                }],
                rules2: {
 
                    'name': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请填写围栏名称',
                        trigger: ['blur', 'change']
                    },
                    'code': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请填写终端编号',
                        trigger: ['blur', 'change']
                    },
 
                    'type': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请选择围栏类型',
                        trigger: ['blur', 'change']
                    },
                    'department': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请选择关联部门',
                        trigger: ['blur', 'change']
                    },
                    'distance': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请填写预警距离',
                        trigger: ['blur', 'change']
                    },
                    'nowarnmes': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请填写预警语音',
                        trigger: ['blur', 'change']
                    },
                    'warnmes': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请填写告警语音',
                        trigger: ['blur', 'change']
                    },
                    'dianya': {
                        type: 'string',
                        // max: 1,
                        required: true,
                        message: '请填写电压等级',
                        trigger: ['blur', 'change']
                    },
 
                },
                radiolist2: [{
                        name: '打点绘制',
                        disabled: true
                    },
                    {
                        name: '连续绘制',
                        disabled: false
                        // },
                        // {
                        //     name: '5小时',
                        //     disabled: false
                    }
                ],
                radiolist1: [{
                        name: '输电作业',
                        disabled: false
                    },
                    {
                        name: '变电作业',
                        disabled: true
                        // },
                        // {
                        //     name: '5小时',
                        //     disabled: false
                    }
                ],
                boStart: 0,
                // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
                radiovalue1: '',
                code: '',
                isplay: false,
                digao: '',
                latlon: '',
                model: {
                    points: '',
                    fenceFloorHe: '-1', //围栏底高
                    height: '', //围栏高
                    lineHeight: '-1', //导线高
                    company: this.company,
                    perCompany: '',
                    addperson: this.username,
                    // // userInfo: {
                    name: '',
                    juli: '',
                    type: '',
                    department: '',
                    distance: '0',
                    dianya: '',
                    // fencetype:'',//围栏性质
                    isplay: '0',
                    nowarnmes: '',
                    warnmes: '',
                    fencetype: '变电作业',
                    // },
                },
                drawshow: false,
                checked: false,
                guijishow: false,
                show: false,
                amapsuduPoints: 0,
                amapendGuijiPoints: '',
                amapGuijiPoints: [],
                amapFencePoints: [],
                amapdeFencePoints: {},
                keyword: '',
                topheight: 55,
                threeortwo: [],
                amapPoints: [], // 这就是我们需要向视图层传递的数据
                amapPointData: [], // 这就是我们需要向视图层传递的数据
                amapldrawData: [],
                amapGPSPoints: [],
                marsset: {},
                point: {},
                drawlist: [],
                longitude: '',
                latitude: '',
                show4: false,
                showtagid: false,
                tagidlist: [],
                tagonlie: '',
                skeletonHeight: '',
                buttonTop: 0, // 按钮的 top 位置
                buttonLeft: 0 // 按钮的 left 位置
            }
 
        },
        props: {
            fenceposition: {
                type: String,
                // default: 60
            },
 
        },
        mounted() {
            console.log(this.fenceposition);
 
            this.getLocation();
            this.warnidslist = []
            this.warnidlist = []
            this.warnlist = []
            this.findtagidall();
            this.findbumenall();
            this.initMap();
            // this.updateButtonPosition(); // 初始化按钮位置
            // window.addEventListener('resize', this.updateButtonPosition); // 监听窗口大小变化
            this.$nextTick(() => {
                // 获取系统信息
                const systemInfo = uni.getSystemInfoSync()
                this.skeletonHeight = systemInfo.safeArea.height
                this.buttonTop = this.skeletonHeight - 224;
 
                this.buttonLeft = 15;
                // this.webHeight = this.skeletonHeight - this.tabBarHeight
 
                // this.vuex_status_bar_height = this.webHeight
                // this.currentIndex = 2
            })
            this.threeortwo.push(this.is3wei)
            // this.amapPoints = []
            // this.amapBasePoints = []
            // this.amapFencePoints = []
 
            // this.amapGuijiPoints = []
            // this.amapendGuijiPoints = ''
            this.topheight = this.vuex_custom_bar_height + 15
 
 
 
 
        },
        methods: {
            // updateButtonPosition() {
            //                 const windowHeight = window.innerHeight;
            //                 console.log(windowHeight);
            //                 const windowWidth = window.innerWidth;
            //                 this.buttonTop = windowHeight-279 ;
            //                 this.buttonLeft = 15;
            //                 console.log(this.buttonTop);
            //               },
            findtagidall() {
                if (this.vuex_is_login) {
                    const params = {
                        company: this.company,
                        juese: uni.getStorageSync('juese'),
                    }
                    findtagid(params).then((res) => {
                        console.log(res);
                        if (res.code == 0) {
                            this.tagidlist = res.data.map(item => ({
                                value: item.online,
                                label: item.tagid
                            }));
                        } else {
                            this.$refs.refSuccess.showBox({
                                type: 'error',
                                txt: res.msg
                            });
                        }
                    })
                }
 
            },
            confirmtagid(e) {
                this.code = e[0].label
                // this.tagonlie = e[0].value
                this.seachcode()
 
            },
            changeRangeLevel(e) {
                console.log(e);
                // console.log(this.model.juli);
                this.model.juli = this.rangeLevel[e].text;
                // if (this.model.juli != '') {
                this.model.dianya = this.rangeLevel[e].value.split("m")[0]
                // }
                // this.dianya = e;
                // this.model.dianya = e.split("m")[0];
            },
            getLocation() {
                uni.getLocation({
                    type: 'wgs84',
                    success: function(res) {
                        console.log('当前位置的经度:' + res.longitude);
                        console.log('当前位置的纬度:' + res.latitude);
 
                    }
                });
            },
 
            onchange(e) {
                var list = []
                if (this.pointlist.length < e.value) {
                    for (var i = this.pointlist.length; i < e.value; i++) {
 
                        list.push(i)
                        this.pointlist.push(i)
                        // e[i]
                    }
                } else {
                    this.pointlist.splice(e.value, this.pointlist.length - e.value)
                }
            },
            radioChange(n) {
 
                if (n == '变电作业') {
                    this.isperties = true
                } else {
                    this.isperties = false
 
                }
            },
            seachcode(e) {
                this.drawlist = []
                const params = {
                    id: this.code,
                    company: this.company,
                    juese: uni.getStorageSync('juese'),
                }
                findtagIdPerson(params).then((res) => {
                    if (res.data != null) {
                        this.tagonlie = res.data.online
                        if (res.data.gpsstatus == '4') {
                            this.disabled = false
                            this.content = ''
                            this.pointcontent = ''
                            this.digao = res.data.height
                            // this.end = true
                            if (this.end == true) {
                                this.model.points += res.data.lat + ":" + res.data.lon + ";"
 
                                this.drawlist.push(res.data.lat)
                                this.drawlist.push(res.data.lon)
                                this.amapldrawData.push(this.drawlist)
                            }
                            // if (this.pointlock == true) {
                            //     this.amapPointData.push(res.data)
 
                            //     this.pointlock = false
                            // }
 
                        } else {
                            this.content = '设备非高精'
                            this.disabled = true
                            this.pointcontent = '设备非高精'
                        }
                    } else {
                        this.disabled = true
                        this.content = '未搜索到设备'
                        this.pointcontent = '未搜索到设备'
                    }
                })
                setTimeout(() => {
                    //     //5秒播放一次
                    this.seachcode()
                }, 1000);
 
            },
            isopen(e) {
                if (e == true) {
                    this.model.isplay = '1'
                } else {
                    this.model.isplay = '0'
                }
            },
            findbumenall() {
                if (this.vuex_is_login) {
                    const params = {
                        company: this.company,
                        juese: uni.getStorageSync('juese'),
                    }
                    findbumen(params).then((res) => {
                        console.log(res);
                        if (res.code == 0) {
                            this.bumenList = res.data.map(item => ({
                                value: item.name,
                                text: item.name
                            }));
                        } else {
                            this.$refs.refSuccess.showBox({
                                type: 'error',
                                txt: res.msg
                            });
                        }
                    })
                }
 
            },
            typeCallback(index) {
                const params = {
                    type: this.typeList[index].text,
                }
                findWarnmes(params).then((res) => {
                    if (res.code == 0) {
                        // nowarnmes: '靠近危险请注意',
                        // warnmes: '进入危险区域请注意',
                        // if (res.data.type == "工作区") {
                        //     this.model.nowarnmes = res.data.nowarnmes + ";" + res.data.nowarnmestype
                        //     this.model.warnmes = res.data.warnmes + ";" + res.data.warnmestype
                        // } else {
                        this.model.nowarnmes = res.data.nowarnmes
                        this.model.warnmes = res.data.warnmes
                        // }
                    } else {
 
                    }
                })
                this.model.type = this.typeList[index].text;
            },
            bymenCallback(index) {
                this.model.department = this.bumenList[index].text;
 
            },
            acquisitionxy(index, i, name) {
                const params = {
                    baoliu3: this.code,
                    company: this.company,
                    juese: uni.getStorageSync('juese'),
                }
                console.log(params);
                if (this.vuex_is_login) {
                    acquisition(params).then((res) => {
                        console.log(res);
                        if (res.code == 0) {
                            if (this.model.fencetype == '变电作业') {
                                // this.model.points += res.data.lat + ":" + res.data.lon + ";"
                                this.pointlist.splice(index, 1, res.data.lat + ":" + res.data.lon);
                                console.log(this.pointlist);
                                this.amapPointData.splice(index, 1, res.data);
                                // this.amapPointData.push(res.data)
                                // this.amapPointData = this.pointlist
                                this.pointlock = true
                            } else {
                                console.log(name);
                                if (name == 'zb') {
                                    console.log(index);
                                    console.log(i);
                                    this.zuobiaolist[index - 1][i] = res.data.lat + ":" + res.data.lon + ";"
                                    this.zuobiaolist[index - 1][2] = res.data.height
                                    this.amapPointData.splice(index + i, 1, res.data);
                                } else {
                                    this.saglist[index - 1][i] = res.data.lat + ":" + res.data.lon + ";"
                                    this.saglist[index - 1][2] = res.data.height
 
                                }
 
                            }
                        } else {
                            this.$refs.refSuccess.showBox({
                                type: 'error',
                                txt: res.msg
                            });
                        }
                    })
                }
 
            },
 
            valChange(e) {
                console.log('当前值为: ' + e.value)
            },
            initlock() {
                this.fetchPersonsList();
                this.fetchFenceList();
 
            },
            closemodal() {
                this.drawshow = false
            },
            cancelmodal() {
                this.drawshow = false
            },
            cancelsave() {
                this.savefence = false
                this.drawshow = true
            },
            save() {
                this.model.company = this.company
                this.model.addperson = this.vuex_user
                this.model.perCompany = this.company
 
 
                if (this.model.fencetype == '输电作业') {
                    this.model.points = this.zuobiaolist
                    var hei = ''
                    let num = this.tanum - 1
                    let result = '';
                    //根据塔数循环查询塔和弧垂的坐标A数据,根据第一条塔,第二条弧垂把数据拼接起来
                    for (let i = 0; i < this.tanum; i++) {
                        result += this.zuobiaolist[i][0];
                        if (i < num) {
                            result += this.saglist[i][0];
                        }
 
                        hei += this.zuobiaolist[i][2] + ":" + this.zuobiaolist[i][3] + ';';
                        if (i < num) {
                            hei += this.saglist[i][2] + ":" + this.saglist[i][3] + ';';
                        }
 
                        // hei += this.zuobiaolist[i][3];
                        // if (i < num) {
                        //     hei += this.saglist[i][3];
                        // }
                    }
                    //从最后一条查询点位B第一条塔,第二条弧垂拼接,最后把两组数据拼接起来
                    for (let i = this.tanum - 1; i >= 0; i--) {
                        result += this.zuobiaolist[i][1];
                        if (i >= 1) {
                            result += this.saglist[i - 1][1];
                        }
 
                        // hei += this.zuobiaolist[i][2];
                        // if (i >= 1) {
                        //     hei += this.saglist[i - 1][2];
                        // }
 
                        hei += this.zuobiaolist[i][2] + ":" + this.zuobiaolist[i][3] + ';';
                        if (i >= 1) {
                            hei += this.saglist[i - 1][2] + ":" + this.saglist[i - 1][3] + ';';
                        }
                    }
                    console.log(result);
                    console.log(hei);
                    this.model.points = result
                    this.model.lineHeight = hei
                } else {
                    let result = '';
                    for (var i = 0; i < this.pointlist.length; i++) {
                        result += this.pointlist[i] + ";"
                    }
                    this.model.points = result
                }
 
                this.$refs.uForm.validate().then(res => {
                    uni.$u.toast('校验通过')
                    submitper(this.model).then((res) => {
                        if (res.code == 0) {
                            this.$refs.refSuccess.showBox({
                                type: 'success',
                                txt: "保存成功"
                            });
 
                            this.savefence = false
                            this.amapldrawData = []
                            this.amapPointData = []
                        } else {
                            this.$refs.refSuccess.showBox({
                                type: 'error',
                                txt: res.data
                            });
                        }
                    })
                    // this.savefence = false
                }).catch(errors => {
                    // uni.$u.toast('校验失败')
                })
                // this.savefence = false
            },
 
 
            formatDate(date) {
                const year = date.getFullYear();
                const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始
                const day = String(date.getDate()).padStart(2, '0');
                const hours = String(date.getHours()).padStart(2, '0');
                const minutes = String(date.getMinutes()).padStart(2, '0');
                const seconds = String(date.getSeconds()).padStart(2, '0');
 
                return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
            },
 
            startdraw() {
                if (this.code == '') {
                    this.$refs.refSuccess.showBox({
                        type: 'error',
                        txt: '请输入终端编号'
                    });
                } else {
                    //选择变电作业
                    if (this.isperties == false) {
                        for (var i = 0; i < this.tanum; i++) {
                            if (this.zuobiaolist[i][0] == '' && this.zuobiaolist[i][1] == '') {
                                // lock = true
                                this.$refs.refSuccess.showBox({
                                    type: 'error',
                                    txt: '请先打点'
                                });
                            } else if (this.zuobiaolist[i][2] == '') {
                                this.$refs.refSuccess.showBox({
                                    type: 'error',
                                    txt: '请输入导线高'
                                });
                                // lock = false
                            } else {
                                this.drawshow = false
                                this.savefence = true
                            }
                        }
                    } else {
                        if (this.drawway == "连续绘制") {
                            this.drawshow = false
                            this.ldrawshow = true
                        } else {
                            this.drawshow = false
                            this.pointdrawshow = true
                        }
                    }
                }
 
 
 
 
            },
            cancelpoint() {
                this.drawshow = true
                this.pointdrawshow = false
            },
            savepoint() {
                this.pointdrawshow = false
                this.savefence = true
            },
            fenceHe() {
                //获取围栏底高
                this.model.fenceFloorHe = this.digao
            },
            endsave() {
                this.end = false
                this.savefence = true
            },
            ldrawcancel() {
                this.drawshow = true
                this.ldrawshow = false
            },
 
            ldrawconfirm() {
 
                this.ldrawshow = false
                this.end = true
                // this.model.points += this.latlon
            },
            change(e) {
                this.amapsuduPoints = e
            },
            draw() {
 
                if (this.vuex_is_login == true) {
                    this.drawshow = true
                    this.savefence = false
                }
            },
            zoom() {
                this.show = !this.show
            },
            receiveRenderData(val) {
                this.fetchPersonsList();
                this.updateTrajectories();
                this.fetchFenceList();
            },
            searchxinxi() {
                const params = {
                    name: this.keyword,
                    company: this.company,
                }
                if (this.vuex_is_login) {
                    findPerson(params).then((res) => {
                        if (res.code == 0) {
                            var targetPoint = {}
                            targetPoint.lat = res.data.lon
                            targetPoint.lon = res.data.lat
                            this.point = targetPoint
                        } else {
                            this.$refs.refSuccess.showBox({
                                type: 'error',
                                txt: res.msg
                            });
                        }
                    })
                }
            },
            handleMapClick(e) {
                this.$emit('mars3dc', e)
            },
 
            guijiClick(e) {
                this.dqnum = e.dqnum
                this.plackTime = e.plackTime
            },
            initMap() {
                // if (this.vuex_is_login) { 
                MarsHome().then((rep) => {
 
                    // uni.getLocation({
                    // type: 'wgs84',
                    // success: function(res) {
                    //     console.log('当前位置的经度:' + res.longitude);
                    //     console.log('当前位置的纬度:' + res.latitude);
                    if (this.lonlat != '') {
                        rep.data[0].mapposition = this.lonlat
                    }
                    //     }
                    // });
                    this.marsset = rep.data[0]
                })
                // }
            },
            fetchFenceList() {
                const params = {
                    company: this.company,
                    juese: uni.getStorageSync('juese'),
                }
                if (this.vuex_is_login) {
                    if (uni.getStorageSync('isfence') == true) {
                        findAllFence(params).then((res) => {
                            if (res.data != null) {
                                const filteredData = res.data.filter(item => item.isplay === 0);
                                if (filteredData != null) {
                                    this.amapdeFencePoints = filteredData
                                }
                                if (this.amapFencePoints.length > res.data.length) {
                                    //当有围栏删除时调用地图把围栏全部删除
                                    const missingData = this.amapFencePoints.filter(item1 => {
                                        return !res.data.some(item2 => item2.id === item1.id);
                                    });
                                    this.amapdeFencePoints = missingData
 
                                }
                                this.amapFencePoints = res.data
                            }
                        })
                    } else {
                        this.amapFencePoints = []
                    }
                }
                setTimeout(() => {
                    //5秒播放一次
                    this.fetchFenceList();
                }, 5000);
            },
 
            fetchPersonsList() {
                this.amapPoints = []
                const params = {
                    company: this.company,
                    juese: uni.getStorageSync('juese'),
                }
                if (this.vuex_is_login) {
                    getGPSCesium(params).then((res) => {
                            if (res.data != null) {
                                this.amapPoints = res.data
                                for (var i = 0; i < res.data.length; i++) {
                                    // res.data[i].online==1
                                    if (res.data[i].online == "1") {
                                        console.log(this.zystate);
                                        if (this.zystate == 'START') {
                                            // if (res.data.filter(item => item.warnstatus == '1').length > 0) {
                                            //         if (this.warnidlist.indexOf(res.data[i].warnstatus=='1') < 0) {
                                            //             this.warnlist.push(res.data.filter(item => item.warnstatus == '1')[
                                            //                     0].tagid +
                                            //                 "进入预警区域请注意")
                                            //             this.warnidlist.push(res.data.filter(item => item.warnstatus ==
                                            //                 '1')[0].tagid)
                                            //         } else {
 
                                            //             this.warnlist.splice(this.warnidlist.indexOf(res.data.filter(
                                            //                         item => item.warnstatus !=
                                            //                         '1')[0] 
                                            //                     .tagid),
                                            //                 1)
                                            //         this.warnidlist.splice(this.warnidlist.indexOf(res.data.filter(item =>
                                            //                     item.warnstatus !=
                                            //                     '1')[0]
                                            //                 .tagid),
                                            //             1)
                                            // }
                                            // }
                                            if (this.warnidlist.indexOf(res.data[i].tagid) < 0) {
                                                if (res.data[i].warnstatus == '1') {
                                                    this.warnlist.push(res.data[i].tagid +
                                                        "进入预警区域请注意")
                                                    this.warnidlist.push(res.data[i].tagid)
                                                } else if (res.data[i].baoliu2.split(";")[0] == 1) {
                                                    this.warnlist.push(res.data[i].tagid +
                                                        "进入禁入区请注意")
                                                    this.warnidlist.push(res.data[i].tagid)
                                                } else if (res.data[i].baoliu2.split(";")[1] == 0) {
                                                    this.warnlist.push(res.data[i].tagid +
                                                        "超范围请注意")
                                                    this.warnidlist.push(res.data[i].tagid)
                                                } else if (res.data[i].baoliu2.split(";")[2] == 1) {
                                                    this.warnlist.push(res.data[i].tagid +
                                                        "超高请注意")
                                                    this.warnidlist.push(res.data[i].tagid)
                                                }
                                            } else {
                                                if (res.data[i].baoliu2.split(";")[0] == 1) {} else if (res.data[i]
                                                    .baoliu2
                                                    .split(";")[1] == 0) {} else if (res.data[i].baoliu2.split(";")[
                                                        2] ==
                                                    1) {} else if (res.data[i].warnstatus == '1') {} else {
                                                    this.warnlist.splice(this.warnidlist.indexOf(res.data[i].tagid),
                                                        1)
                                                    this.warnidlist.splice(this.warnidlist.indexOf(res.data[i].tagid),
                                                        1)
                                                }
                                            } 
                                                const filteredData = res.data.filter(item => {
                                                    return item.online === "1" && item.gpsstatus !== "4" && (
                                                        item
                                                        .baoliu1 ===
                                                        '手持标签' || item.baoliu1 === '车载标签');
                                                });
                                                // 将符合条件的数据的 tagid 添加到 this.warnidlist 中
                                                filteredData.forEach(item => {
                                                    if (this.warnidslist.indexOf(item.tagid) < 0) {
                                                        this.warnlist.push(item.tagid + "设备非高精");
                                                        this.warnidslist.push(item.tagid)
                                                    }
                                                });
                                            } else {
                                                this.warnlist = [];
                                                this.warnidslist = []
                                            }
                                        } else {
 
                                        }
                                    }
 
 
                                }
 
                            })
                    }
 
                    setTimeout(() => {
                        //5秒播放一次
                        this.fetchPersonsList();
                    }, 5000);
                },
 
                updateTrajectories() {
                    const params = {
                        company: this.company,
                        juese: uni.getStorageSync('juese'),
                    }
                    if (this.vuex_is_login) {
                        getGPS(params).then((res) => {
                            if (res.data != null) {
                                this.amapGPSPoints = res.data
                            }
                        })
                    }
                    setTimeout(() => {
                        //5秒播放一次
                        this.updateTrajectories();
                    }, 1000);
                },
            }
        }
</script>
<script module="mars3d" lang="renderjs">
    let graphicLayer = null;
    let graphicLayerFence = null;
    let graphicLayerFenceBianJie = null;
    let graphicLayerFencedrwa = null;
    var creditHtml = ''
    var map
    let addedCarIds = new Set();
    let addedBaseIds = new Set();
    let addedFenceIds = new Set();
    var LocusData;
    var LocuData;
    var countNum = 0;
    var sudus = 1000;
    let isRunning = true; // 标志变量,用于控制方法是否继续执行
    var params;
    var plackControl;
    var timeoutId;
    var isPlack = true;
    var car;
    var num = 0;
    var globalMap = false;
    import {
        mapOptions
    } from './config.js'
    if (!String.prototype.replaceAll) {
        String.prototype.replaceAll = function(str, newStr) {
            // If a regex pattern
            if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
                return this.replace(str, newStr);
            }
            // If a string
            return this.replace(new RegExp(str, 'g'), newStr);
        };
    }
 
    export default {
        data() {
            return {
                fplock: false,
                fenceplock: false,
                plist: [],
                cartesianPoints: [],
                sudus: 0,
                boStart: 0,
                is2d: false,
                dot: 123,
                graphicLabels: {},
                graphicLabelsids: {},
                fenceid: '',
                fenceids: '',
                graphicids: [],
                graphicFence: {},
                labels: {},
                list: {},
                perlist: {},
            }
        },
        props: {
            homelat: {
                type: Number,
            },
            homelng: {
                type: Number,
            },
        },
        mounted() {
            addedCarIds = new Set();
            graphicLayer = null
            this.loadSource([
 
                //用本地地址,并可以官网下载最新包,手动覆盖下,http://mars3d.cn/download.html
                // "static/lib/Cesium/Widgets/widgets.css",
                // "static/lib/Cesium/Cesium.js",
                // "static/lib/mars3d/mars3d.css",
                // "static/lib/mars3d/mars3d.js",
                // "static/css/style.css", 
 
                // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/Cesium/Widgets/widgets.css",
                // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/Cesium/Cesium.js",
                // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/mars3d/mars3d.css",
                // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/mars3d/mars3d.js",
                // "http://123.56.113.213:8080/hxzkuwb/Home/js/3DMoXing.js",
                "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css",
                "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js",
                "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css",
                "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js",
 
                // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css",
                // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js",
                // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css",
                // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js",
                //用在线地址
                // "http://mars3d.cn/lib/Cesium/Widgets/widgets.css",
                // "http://mars3d.cn/lib/Cesium/Cesium.js", 
                // "http://mars3d.cn/lib/mars3d/mars3d.css", 
                // "http://mars3d.cn/lib/mars3d/mars3d.js",
                "static/css/style.css",
            ]).then(() => {
                this.rewriteCesiumSources(Cesium);
                // if (globalMap==false) {
                this.createMap()
                // }
 
            })
        },
        methods: {
            //创建地图
            getTerrainProviderViewModelsArr() {
                return [
                    new Cesium.ProviderViewModel({
                        name: "无地形",
                        tooltip: "WGS84标准球体",
                        iconUrl: "static/img/basemaps/TerrainEllipsoid.png",
                        creationFunction: function() {
                            return mars3d.LayerUtil.getNoTerrainProvider()
                        }
                    }),
                    new Cesium.ProviderViewModel({
                        name: "中国地形",
                        tooltip: "由 火星科技 提供的中国国内地形",
                        iconUrl: "static/img/basemaps/TerrainSTK.png",
                        creationFunction: function() {
                            return mars3d.LayerUtil.createTerrainProvider({
                                url: "http://data.mars3d.cn/terrain"
                            })
                        }
                    }),
                    new Cesium.ProviderViewModel({
                        name: "ArcGIS地形",
                        tooltip: "由 火星科技 提供的中国国内地形",
                        iconUrl: "static/img/basemaps/TerrainSTK.png",
                        creationFunction: function() {
                            return mars3d.LayerUtil.createTerrainProvider({
                                type: "arcgis",
                                url: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
                            })
                        }
                    }),
                    new Cesium.ProviderViewModel({
                        name: "全球地形",
                        tooltip: "由 Cesium官方 提供的高分辨率全球地形",
                        iconUrl: "static/img/basemaps/TerrainSTK.png",
                        creationFunction: function() {
                            return mars3d.LayerUtil.createTerrainProvider({
                                type: "ion",
                                requestWaterMask: true,
                                requestVertexNormals: true
                            })
                        }
                    })
                ]
            },
            getmarsData(newValue) {
                this.list = newValue
            },
            get3wei(newValue) {
                this.is2d = newValue[0]
 
            },
            //创建地图
            createMap() {
                if (Object.keys(this.list).length == 0) { //切换页面有时会因为getmarsData()在createMap()之后执行,导致此方法没有原始定位数据报错
                    setTimeout(() => {
                        //5秒播放一次
                        this.createMap()
                    }, 100);
                } else {
                    let mapPositionlat;
                    let mapPositionlng;
                    let mapPositionalt;
                    let mapPositionheading;
                    let mapPositionpitch;
                    mapPositionlat = this.list.mapposition.split(',')[1];
                    mapPositionlng = this.list.mapposition.split(',')[0];
                    mapPositionalt = this.list.alt;
                    mapPositionheading = this.list.heading;
                    mapPositionpitch = this.list.pitch;
                    const Cesium = mars3d.Cesium;
                    map = new mars3d.Map('mars3dContainer', {
                        scene: {
                            center: {
                                // lat: 38.443729,
                                // lng: 38.443729,
                                // alt: 200,
                                // heading: 0,
                                // pitch: 0,
 
                                lat: mapPositionlat,
                                lng: mapPositionlng,
                                alt: mapPositionalt,
                                heading: 0,
                                pitch: 0
                            },
                            // center: { lat: mapPosition[1], lng: mapPosition[0], alt: HomeSetting.alt, heading: HomeSetting.heading, pitch: HomeSetting.pitch },
                            showSkyAtmosphere: false, // 关闭球周边的白色轮廓 map.scene.skyAtmosphere = false
                            fog: true,
                            fxaa: true,
                            globe: {
                                showGroundAtmosphere: false, // 关闭大气(球表面白蒙蒙的效果)
                                depthTestAgainstTerrain: false,
                                baseColor: "#546a53"
                            },
                            // terrain: {
                            //     url: "http://data.mars3d.cn/terrain",
                            //     show: true
                            // },
                            cameraController: {
                                zoomFactor: 10.0,
                                touchZoomFactor: 10.0, // 触摸缩放灵敏度(与鼠标滚轮同步)
                                zoomAnimation: true, // 启用缩放动画
                                zoomAnimationTime: 0.3, // 动画持续时间(秒),
                                minimumZoomDistance: 1,
                                maximumZoomDistance: 50000000,
                                enableRotate: true,
                                enableZoom: true,
                                enableContinuousZoom: true, // 启用惯性滚动(可选)
                                zoomAnimationTime: 0.1, // 动画时间(缩短可加快响应)
                            },
                            mapProjection: mars3d.CRS.EPSG3857, // 2D下展示墨卡托投影
                            mapMode2D: Cesium.MapMode2D.INFINITE_SCROLL, // 2D下左右一直可以滚动重复世界地图
                            skyBox: {
                                sources: {
                                    positiveX: "static/img/skybox_near/qingtian/rightav9.jpg",
                                    negativeX: "static/img/skybox_near/qingtian/leftav9.jpg",
                                    positiveY: "static/img/skybox_near/qingtian/frontav9.jpg",
                                    negativeY: "static/img/skybox_near/qingtian/backav9.jpg",
                                    positiveZ: "static/img/skybox_near/qingtian/topav9.jpg",
                                    negativeZ: "static/img/skybox_near/qingtian/bottomav9.jpg"
                                },
                                sources2: {
                                    positiveX: "static/img/skybox_near/wanxia/SunSetRight.png",
                                    negativeX: "static/img/skybox_near/wanxia/SunSetLeft.png",
                                    positiveY: "static/img/skybox_near/wanxia/SunSetFront.png",
                                    negativeY: "static/img/skybox_near/wanxia/SunSetBack.png",
                                    positiveZ: "static/img/skybox_near/wanxia/SunSetUp.png",
                                    negativeZ: "static/img/skybox_near/wanxia/SunSetDown.png"
                                },
                                sources3: {
                                    negativeX: "static/img/skybox/2/tycho2t3_80_mx.jpg",
                                    negativeY: "static/img/skybox/2/tycho2t3_80_my.jpg",
                                    negativeZ: "static/img/skybox/2/tycho2t3_80_mz.jpg",
                                    positiveX: "static/img/skybox/2/tycho2t3_80_px.jpg",
                                    positiveY: "static/img/skybox/2/tycho2t3_80_py.jpg",
                                    positiveZ: "static/img/skybox/2/tycho2t3_80_pz.jpg"
                                }
                            },
                            // sceneMode: this.is2d // 设置初始场景模式为2D
                        },
                        terrain: false, // 关闭地形空间
                        // terrain: {
                        //     url: "http://data.mars3d.cn/terrain",
                        //     show: true
                        // },
                        control: {
                            // geocoder:true,
                            mouseDownView: true,
                            clockAnimate: false,
                            timeline: false,
                            compass: false,
                            navigationHelpButton: false,
                            fullscreenButton: false,
                            homeButton: true,
                            locationBar: false,
                            zoom: true,
                            sceneModePicker: false,
                            baseLayerPicker: true, // 是否显示图层选择控件
                            terrainProviderViewModels: this
                                .getTerrainProviderViewModelsArr() // 自baseLayerPicker面板的地形可选数组
                        },
 
                        basemaps: [{
                                //     name: "天地图影像",
                                //     icon: "static/img/basemaps/tdt_img.png",
                                //     type: "tdt",
                                //     layer: "img_d",
                                //     key: mars3d.Token.tiandituArr,
                                //     show: false, // 关闭天地图影像
                                //     credit: creditHtml
                                // },
                                // {
                                //     name: "天地图电子",
                                //     icon: "static/img/basemaps/tdt_vec.png",
                                //     type: "group",
                                //     layers: [{
                                //             name: "底图",
                                //             type: "tdt",
                                //             layer: "vec_d",
                                //             key: mars3d.Token.tiandituArr
                                //         },
                                //         {
                                //             name: "注记",
                                //             type: "tdt",
                                //             layer: "vec_z",
                                //             key: mars3d.Token.tiandituArr
                                //         }
                                //     ],
                                //     show: false, // 关闭天地图电子
                                //     credit: creditHtml
                                // },
                                // {
                                name: "高德影像",
                                icon: "static/img/basemaps/gaode_img.png",
                                type: "group",
                                layers: [{
                                        name: "底图",
                                        type: "gaode",
                                        layer: "img_d"
                                    },
                                    {
                                        name: "注记",
                                        type: "gaode",
                                        layer: "img_z"
                                    }
                                ],
                                show: false, // 关闭高德影像
                                credit: creditHtml
                            },
                            {
                                name: "高德电子",
                                icon: "static/img/basemaps/gaode_vec.png",
                                type: "gaode",
                                layer: "vec",
                                show: true, // 默认显示高德电子地图
                                credit: creditHtml
                            },
                            {
                                name: "百度影像",
                                icon: "static/img/basemaps/gaode_img.png",
                                type: "group",
                                layers: [{
                                        name: "底图",
                                        type: "baidu",
                                        layer: "img_d"
                                    },
                                    {
                                        name: "注记",
                                        type: "baidu",
                                        layer: "img_z"
                                    }
                                ],
                                show: false, // 关闭百度影像
                                credit: creditHtml
                            },
                            {
                                name: "百度电子",
                                icon: "static/img/basemaps/gaode_vec.png",
                                type: "baidu",
                                layer: "vec",
                                show: false, // 关闭百度电子
                                credit: creditHtml
                            },
                            {
                                //     name: "谷歌影像",
                                //     icon: "static/img/basemaps/google_img.png",
                                //     type: "google",
                                //     layer: "img_d",
                                //     chinaCRS: mars3d.ChinaCRS.GCJ02,
                                //     show: false // 关闭谷歌影像
                                // },
                                // {
                                //     name: "谷歌电子",
                                //     icon: "static/img/basemaps/google_vec.png",
                                //     type: "google",
                                //     layer: "vec",
                                //     chinaCRS: mars3d.ChinaCRS.GCJ02,
                                //     show: false // 关闭谷歌电子
                                // },
                                // {
                                name: "ArcGIS影像",
                                icon: "static/img/basemaps/esriWorldImagery.png",
                                type: "arcgis",
                                layer: "img_d",
                                enablePickFeatures: false,
                                show: false // 关闭 ArcGIS 影像
                            }
                        ]
                    });
                    // const toolbar = new mars3d.control.geocoder({
                    //     position: { top: "10px", left: "10px" }, // 按钮位置
                    //     items: [
                    //       {
                    //         type: "button",
                    //         text: "搜索",
                    //         icon: "fa fa-search", // 使用 Font Awesome 图标
                    //         action: () => {
                    //           // this.$refs.searchBox.show(); // 调用搜索框的显示方法
                    //         }
                    //       }
                    //     ]
                    //   });
                    //   map.addControl(toolbar);
 
                    if (this.is2d == true) {
                        map.scene.morphTo3D(0);
                    } else {
                        map.scene.morphTo2D(0);
                    }
                    // 创建矢量数据图层
                    graphicLayer = new mars3d.layer.GraphicLayer({
                        allowDrillPick: true // 如果存在坐标完全相同的图标点,可以打开该属性,click事件通过graphics判断
                    })
                    graphicLayerFencedrwa = new mars3d.layer.GraphicLayer()
                    map.addLayer(graphicLayerFencedrwa)
                    graphicLayerFenceBianJie = new mars3d.layer.GraphicLayer()
                    map.addLayer(graphicLayerFenceBianJie)
                    graphicLayerFence = new mars3d.layer.GraphicLayer()
                    map.addLayer(graphicLayerFence)
 
 
 
 
                    map.addLayer(graphicLayer)
                    // 绑定点击事件
                    graphicLayer.on(mars3d.EventType.click, (event, position) => {
                        var car = event.graphic
                        // var list = []
                        var json = {}
 
                        // var message = "姓名: " + name + "<br>编号: " + number;
                        // // 使用Mars3D的提示框组件显示信息
                        //     this.graphicLayer.bindPopup(new mars3d.Tooltip({
                        //         content: message,
                        //         position: position, // 指定提示框的位置为点击的位置
                        //         className: "custom-tooltip", // 可以添加自定义样式类
                        //         closeButton: true, // 是否显示关闭按钮
                        //     }));
                        // 打开提示框
                        // this.graphicLayer.openPopup();
 
                        json.online = car.attr.online
                        json.baoliu1 = car.attr.baoliu1
                        json.type = car.attr.type
                        json.rtcm = car.attr.rtcm
                        json.tagid = car.attr.tagid
                        json.encryption = car.attr.encryption
                        json.personname = car.attr.personname
                        json.power = car.attr.power
                        json.height = car.attr.height
                        json.department = car.attr.department
                        json.gpsstatus = car.attr.gpsstatus
                        this.perlist = json
                        this.$ownerInstance.callMethod('handleMapClick', this.perlist);
 
 
                    })
 
                    //测试本地图片 
                    // const graphic = new mars3d.graphic.BillboardEntity({
                    //     position: [117.229619, 31.686288, 1000],
                    //     style: {
                    //         image: "static/img/mark-red.png",
                    //         horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                    //         verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                    //     },
                    //     attr: {
                    //         remark: "示例1"
                    //     }
                    // })
                    // graphicLayer.addGraphic(graphic)
                    // this.fetchPersonsList()
                    // this.updateTrajectories()
 
                    // this.getGPSCesium();
                    this.$ownerInstance.callMethod('receiveRenderData', this.dot)
                    this.fplock = true
                    globalMap = true
                }
                this.$ownerInstance.callMethod('initlock');
            },
            getmarsPoint(newValue) {
                if (Object.keys(newValue).length != 0) {
                    map.camera.flyTo({
                        destination: Cesium.Cartesian3.fromDegrees(newValue.lon, newValue.lat, 500), // 目标点经纬度和视角高度
                        duration: 3 // 动画持续时间(秒)
                    });
                }
            },
 
            getmarsfencePoint(newValue) {
                console.log(444444444444);
                console.log(newValue);
                console.log(newValue.split(",")[0]);
                if (this.fenceplock == false) {
                    setTimeout(() => {
                        if (this.fplock == true) {
                            //5秒播放一次
                            if (Object.keys(newValue).length != 0) {
                                map.camera.flyTo({
                                    destination: Cesium.Cartesian3.fromDegrees(newValue.split(",")[0],
                                        newValue.split(",")[1], 500), // 目标点经纬度和视角高度wwwwww
                                    duration: 3 // 动画持续时间(秒)
                                });
                                this.fenceplock = true
                            }
                        }
 
                    }, 1000);
                }
 
 
            },
 
 
            getFenceDatade(newValue) {
                if (Object.keys(newValue).length != 0) {
                    graphicLayerFence.clear()
 
                    addedFenceIds = new Set();
                    // if (this.fenceid == newValue.id) {
                    graphicLayerFenceBianJie.clear()
                    //}
 
                }
            },
            haversineDistance(lng1, lat1, lng2, lat2) {
 
 
 
                const R = 6371e3; // 地球半径,单位:米
                const φ1 = lat1 * (Math.PI / 180);
                const φ2 = lat2 * (Math.PI / 180);
                const Δφ = (lat2 - lat1) * (Math.PI / 180);
                const Δλ = (lng2 - lng1) * (Math.PI / 180);
 
                const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
                    Math.cos(φ1) * Math.cos(φ2) *
                    Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
                const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
 
                return R * c;
            },
            getFenceData(newValue) {
                if (Object.keys(newValue).length != 0) {
                    newValue.forEach((e, i) => {
                        if (e.isplay === '1') {
                            if (!addedFenceIds.has(e.id)) {
                                this.fenceids = e.id + "_fence"
                                // setTimeout(() => {
                                //5秒播放一次
                                // }, 1000);
                                let parts = e.points.split(';');
                                var part = []
                                var fence = []
                                var positions = []; // 存储所有点的经纬度
                                //所有经纬度点
                                for (var i = 0; i < parts.length; i++) {
 
                                    part = parts[i].split(',');
                                    if (part.length > 1) {
                                        var lng = parseFloat(part[0]);
                                        var lat = parseFloat(part[1]);
                                        positions.push({
                                            lng: lng,
                                            lat: lat
                                        });
                                    }
 
                                    // fence.push(part[0])
                                    // fence.push(part[1])
                                    // part.push('0')
 
                                    const graphic = new mars3d.graphic.BillboardEntity({
 
                                        position: [part[0], part[1], 0],
                                        // id: newValue[e].e,
                                        // model: {
                                        //     ...modelParam,
                                        // },
                                        style: {
                                            image: "static/img/ponit1.png",
                                            scale: 0.4,
                                            horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                            verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                                        }
                                        // attr: {
                                        //     online: newValue[e].online,
                                        //     lat: newValue[e].lat,
                                        //     lon: newValue[e].lon,
                                        //     ppower: newValue[e].power,
                                        //     // baoliu4: e.baoliu4,
                                        //     gpsstatus: newValue[e].gpsstatus,
                                        //     department: newValue[e].department,
                                        //     pname: newValue[e].name,
                                        //     // ptagid: newValue[e].id,。
                                        // }
                                    })
                                    graphicLayerFenceBianJie.addGraphic(graphic)
                                    // graphicLayer.addGraphic(label);
                                    // addedCarIds.add(e.id);
                                    // this.graphicLabelsids[newValue[e].id] = {
                                    //     graphic: graphic,
                                    //     // fence: fenceGraphic
                                    // };
                                    fence.push(part)
                                }
                                for (var k = 0; k < positions.length; k++) {
                                    var currentPoint = positions[k];
                                    var nextPoint = positions[(k + 1) % positions.length]; // 处理最后一个点和第一个点相连的情况
 
                                    var distance = this.haversineDistance(currentPoint.lng, currentPoint.lat,
                                        nextPoint
                                        .lng, nextPoint.lat);
                                    distance = parseFloat(distance.toFixed(2));
                                    var midLng = (currentPoint.lng + nextPoint.lng) / 2;
                                    var midLat = (currentPoint.lat + nextPoint.lat) / 2;
                                    // 创建一个 LabelEntity 来显示距离
                                    var labelGraphic = new mars3d.graphic.LabelEntity({
                                        position: new mars3d.LngLatPoint(midLng, midLat),
                                        style: {
                                            text: `${distance} m`,
                                            font_size: 14,
                                            font_weight: "bold",
                                            color: "#FFFFFF",
                                            backgroundColor: "#000000",
                                            visibleDepth: false,
 
                                            horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                            verticalOrigin: Cesium.VerticalOrigin.CENTER
                                        }
                                    });
                                    graphicLayerFenceBianJie.addGraphic(labelGraphic);
 
                                }
 
                                let colorFence = ""
                                let JuXingcolorFence = ""
                                if (e.type == "禁入区") {
                                    colorFence = "#F56D6E"
                                }
                                if (e.type == "工作区") {
                                    colorFence = "#3795DA"
 
                                }
                                if (e.type == "安全区") {
                                    colorFence = "#2BFB2E"
                                }
                                const fenceGraphic = new mars3d.graphic.PolygonPrimitive({
 
                                    positions: fence,
                                    style: {
                                        closure: true,
                                        color: colorFence,
                                        opacity: 0.5,
                                        diffHeight: e.height / 100,
                                        materialType: mars3d.MaterialType.LineFlow,
                                        label: {
                                            text: e.name,
                                            font_size: 18,
                                            outline: true,
                                            outlineColor: colorFence,
                                            color: "#ffffff",
                                            distanceDisplayCondition: true,
                                            distanceDisplayCondition_far: 500000,
                                            distanceDisplayCondition_near: 0,
                                        }
                                    },
                                    // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]],
                                    // style: {
                                    //     color: this.parseColor("#FF0000").withAlpha(0.3),
                                    //     outlineWidth: 2, // 边框粗细(像素)
                                    //     outline: true,
                                    //     outlineColor: this.parseColor("#b40000"),
                                    //     // diffHeight: newValue[e].height || 0,
                                    //     label: {
                                    //         text: e.name,
                                    //         font_size: 18,
                                    //         outline: true,
                                    //         outlineColor: "#C70708",
                                    //         color: "#ffffff",
                                    //         distanceDisplayCondition: true,
                                    //         distanceDisplayCondition_far: 500000,
                                    //         distanceDisplayCondition_near: 0
                                    //     }
                                    // },
                                    attr: {
                                        name: e.name,
                                        // ptagid: newValue[e].id,。
                                    }
                                });
                                graphicLayerFence.addGraphic(fenceGraphic);
                                addedFenceIds.add(e.id);
                                console
                                    .log(this.graphicFence);
                                this.graphicFence[this.fenceids] = {
                                    // graphic: graphic,
                                    fence: fenceGraphic
                                };
                            } else {
                                // if (addedFenceIds.has(e.id)) {
                                //     graphicLayer.removeGraphic(graphic);
                                //     delete this.graphicLabels[e.id]; // 删除引用
                                //     // delete this.labels[e.id];
                                //     addedFenceIds.delete(e.id);
                                //     // this.graphicLabels[e.anchorid] = {
                                //     //     graphic: graphic1
                                //     // };
                                // }
                            }
                        }
                    }) // 将传递过来的值赋值给points,这样就可以在视图层中使用
                } else {
                    addedFenceIds = new Set();
                }
            },
            parseColor(colorStr) {
                try {
                    if (Cesium.Color[colorStr.toUpperCase()]) {
                        return Cesium.Color[colorStr.toUpperCase()];
                    }
                    return Cesium.Color.fromCssColorString(colorStr);
                } catch (error) {
                    return Cesium.Color.WHITE;
                }
            },
 
            getDrwaData(newValue) {
                this.plist = []
                if (this.graphicFence[this.fenceid]) {
                    graphicLayer.removeGraphic(this.graphicFence[this.fenceid].fence);
                    delete this.graphicFence[this.fenceid];
                }
                if (Object.keys(newValue).length != 0) {
                    for (var e = newValue.length - 1; e < newValue.length; e++) {
                        this.fenceid = newValue[e].id
                        if (newValue[e - 1].lat != undefined && newValue[e].lat == newValue[e - 1].lat) {
                            console.log("数据重复===========》》》》》》》》", newValue[e].lat);
                        } else {
 
                            //     // 3. 闭合多边形
                            this.cartesianPoints.push(newValue[e]);
                            //         // [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]]
                            const fenceGraphic = new mars3d.graphic.PolygonPrimitive({
                                positions: this.cartesianPoints,
                                // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]],
                                style: {
                                    color: this.parseColor("#FF0000").withAlpha(0.3),
                                    outlineWidth: 2, // 边框粗细(像素)
                                    outline: true,
                                    outlineColor: this.parseColor("#b40000"),
                                    // diffHeight: newValue[e].height || 0,
                                }
                            });
                            graphicLayer.addGraphic(fenceGraphic);
                            this.graphicFence[newValue[e].id] = {
                                // graphic: graphic,
                                fence: fenceGraphic
                            };
                        }
                    }
                }
            },
            getPointData(newValue) {
 
                this.cartesianPoints = []
                // if (this.graphicFence[this.fenceid]) {
                //     graphicLayer.removeGraphic(this.graphicFence[this.fenceid].fence);
                //     delete this.graphicFence[this.fenceid];
                // }
                // if (this.graphicLabelsids[this.fenceid]) {
                //     graphicLayer.removeGraphic(this.graphicLabelsids[this.fenceid].graphic);
                //     delete this.graphicLabelsids[this.fenceid];
                // }
                if (graphicLayerFencedrwa != null) {
                    graphicLayerFencedrwa.clear()
                }
                if (Object.keys(newValue).length != 0) {
                    for (var e = 0; e < newValue.length; e++) {
                        this.fenceid = newValue[e].id
                        this.plist = []
                        this.plist.push(newValue[e].lat)
                        this.plist.push(newValue[e].lon)
                        // 3. 闭合多边形
                        this.cartesianPoints.push(this.plist);
                        // 自动闭合多边形
                        // [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]]
                        const fenceGraphic = new mars3d.graphic.PolygonPrimitive({
                            positions: this.cartesianPoints,
                            // id: newValue[e].id,
                            // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]],
                            style: {
                                color: this.parseColor("#FF0000").withAlpha(0.3),
                                outlineWidth: 2, // 边框粗细(像素)
                                outline: true,
                                outlineColor: this.parseColor("#b40000"),
                                diffHeight: newValue[e].height || 0,
                                // label: {
                                //   text: e.name,
                                //   font_size: 14,
                                //   color: Cesium.Color.WHITE,
                                //   distanceDisplayCondition: [0, 500000]
                                // }
                            }
                        });
 
                        // this.graphicFence[newValue[e].id] = {
                        //     // graphic: graphic,
                        //     fence: fenceGraphic
                        // };
                        graphicLayerFencedrwa.addGraphic(fenceGraphic);
                        //测试本地图片
                        // this.graphicids.push(newValue[e].id)
                        const graphic = new mars3d.graphic.BillboardEntity({
 
                            position: [newValue[e].lat, newValue[e].lon, 0],
                            id: newValue[e].e,
                            // model: {
                            //     ...modelParam,
                            // },
                            style: {
                                image: "static/img/ponit1.png",
                                scale: 0.4,
                                horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                            },
                            attr: {
                                online: newValue[e].online,
                                lat: newValue[e].lat,
                                lon: newValue[e].lon,
                                ppower: newValue[e].power,
                                // baoliu4: e.baoliu4,
                                gpsstatus: newValue[e].gpsstatus,
                                department: newValue[e].department,
                                pname: newValue[e].name,
                                // ptagid: newValue[e].id,。
                            }
                        })
                        graphicLayerFencedrwa.addGraphic(graphic)
                        // graphicLayer.addGraphic(label);
                        // addedCarIds.add(e.id);
                        // this.graphicLabelsids[newValue[e].id] = {
                        //     graphic: graphic,
                        //     // fence: fenceGraphic
                        // };
                    }
                } else {
                    console.log("清空绘制围栏");
                }
            },
            getData(newValue) {
                let modelParam = {
                    scale: 2,
                    url: "http://39.106.210.13:8888/hxzkuwb/view/Home/model/model/walk.gltf",
                    pitch: 0,
                    roll: 0,
                };
                if (Object.keys(newValue).length != 0) {
                    newValue.forEach((e, i) => {
                        if (e.online === '1') {
                            if (!addedCarIds.has(e.id)) {
                                // console.log("打印数据====》》》》》》》》》》");
                                //测试本地图片
                                let colorFence = ""
                                let JuXingcolorFence = ""
                                var img = "static/img/zuobiao3.png";
                                if (e.gpsstatus == 1) { //单点蓝色
                                    // var img = "static/img/zuobiao4.png";
                                    colorFence = "#00aaff"
                                }
                                if (e == 2 || e.gpsstatus == -1 || e.gpsstatus == 3) { //其他类型灰色
                                    // var img = "static/img/zuobiao1.png";
                                    colorFence = "rgba(0,0,0,0.5)"
                                }
                                if (e.gpsstatus == 4) { //高精度绿色
 
                                    colorFence = "#20D85C"
                                }
                                if (e.gpsstatus == 5) { //浮点黄色
                                    // var img = "static/img/zuobiao2.png";
                                    colorFence = "#ffff00"
                                }
                                // if (e.baoliu2.split(";").indexOf("1")<0) {
                                //     var img = "static/img/zuobiao7.png";
                                // }
                                if (e.baoliu2.split(";")[0] == 1) {
                                    var img = "static/img/zuobiao7.png";
                                } else if (e.baoliu2.split(";")[1] == 0) {
                                    var img = "static/img/zuobiao7.png";
                                } else if (e.baoliu2.split(";")[2] == 1) {
                                    var img = "static/img/zuobiao7.png";
                                }else
                                if (e.warnstatus == "1") {
                                    var img = "static/img/zuobiao6.png";
                                    // var img = "static/img/zuobiao2.png";
                                }
                                // if (e.baoliu19 == "车载") {
                                //     var img = 'static/img/car1.png'
                                // } else {
                                //     var img = 'static/img/person6.png'
                                // }
                                const graphic = new mars3d.graphic.BillboardEntity({
 
                                    position: [e.lat, e.lon, 0],
                                    id: e.id,
                                    // model: {
                                    //     ...modelParam,
                                    // },
                                    style: {
                                        // image: "static/img/person5.png",
                                        image: img,
                                        scale: "0.4",
                                        horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                        verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                                    },
                                    attr: {
                                        online: e.gpsstatus,
                                        type: e.type,
                                        baoliu1: e.baoliu1,
                                        rtcm: e.rtcm,
                                        encryption: e.encryption,
                                        power: e.power,
                                        height: e.height,
                                        gpsstatus: e.gpsstatus,
                                        pdepartment: e.department,
                                        personname: e.personname,
                                        tagid: e.tagid,
                                    }
                                })
                                const label = new mars3d.graphic.LabelEntity({
                                    position: graphic.position, // 标签的位置与图标位置相同
                                    style: {
                                        text: e.personname + " " + e.id, // 标签的文本内容为姓名和编号
                                        font: '10pt sans-serif', // 字体样式
                                        fillColor: "#000000", // 字体颜色
                                        outlineColor: colorFence, // 描边颜色,使文字更清晰
                                        outlineWidth: 2, // 描边宽度
                                        style: Cesium.LabelStyle.FILL_AND_OUTLINE, // 风格:填充和描边
                                        verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 文字在垂直方向的原点
                                        pixelOffset: new Cesium.Cartesian2(0, -
                                            30) // 文字偏移量,向下偏移10像素
                                    }
                                });
                                if (this.graphicLabels[e.id]) {
                                    graphicLayer.removeGraphic(this.graphicLabels[e.id].graphic);
                                    delete this.graphicLabels[e.id];
                                    // delete this.labels[car.id];
                                }
                                graphicLayer.addGraphic(graphic)
                                graphicLayer.addGraphic(label);
                                addedCarIds.add(e.id);
                                this.graphicLabels[e.id] = {
                                    graphic: graphic,
                                    label: label
                                };
                            }
                        } else {
                            if (addedCarIds.has(e.id)) {
                                let colorFence = ""
                                let JuXingcolorFence = ""
                                var img = "static/img/zuobiao3.png";
                                if (e.gpsstatus == 1) { //单点蓝色
                                    // var img = "static/img/zuobiao4.png";
                                    colorFence = "#00aaff"
                                }
                                if (e == 2 || e.gpsstatus == -1 || e.gpsstatus == 3) { //其他类型灰色
                                    // var img = "static/img/zuobiao1.png";
                                    colorFence = "rgba(0,0,0,0.5)"
                                }
                                if (e.gpsstatus == 4) { //高精度绿色
 
                                    colorFence = "#20D85C"
                                }
                                if (e.gpsstatus == 5) { //浮点黄色
                                    // var img = "static/img/zuobiao2.png";
                                    colorFence = "#ffff00"
                                }
 
 
                                if (this.isoffline == true) {
                                    const graphic1 = new mars3d.graphic.BillboardEntity({
                                        position: [e.lat, e.lon, 0],
                                        id: e.id,
                                        style: {
 
                                            image: img,
                                            scale: "0.4",
                                            horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
                                            verticalOrigin: Cesium.VerticalOrigin.BOTTOM
                                        },
                                        attr: {
                                            online: e.gpsstatus,
                                            type: e.type,
                                            baoliu1: e.baoliu1,
                                            rtcm: e.rtcm,
                                            encryption: e.encryption,
                                            power: e.power,
                                            height: e.height,
                                            gpsstatus: e.gpsstatus,
                                            pdepartment: e.department,
                                            personname: e.personname,
                                            tagid: e.tagid,
                                        }
                                    })
                                    graphicLayer.removeGraphic(this.graphicLabels[e.id].graphic);
                                    delete this.graphicLabels[e.id];
                                    graphicLayer.addGraphic(graphic1)
                                    this.graphicLabels[e.id] = {
                                        graphic: graphic1,
                                    };
                                } else {
                                    graphicLayer.removeGraphic(this.graphicLabels[e.id].graphic);
                                    graphicLayer.removeGraphic(this.graphicLabels[e.id].label);
                                    delete this.graphicLabels[e.id];
                                }
                                addedCarIds.delete(e.id);
                            }
                        }
                    }) // 将传递过来的值赋值给points,这样就可以在视图层中使用
                }
            },
            getgpsData(newValue) {
                let modelParam = {
                    scale: 2,
                    url: "http://39.106.210.13:8888/hxzkuwb/view/Home/model/model/walk.gltf",
                    pitch: 0,
                    roll: 0,
                };
                if (Object.keys(newValue).length != 0) {
                    var listALL = newValue;
                    if (graphicLayer != null) {
                        graphicLayer.eachGraphic((car) => {
                            // 取出对应车辆的轨迹列表
                            var path = listALL.filter((item) => {
                                return item.id === car.id
                            });
                            path.forEach((item) => {
                                var point = new mars3d.LngLatPoint(item.lat, item
                                    .lon, 0);
                                car.addDynamicPosition(point, item.addtiem);
                                const {
                                    oldgraphic,
                                    label
                                } = this.graphicLabels[item.id];
                                // 移除旧的图标实体
                                if (this.graphicLabels[car.id]) {
                                    graphicLayer.removeGraphic(car);
                                    graphicLayer.removeGraphic(label);
                                }
                                // item.baoliu2.split(";").indexOf(1)
 
                                if (item.online === '1') {
                                    var img = "static/img/zuobiao3.png";
                                    let colorFence = ""
                                    let JuXingcolorFence = ""
 
                                    if (item.gpsstatus == 1) { //单点蓝色
                                        // var img = "static/img/zuobiao4.png";
                                        colorFence = "#00aaff"
 
                                    }
                                    if (item == 2 || item.gpsstatus == -1 || item.gpsstatus ==
                                        3) { //其他类型灰色
                                        // var img = "static/img/zuobiao1.png";
                                        colorFence = "rgba(0,0,0,0.5)"
                                    }
                                    if (item.gpsstatus == 4) { //高精度绿色
                                        // var img = "static/img/zuobiao3.png";
                                        colorFence = "#20D85C"
                                    }
                                    if (item.gpsstatus == 5) { //浮点黄色
                                        // var img = "static/img/zuobiao2.png";
                                        colorFence = "#ffff00"
                                    }
                                    // console.log(22222222);
                                    // console.log(item.baoliu2);
                                    // console.log(item.baoliu2.split(";").indexOf("1"));
                                    // console.log(item.baoliu2.split(";").indexOf("1")>-1);
                                    // if (item.baoliu2.split(";").indexOf("1") < 0) {
                                    //     var img = "static/img/zuobiao7.png";
                                    //     // var img = "static/img/zuobiao2.png";
                                    // }
                                    if (item.baoliu2.split(";")[0] == 1) {
                                        var img = "static/img/zuobiao7.png";
                                    } else if (item.baoliu2.split(";")[1] == 0) {
                                        var img = "static/img/zuobiao7.png";
                                    } else if (item.baoliu2.split(";")[2] == 1) {
                                        var img = "static/img/zuobiao7.png";
                                    }else 
                                    if (item.warnstatus == "1") {
                                        var img = "static/img/zuobiao6.png";
                                        // var img = "static/img/zuobiao2.png";
                                    }
 
                                    // 创建新的图标实体
                                    const newGraphic = new mars3d.graphic.BillboardEntity({
                                        position: [item.lat, item.lon, 0],
                                        id: item.id,
                                        style: {
                                            // image: "static/img/person5.png",
                                            image: img,
                                            scale: "0.4",
                                            horizontalOrigin: Cesium.HorizontalOrigin
                                                .CENTER,
 
                                            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                                            // pixelOffset: new Cesium.Cartesian2(0, 10), // 向下偏移50像素
                                        },
                                        attr: {
                                            online: item.online,
                                            type: item.type,
                                            baoliu1: item.baoliu1,
                                            encryption: item.encryption,
                                            rtcm: item.rtcm,
                                            power: item.power,
                                            height: item.height,
                                            gpsstatus: item.gpsstatus,
                                            department: item.department,
                                            personname: item.personname,
                                            tagid: item.tagid,
                                        }
                                    })
                                    const newlabel = new mars3d.graphic.LabelEntity({
                                        position: point,
                                        style: {
                                            text: item.personname + " " + item.tagid,
                                            font: '10pt sans-serif',
                                            fillColor: "#000000",
                                            outlineColor: colorFence,
                                            outlineWidth: 2,
                                            style: Cesium.LabelStyle.FILL_AND_OUTLINE,
                                            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
                                            pixelOffset: new Cesium.Cartesian2(0, -30)
                                        }
                                    });
                                    // 添加标签到图层并存储引用
                                    graphicLayer.addGraphic(newlabel);
                                    // 添加新的图标实体到图层
                                    graphicLayer.addGraphic(newGraphic);
                                    this.graphicLabels[item.id] = {
                                        graphic: newGraphic,
                                        label: newlabel
                                    };
                                }
                            });
                        });
                    }
                }
            },
 
            //重写cesium接口
            rewriteCesiumSources(Cesium) {
                const loadImageElement_old = Cesium.Resource._Implementations.loadImageElement;
                Cesium.Resource._Implementations.loadImageElement = function(url, crossOrigin, deferred) {
                    // 修改本地file本地文件需要设置跨域(uniapp环境等)
                    if (url.startsWith('file')) {
                        crossOrigin = true;
                    }
                    if (!url.startsWith('http')) {
                        crossOrigin = true;
                    }
 
                    return loadImageElement_old(url, crossOrigin, deferred);
                };
 
                const contains_old = Cesium.TrustedServers.contains;
                Cesium.TrustedServers.contains = function(url) {
                    // 修改本地file本地文件需要设置跨域(uniapp环境等)
                    if (url.startsWith('file')) {
                        return false;
                    }
                    return contains_old.bind(this)(url);
                };
            },
 
            // 加载资源
            loadSource(loadQueen) {
                const stepOne = (resolve) => {
                    if (loadQueen.length) {
                        const dep = loadQueen.shift()
 
                        let loader
                        if (dep.endsWith(".css")) {
                            loader = this.loadLink(dep)
                        } else {
                            loader = this.loadScript(dep)
                        }
 
                        loader.then(() => {
                            stepOne(resolve)
                        })
                    } else {
                        resolve(true)
                    }
                }
 
                return new Promise((resolve) => {
                    stepOne(resolve)
                })
            },
 
            // 加载scrpit
            loadScript(src, async = true) {
                const $script = document.createElement("script")
                $script.async = async
                $script.src = src
                document.body.appendChild($script)
                return new Promise((resolve, reject) => {
                    $script.onload = () => {
                        resolve(true)
                    }
                })
            },
 
            // 加载scrpit
            loadLink(src) {
                const $link = document.createElement("link")
                $link.rel = "stylesheet"
                $link.href = src
                document.head.appendChild($link)
                return new Promise((resolve, reject) => {
                    $link.onload = () => {
                        resolve(true)
                    }
                })
            }
 
        }
    }
</script>
 
<style>
    .searchbg {
        width: '50%';
        left: '25%';
        position: 'absolute';
        z-index: 99999999;
    }
 
 
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
 
        height: 100%;
    }
</style>