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
<template>
  <div class="dailyreport">
    <div class="dailyBox">
      <div class="dailyTop">
        <el-select v-model="cityChoose" placeholder="请选择区域">
          <el-option
              v-for="item in cityOptions"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
        <el-select v-model="equipChoose1" placeholder="请选择设备">
          <el-option
              v-for="item in equipOptions1"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
        <el-date-picker
            v-model="value1"
            type="daterange"
            align="right"
            unlink-panels
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :picker-options="pickerOptions1">
        </el-date-picker>
        <el-select v-if="equipChoose1==='car'" v-model="carInput" clearable placeholder="请选择走航车" style="width: 180px;display: inline-block">
          <el-option
              v-for="(item,index) in carMac"
              :key="index"
              :label="item.name"
              :value="item.mac">
          </el-option>
        </el-select>
        <el-select v-else v-model="planSelect" clearable placeholder="请选择无人机" style="width: 180px;display: inline-block">
          <el-option
              v-for="(item,index) in carMac"
              :key="index"
              :label="item.name"
              :value="item.mac">
          </el-option>
        </el-select>
        <el-button type="primary" @click="selectExport" style="margin-right: 10px;">查询</el-button>
        <el-button type="primary" @click="upImgBtn" style="margin-left: 0">上传</el-button>
<!--        <el-button type="primary" @click="exportDom">下载demo</el-button>-->
      </div>
      <div class="dailyDown" style="overflow-y: auto">
        <el-card class="boxCard">
          <el-table
              :data="tableData"
              style="width: 100%;overflow-y: auto; height: 82%;">
            <el-table-column
                prop="name"
                label="报告名称"
            >
            </el-table-column>
            <el-table-column
                prop="time"
                label="提交时间"
            >
            </el-table-column>
            <el-table-column
                prop="date"
                label="创建时间"
            >
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button v-if="equipChoose1==='car'" type="text" size="medium" @click="expReport(scope.row)">下载</el-button>
                <el-button v-else type="text" size="medium" @click="exUAVReport(scope.row)">下载</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-card>
      </div>
    </div>
    <el-dialog title="上传图片" :visible.sync="openBox">
      <div class="openTop">
        <el-select v-model="cityChoose2" placeholder="请选择区域">
          <el-option
              v-for="item in cityOptions2"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
        <el-select v-model="equipChoose2" placeholder="请选择设备">
          <el-option
              v-for="item in equipOptions2"
              :key="item.value"
              :label="item.label"
              :value="item.value">
          </el-option>
        </el-select>
        <el-select v-if="equipChoose2==='car'" v-model="carInput2" clearable placeholder="请选择走航车" style="width: 180px;display: inline-block">
          <el-option
              v-for="(item, index) in carMac"
              :key="index"
              :label="item.name"
              :value="item.mac">
          </el-option>
        </el-select>
        <el-select v-else v-model="planSelect2" clearable placeholder="请选择无人机" style="width: 180px;display: inline-block">
          <el-option
              v-for="(item, index) in planMac"
              :key="index"
              :label="item.name"
              :value="item.mac">
          </el-option>
        </el-select>
        <el-input v-if="equipChoose2==='car'" v-model="areaInput3" placeholder="请输入走航区域" clearable style="width: 180px;display: inline-block"></el-input>
        <el-input v-else v-model="planInput2" placeholder="请输入飞行区域" clearable style="width: 180px;display: inline-block"></el-input>
        <el-button v-if="equipChoose2!=='car'" type="primary" @click="innerVisible = true">飞行监测</el-button>
        <div class="dateTimeBox" v-if="equipChoose2==='car'">
          <div>
            <el-date-picker
                v-model="value2"
                type="datetimerange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :picker-options="value2Pic"
                @change="value2Change">
            </el-date-picker>
            <el-button style="padding: 6px 8px;" @click="addDate('add')" :disabled="isDidAdd">+</el-button>
            <el-button style="padding: 6px 10px;" @click="addDate('minus')" :disabled="isDisMinus">-</el-button>
          </div>
          <div :style="{display:dateTime2}">
            <el-date-picker
                v-model="value3"
                type="datetimerange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :picker-options="value3Pic"
                @change="value3Change">
            </el-date-picker>
          </div>
          <div :style="{display:dateTime3}">
            <el-date-picker
                v-model="value4"
                type="datetimerange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                :picker-options="value4Pic"
                @change="value4Change">
            </el-date-picker>
          </div>
        </div>
        <div v-else>
          <el-date-picker
              v-model="planUpTime"
              type="date"
              placeholder="选择日期">
          </el-date-picker>
        </div>
      </div>
      <div v-if="equipChoose2==='car'" class="uploadDiv" style="width:90%;overflow: auto;display: flex;flex-wrap: wrap;justify-content: space-between">
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange1"
            :on-remove="handleRemove1"
            :file-list="fileList1"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传走航监测概况图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange2"
            :on-remove="handleRemove2"
            :file-list="fileList2"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传PM2.5走航监测图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange3"
            :on-remove="handleRemove3"
            :file-list="fileList3"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传PM10走航监测图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange4"
            :on-remove="handleRemove4"
            :file-list="fileList4"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传NO2走航监测图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange5"
            :on-remove="handleRemove5"
            :file-list="fileList5"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传CO走航监测图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange6"
            :on-remove="handleRemove6"
            :file-list="fileList6"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传SO2走航监测图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange7"
            :on-remove="handleRemove7"
            :file-list="fileList7"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传O3走航监测图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange8"
            :on-remove="handleRemove8"
            :file-list="fileList8"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传VOCs走航监测图片</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="upload"
            :on-change="handleChange9"
            :on-remove="handleRemove9"
            :file-list="fileList9"
            :limit="1"
            :on-exceed="handleExceed"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传小结图片</div>
        </el-upload>
      </div>
      <div v-else class="uploadDiv" style="width:90%;overflow: auto;display: flex;flex-wrap: wrap;justify-content: space-between">
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan1"
            :on-change="handleChangePlan1"
            :on-remove="handleRemovePlan1"
            :file-list="fileListPlan1"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传国控点位置及航拍图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan2"
            :on-change="handleChangePlan2"
            :on-remove="handleRemovePlan2"
            :file-list="fileListPlan2"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传国控点实时数值图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan3"
            :on-change="handleChangePlan3"
            :on-remove="handleRemovePlan3"
            :file-list="fileListPlan3"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传高值区域与国控点相对位置图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan4"
            :on-change="handleChangePlan4"
            :on-remove="handleRemovePlan4"
            :file-list="fileListPlan4"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传O3实时监测高值区域图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan5"
            :on-change="handleChangePlan5"
            :on-remove="handleRemovePlan5"
            :file-list="fileListPlan5"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传O3高值区现场航拍图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan6"
            :on-change="handleChangePlan6"
            :on-remove="handleRemovePlan6"
            :file-list="fileListPlan6"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传PM10实时监测高值区域图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan7"
            :on-change="handleChangePlan7"
            :on-remove="handleRemovePlan7"
            :file-list="fileListPlan7"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传PM10高值区现场航拍图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan8"
            :on-change="handleChangePlan8"
            :on-remove="handleRemovePlan8"
            :file-list="fileListPlan8"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传SO2实时监测高值区域图</div>
        </el-upload>
        <el-upload
            class="upload-demo"
            action=""
            ref="uploadPlan9"
            :on-change="handleChangePlan9"
            :on-remove="handleRemovePlan9"
            :file-list="fileListPlan9"
            multiple
            :auto-upload="false">
          <el-button slot="trigger" type="primary" size="small">选取图片</el-button>
          <div slot="tip" class="el-upload__tip">请上传SO2高值区现场航拍图</div>
        </el-upload>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="openBox = false">取 消</el-button>
        <el-button type="primary" @click="submitImgs" :disabled ="isDisplay">保 存</el-button>
      </div>
      <el-dialog
          class="innerDialog"
          width="70%"
          height="90%"
          margin-top="7vh"
          title="内层 Dialog"
          :visible.sync="innerVisible"
          append-to-body>
        <Map></Map>
      </el-dialog>
    </el-dialog>
  </div>
</template>
 
<script>
import { exportDocx } from '@/utils/exportImageFile'
import { exportUAVImage } from '@/utils/exportUAVImage'
import requestObj from '@/utils/request'
import Map from '@/components/PlanMap/Map'
export default {
  components: { Map },
  data() {
    return {
      cityChoose: 'gx', // 默认查询高新区走行车
      cityChoose2: 'gx', // 默认上传高新区图片
      cityOptions: [{
        value: 'gx',
        label: '高新区'
      }, {
        value: 'hn',
        label: '浑南区'
      }],
      cityOptions2: [{
        value: 'gx',
        label: '高新区'
      }, {
        value: 'hn',
        label: '浑南区'
      }],
      equipChoose1: 'car',
      equipChoose2: 'car',
      equipOptions1: [{
        value: 'car',
        label: '走航车'
      }, {
        value: 'plan',
        label: '无人机'
      }],
      equipOptions2: [{
        value: 'car',
        label: '走航车'
      }, {
        value: 'plan',
        label: '无人机'
      }],
      carInput2: '', // 上传时走航车唯一标识
      carMac: [], // 走航车mac数组
      carInput: '', // 查询时走航车唯一标识
      areaInput3: '', // 站点名称
      value1: [new Date(), new Date()], // 查询时时间段
      value2: [new Date(), new Date()], // 上传时间1
      value3: [], // 上传时间2
      value4: [], // 上传时间3
      planUpTime: new Date(), // 无人机上传时间
      pickerOptions1: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      pickerOptions: { // 快捷键
        disabledDate(time) {
          return time.getTime() > Date.now()
        },
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            picker.$emit('pick', new Date())
          }
        }, {
          text: '昨天',
          onClick(picker) {
            const date = new Date()
            date.setTime(date.getTime() - 3600 * 1000 * 24)
            picker.$emit('pick', date)
          }
        }, {
          text: '一周前',
          onClick(picker) {
            const date = new Date()
            date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', date)
          }
        }]
      },
      carMacArr: [{
        value: 'p5dnd7a0243624',
        label: '走航车名字'
      }, {
        value: 'p5dnd7a0243622',
        label: '走航车622'
      }, {
        value: 'p5dnd7a0243625',
        label: '走航车625'
      }],
      timeOne: '',
      timeTwo: '',
      timeThree: '',
      value2Pic: {
        onPick: ({ maxDate, minDate }) => {
          // 最大时间 最小时间
          this.timeOne = minDate.getTime() // 当选一个日期时 就是最小日期
          // 如何你选择了两个日期了,就把那个变量置空
          if (maxDate) this.timeOne = ''
        },
        disabledDate: time => {
          if (this.timeOne) {
            const WEEK = 3 * 24 * 3600 * 1000 - 1 // 这里乘以3再减去1相当于 限制3天以内
            const minTime = this.timeOne// 三天之前
            const maxTime = this.timeOne + WEEK // 三天之后
            return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date()
          } else {
            return time.getTime() > new Date()
          }
        }
      },
      value3Pic: {
        onPick: ({ maxDate, minDate }) => {
          // 最大时间 最小时间
          this.timeTwo = minDate.getTime() // 当选一个日期时 就是最小日期
          // 如何你选择了两个日期了,就把那个变量置空
          if (maxDate) this.timeTwo = ''
        },
        disabledDate: time => {
          if (this.timeTwo) {
            const WEEK = 3 * 24 * 3600 * 1000 - 1 // 这里乘以3再减去1相当于 限制3天以内
            const minTime = this.timeTwo// 三天之前
            const maxTime = this.timeTwo + WEEK // 三天之后
            return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date()
          } else {
            return time.getTime() > new Date()
          }
        }
      },
      value4Pic: {
        onPick: ({ maxDate, minDate }) => {
          // 最大时间 最小时间
          this.timeThree = minDate.getTime() // 当选一个日期时 就是最小日期
          // 如何你选择了两个日期了,就把那个变量置空
          if (maxDate) this.timeThree = ''
        },
        disabledDate: time => {
          if (this.timeThree) {
            const WEEK = 3 * 24 * 3600 * 1000 - 1 // 这里乘以3再减去1相当于 限制3天以内
            const minTime = this.timeThree// 三天之前
            const maxTime = this.timeThree + WEEK // 三天之后
            return time.getTime() < minTime || time.getTime() > maxTime || time.getTime() > new Date()
          } else {
            return time.getTime() > new Date()
          }
        }
      },
      selectTime: [],
      upTime: [],
      fileList1: [],
      fileList2: [],
      fileList3: [],
      fileList4: [],
      fileList5: [],
      fileList6: [],
      fileList7: [],
      fileList8: [],
      fileList9: [],
      fileLists: [[], [], [], [], [], [], [], [], []],
      sailingReport: {
        fileLists: [
          [], [], [], [], [], [], [], [], []
        ],
        index: 0,
        fileList: []
      },
      openBox: false, // 是否打开弹窗
      // tableData: []
      tableData: [],
      urlList: [],
      numList: [0, 0, 0, 0, 0, 0, 0, 0, 0],
      isDisplay: false,
      dateTime2: 'none',
      dateTime3: 'none',
      isDidAdd: false, // 是否禁用加
      isDisMinus: true, // 是否禁用减
      planSelect: '', // 无人机查询下拉框
      planSelect2: '', // 无人机上传选择框
      planMac: [], // 无人机数组
      planInput: '', // 无人机飞行区域查询
      planInput2: '', // 无人机飞行区域上传
      innerVisible: false, // 内部地图是否打开
      radioSeven: 'PM2.5',
      fileListPlan1: [],
      fileListPlan2: [],
      fileListPlan3: [],
      fileListPlan4: [],
      fileListPlan5: [],
      fileListPlan6: [],
      fileListPlan7: [],
      fileListPlan8: [],
      fileListPlan9: [],
      fileBase64Plan1: [],
      fileBase64Plan2: [],
      fileBase64Plan3: [],
      fileBase64Plan4: [],
      fileBase64Plan5: [],
      fileBase64Plan6: [],
      fileBase64Plan7: [],
      fileBase64Plan8: [],
      fileBase64Plan9: [],
      UAVReport: {
        fileLists: [],
      }, // 无人机报告
    }
  },
  watch: {
    value1(n, o) {
      if (n === null) {
        this.value1 = []
      }
    },
    value2(n, o) {
      if (n === null) {
        this.value2 = []
      }
    },
    value3(n, o) {
      if (n === null) {
        this.value3 = []
      }
    },
    value4(n, o) {
      if (n === null) {
        this.value4 = []
      }
    },
    equipChoose1(n, o) {
      if (n !== o) {
        this.tableData = []
      }
    },
    cityChoose(n, o) {
      if (n !== o) {
        this.tableData = []
      }
    },
    deep: true,
    immediate: true
  },
  created() {
    // 走航车数组
    this.$request({
      url: 'cruiser/selectCruisers',
      method: 'get'
    }).then(res => {
      this.carMac = res.data
      this.planMac = res.data // 无人机数组,暂用走航数据
    }).catch(err => {
      console.log(err)
    })
    // 无人机数组
    // this.$request({
    //   url: 'uav/getUavDaily',
    //   method: 'get'
    // }).then(res => {
    //   this.planMac = res.data
    // }).catch(err => {
    //   console.log(err)
    // })
  },
  methods: {
    // 模拟下载
    exportDom() {
      // const url1 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg`
      // const url2 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg`
      // const url3 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg`
      // const url4 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg`
      // this.UAVReport.fileLists[1] = [url1, url2]
      // this.UAVReport.fileLists[3] = [url3, url4, url3]
      const baseUrl = `${requestObj.baseUrl}/static/img/`
      var images = [['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], [], []]
      var info = 0
      var num = 0
      for (let i = 0; i < images.length; i++) {
        if (!this.UAVReport.fileLists[i]) this.UAVReport.fileLists[i] = []
        if (images[i].length) {
          num++
          info += images[i].length
          if (i === 0) this.UAVReport.num1 = images[i].length
          else if (i === 1) this.UAVReport.num2 = images[i].length
          else if (i === 2) this.UAVReport.num3 = images[i].length
          else if (i === 3) this.UAVReport.num4 = images[i].length
          else if (i === 4) this.UAVReport.num5 = images[i].length
          else if (i === 5) this.UAVReport.num6 = images[i].length
          else if (i === 6) this.UAVReport.num7 = images[i].length
          for (let j = 0; j < images[i].length; j++) {
            this.UAVReport.fileLists[i].push(baseUrl + images[i][j])
          }
        }
      }
      this.UAVReport.index = info
      this.UAVReport.num = num
      console.log(this.UAVReport, 'this.UAVReport')
      exportUAVImage('/UAVReport.docx', this.UAVReport, `模拟无人机报告.docx`)
    },
    // 查询走行车报告
    selectExport() {
      this.selectTime = this.newTime(this.value1)
      if (this.cityChoose && this.equipChoose1 && this.selectTime[1]) {
        // 判断无人机or走航车
        var mac = ''
        if (this.equipChoose1 === 'car') {
          mac = this.carInput
        } else {
          mac = this.planSelect
        }
        this.$request({
          url: '/cruiser/selectDaily',
          method: 'get',
          params: {
            code: this.cityChoose,
            type: this.equipChoose1,
            startTime: this.selectTime[0],
            endTime: this.selectTime[1],
            mac: mac
          }
        }).then(res => {
          this.carInput2 = this.carInput
          var info = res.data
          if (info.length === 0) {
            this.$message('暂无数据')
            this.tableData = info
            return
          }
          info.map(v => {
            var time = v.time.split('-').join('')
            if (this.cityChoose === 'gx') {
              v.name = `高新区走航监测报告${time}`
            } else {
              v.name = `浑南区走航监测报告${time}`
            }
          })
          info.sort((a, b) => { return b.time.split('-').join('') - a.time.split('-').join('') })
          this.tableData = info
        }).catch(err => {
          console.log(err)
        })
      } else {
        this.$message('参数缺失!')
      }
    },
    // 上传图片
    submitImgs() {
      if (this.equipChoose2 === 'car') { // 上传走航车图片
        this.tableData = []
        this.isDisplay = true
        this.numList = [this.fileLists[0].length, this.fileLists[1].length, this.fileLists[2].length, this.fileLists[3].length, this.fileLists[4].length, this.fileLists[5].length, this.fileLists[6].length, this.fileLists[7].length, this.fileLists[8].length]
        var num = 0
        this.numList.map(v => {
          if (v > 0) {
            num++
          }
        })
        if (this.cityChoose2 && this.value2.length === 2 && this.equipChoose2 && this.carInput2 && this.areaInput3 && this.isDisplay && (num === 0 || num === this.fileLists.length)) {
          this.upTime = this.newTime(this.value2, 'submit')
          const formData = new FormData()
          formData.append(`code`, this.cityChoose2)
          formData.append(`type`, this.equipChoose2)
          formData.append(`mac`, this.carInput2)
          formData.append(`area`, this.areaInput3)
          formData.append(`time1`, this.upTime[0])
          formData.append(`time2`, this.upTime[1])
          var upTime2 = []
          var upTime3 = []
          if (this.dateTime2 === 'block' && this.value3.length) { // 第二个日期时间控件
            upTime2 = this.newTime(this.value3, 'submit')
            formData.append(`time3`, upTime2[0])
            formData.append(`time4`, upTime2[1])
          }
          if (this.dateTime3 === 'block' && this.value4.length) { // 第三个日期时间控件
            upTime3 = this.newTime(this.value4, 'submit')
            formData.append(`time5`, upTime3[0])
            formData.append(`time6`, upTime3[1])
          }
          this.fileLists.map(v => {
            v.map(item => {
              formData.append(`files`, item.raw)
            })
          })
          // 弹框隐藏
          this.openBox = false
          this.MultipartFile(formData).then(res => {
            this.isDisplay = false
            if (res.code === 0) {
              this.$message({
                message: '提交成功!',
                type: 'success'
              })
              var s = new Date(res.data.time) // 标准时间转中国标准时间
              this.value1 = [s, s]
              this.carInput = this.carInput2
              this.equipChoose1 = this.equipChoose2
              this.cityChoose = this.cityChoose2
              var reportInfo = res.data
              if (this.cityChoose2 === 'gx') {
                reportInfo.name = '高新区走航监测报告' + reportInfo.time.split('-').join('')
              } else {
                reportInfo.name = '浑南区走航监测报告' + reportInfo.time.split('-').join('')
              }
              this.tableData = [reportInfo]
            } else if (res.code === -47) {
              this.$message(res.message)
            } else {
              this.$message.error('提交失败!')
            }
          }).catch(err => {
            console.log(err)
            this.isDisplay = false
          })
        } else {
          this.isDisplay = false
          this.$message('缺失参数!')
        }
      } else { // 上传无人机图片
        this.UAVUpImage()
      }
    },
    // 上传无人机图片
    async UAVUpImage() {
      var upObj = {}
      console.log('uav上传')
      this.tableData = []
      this.isDisplay = true
      if (this.cityChoose2 && this.equipChoose2 && this.planSelect2 && this.planInput2 && this.isDisplay) {
        this.upTime = this.OneDayNew(this.planUpTime)
        // 所有图片转base64
        await this.UAVAllImageToBase64()
        upObj.fileList1 = this.fileBase64Plan1
        upObj.fileList2 = this.fileBase64Plan2
        upObj.fileList3 = this.fileBase64Plan3
        upObj.fileList4 = this.fileBase64Plan4
        upObj.fileList5 = this.fileBase64Plan5
        upObj.fileList6 = this.fileBase64Plan6
        upObj.fileList7 = this.fileBase64Plan7
        upObj.fileList8 = this.fileBase64Plan8
        upObj.fileList9 = this.fileBase64Plan9
        upObj.code = this.cityChoose2
        upObj.type = this.equipChoose2
        upObj.mac = this.planSelect2
        upObj.area = this.planInput2
        upObj.time = this.upTime
        var objJson = JSON.stringify(upObj)
        console.log(objJson, 'objJson')
        // 弹框隐藏
        this.openBox = false
        this.$request({
          url: 'uav/getUavDaily',
          data: { objJson: objJson },
          method: 'post'
        }).then(res => {
          this.isDisplay = false
          if (res.code === 0) {
            this.$message({
              message: '提交成功!',
              type: 'success'
            })
            // console.log(res)
            // var s = new Date(res.data.time) // 标准时间转中国标准时间
            // this.value1 = [s, s]
            this.planSelect = this.planSelect2
            this.equipChoose1 = this.equipChoose2
            this.cityChoose = this.cityChoose2
            var reportInfo = res.data
            if (this.cityChoose === 'gx') {
              reportInfo.name = '高新区飞行监测报告' + reportInfo.time.split('-').join('')
            } else {
              reportInfo.name = '浑南区飞行监测报告' + reportInfo.time.split('-').join('')
            }
            this.tableData = [reportInfo]
          } else if (res.code === -47) {
            this.$message(res.message)
          } else {
            this.$message.error('提交失败!')
          }
        }).catch(err => {
          console.log(err)
          this.isDisplay = false
        })
      } else {
        this.isDisplay = false
        this.$message('缺失参数!')
      }
    },
    // 提交文件后台接口
    MultipartFile(data) {
      return this.$request({
        url: '/cruiser/getDaily',
        method: 'post',
        headers: { 'Content-Type': 'multipart/form-data' }, // 多文件上传这一句必须加
        data
      })
    },
    // 下载走航车报告
    expReport(obj) {
      this.$request({
        url: '/cruiser/loadDaily',
        method: 'get',
        params: {
          id: obj.id
        }
      }).then(res => {
        const baseUrl = `${requestObj.baseUrl}/static/img/`
        var imagesObj = res.data.images
        this.sailingReport = { ...this.sailingReport, ...res.data.code }
        // const url1 = `http://47.99.64.149:8081//static/img/7f633687-8321-4f89-bffc-9a52f94cfb77.jpg`
        if (imagesObj) {
          for (let i = 0; i < imagesObj.length; i++) {
            this.sailingReport.fileLists[i] = [{ url: baseUrl + imagesObj[i] }]
          }
        }
        this.sailingReport.index = imagesObj.length
        var data2 = obj.date.split('-')
        this.sailingReport.date2 = data2[0] + '年' + data2[1] + '月' + data2[2] + '日'
        var time = []
        for (let i = 0; i < res.data.code.time.length; i++) {
          time.push(res.data.code.time[i])
        }
        this.sailingReport.time0 = time[0]
        if (time.length === 2) {
          this.sailingReport.time1 = time[1]
        }
        if (time.length === 3) {
          this.sailingReport.time1 = time[1]
          this.sailingReport.time2 = time[2]
        }
        if (this.cityChoose === 'gx') {
          this.sailingReport.city = '高新区'
        } else {
          this.sailingReport.city = '浑南区'
        }
        exportDocx('/sailingReport.docx', this.sailingReport, `${obj.name}.docx`)
      }).catch(err => {
        console.log(err)
      })
    },
    // 下载无人机报告
    exUAVReport(obj) {
      this.$request({
        url: '',
        method: 'get',
        params: {
          id: obj.id
        }
      }).then(res => {
        const baseUrl = `${requestObj.baseUrl}/static/img/`
        var images = [['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], ['7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg', '7f633687-8321-4f89-bffc-9a52f94cfb77.jpg'], [], [], [], [], [], [], [], [], [], [], [], [], []]
        var info = 0
        var num = 0
        for (let i = 0; i < images.length; i++) {
          if (!this.UAVReport.fileLists[i]) this.UAVReport.fileLists[i] = []
          if (images[i].length) {
            num++
            info += images[i].length
            if (i === 0) this.UAVReport.num1 = images[i].length
            else if (i === 1) this.UAVReport.num2 = images[i].length
            else if (i === 2) this.UAVReport.num3 = images[i].length
            else if (i === 3) this.UAVReport.num4 = images[i].length
            else if (i === 4) this.UAVReport.num5 = images[i].length
            else if (i === 5) this.UAVReport.num6 = images[i].length
            else if (i === 6) this.UAVReport.num7 = images[i].length
            else if (i === 7) this.UAVReport.num8 = images[i].length
            else if (i === 8) this.UAVReport.num9 = images[i].length
            else if (i === 9) this.UAVReport.num10 = images[i].length
            else if (i === 10) this.UAVReport.num11 = images[i].length
            else if (i === 11) this.UAVReport.num12 = images[i].length
            else if (i === 12) this.UAVReport.num13 = images[i].length
            else if (i === 13) this.UAVReport.num14 = images[i].length
            else if (i === 14) this.UAVReport.num15 = images[i].length
            else if (i === 15) this.UAVReport.num16 = images[i].length
            else if (i === 16) this.UAVReport.num17 = images[i].length
            for (let j = 0; j < images[i].length; j++) {
              this.UAVReport.fileLists[i].push(baseUrl + images[i][j])
            }
          }
        }
        this.UAVReport.index = info
        this.UAVReport.num = num
        var data2 = obj.date.split('-')
        this.UAVReport.date2 = data2[0] + '年' + data2[1] + '月' + data2[2] + '日'
        var time = []
        for (let i = 0; i < res.data.code.time.length; i++) {
          time.push(res.data.code.time[i])
        }
        this.UAVReport.time0 = time[0]
        if (time.length === 2) {
          this.UAVReport.time1 = time[1]
        }
        if (time.length === 3) {
          this.UAVReport.time1 = time[1]
          this.UAVReport.time2 = time[2]
        }
        if (this.cityChoose === 'gx') {
          this.UAVReport.city = '高新区'
        } else {
          this.UAVReport.city = '浑南区'
        }
        exportUAVImage('/UAVReport.docx', this.UAVReport, `${obj.name}.docx`)
      }).catch(err => {
        console.log(err)
      })
    },
    // 上传按钮
    upImgBtn() {
      this.openBox = true
      this.isDisplay = false
    },
    // 添加或删除一个时间控件
    addDate(name) {
      if (name === 'add') { // 加
        if (this.dateTime2 === 'none') { // 调出dateTime2
          this.dateTime2 = 'block'
          this.value3 = [new Date(), new Date()]
          this.isDisMinus = false
        } else if (this.dateTime2 === 'block' && this.dateTime3 === 'none') { // 调出dateTime3
          this.dateTime3 = 'block'
          this.value4 = [new Date(), new Date()]
          this.isDidAdd = true
        } else { // dateTime2和dateTime3都已出现
          this.isDidAdd = true
        }
      } else { // 减
        if (this.dateTime3 === 'block') {
          this.dateTime3 = 'none'
          this.isDidAdd = false
          this.value4 = []
        } else if (this.dateTime3 === 'none' && this.dateTime2 === 'block') {
          this.value3 = []
          this.dateTime2 = 'none'
          this.isDisMinus = true
        } else { // dateTime2和dateTime3都已经隐藏
          this.isDisMinus = true
          this.isDidAdd = false
        }
      }
    },
    // value2改变判断是否有value3和value4
    value2Change(e) {
      var time2 = []
      var time3 = []
      var time4 = []
      if (this.value2 !== null) {
        if (this.value3.length && this.value4.length) { // value3和value4都存在
          for (let i = 0; i < 2; i++) {
            time2.push(e[i].getTime())
            time3.push(this.value3[i].getTime())
            time4.push(this.value4[i].getTime())
          }
          if (!(time2[0] > time4[1] || time2[1] < time4[0]) || !(time2[0] > time3[1] || time2[1] < time3[0])) { // 不合格
            this.value2 = []
            this.$message('请选择没有重叠的时间段')
          }
        } else if (this.value3.length) { // 只有value3存在
          for (let i = 0; i < 2; i++) {
            time3.push(this.value3[i].getTime())
            time2.push(e[i].getTime())
          }
          if (!(time2[0] > time3[1] || time2[1] < time3[0])) { // 不合格
            this.value2 = []
            this.$message('请选择没有重叠的时间段')
          }
        } else if (this.value4.length) { // 只有value3存在
          for (let i = 0; i < 2; i++) {
            time4.push(this.value4[i].getTime())
            time2.push(e[i].getTime())
          }
          if (!(time2[0] > time4[1] || time2[1] < time4[0])) { // 不合格
            this.value2 = []
            this.$message('请选择没有重叠的时间段')
          }
        }
      }
    },
    // value3改变时判断是否在value2区间内,前提:value2存在
    value3Change(e) {
      if (this.value3 !== null) {
        if (this.value2.length) {
          var time2 = []
          var time3 = []
          for (let i = 0; i < 2; i++) {
            time3.push(e[i].getTime())
            time2.push(this.value2[i].getTime())
          }
          if (!(time3[0] > time2[1] || time3[1] < time2[0])) { // 不合格
            this.value3 = []
            this.$message('请选择没有重叠的时间段')
          }
        } else {
          this.value3 = []
          this.$message('请先选择第一段时间')
        }
      }
    },
    // value4改变时判断是否在value2和value3区间内
    value4Change(e) {
      if (this.value4 !== null) {
        if (this.value2.length && this.value3.length) {
          var time2 = []
          var time3 = []
          var time4 = []
          for (let i = 0; i < 2; i++) {
            time2.push(this.value2[i].getTime())
            time3.push(this.value3[i].getTime())
            time4.push(this.value4[i].getTime())
          }
          if (!(time4[0] > time2[1] || time4[1] < time2[0]) || !(time4[0] > time3[1] || time4[1] < time3[0])) { // 不合格
            this.value4 = []
            this.$message('请选择没有重叠的时间段')
          }
        } else {
          this.value4 = []
          this.$message('请先选择第一、二段时间')
        }
      }
    },
    // 时间处理函数(日期带0)
    newTime(timeArr, name) {
      var arr = []
      if (name === 'submit') {
        timeArr.map(v => {
          var date = new Date(v)
          var y = date.getFullYear()
          var m = date.getMonth() + 1
          m = m < 10 ? '0' + m : m
          var d = date.getDate()
          d = d < 10 ? '0' + d : d
          var h = date.getHours()
          h = h < 10 ? '0' + h : h
          var minute = date.getMinutes()
          minute = minute < 10 ? '0' + minute : minute
          var s = date.getSeconds()
          s = s < 10 ? '0' + s : s
          arr.push(y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + s)
        })
        return arr
      } else {
        timeArr.map(v => {
          var date = new Date(v)
          var y = date.getFullYear()
          var m = date.getMonth() + 1
          m = m < 10 ? '0' + m : m
          var d = date.getDate()
          d = d < 10 ? '0' + d : d
          arr.push(y + '-' + m + '-' + d)
        })
        return arr
      }
    },
    // 时间处理函数,日期是单个
    OneDayNew(time) {
      var date = new Date(time)
      var y = date.getFullYear()
      var m = date.getMonth() + 1
      m = m < 10 ? '0' + m : m
      var d = date.getDate()
      d = d < 10 ? '0' + d : d
      return y + '-' + m + '-' + d
    },
    // 无人机所有图片转base64
    async UAVAllImageToBase64() {
      if (this.fileListPlan1.length > 0) {
        for (let i = 0; i < this.fileListPlan1.length; i++) {
          var p = this.getBase64(this.fileListPlan1[i].raw)
          await p.then(res => {
            this.fileBase64Plan1[i] = res
          })
        }
        // this.fileListPlan1 = fileListPlan1
      }
      if (this.fileListPlan2.length > 0) {
        for (let i = 0; i < this.fileListPlan2.length; i++) {
          var p = this.getBase64(this.fileListPlan2[i].raw)
          await p.then(res => {
            this.fileBase64Plan2[i] = res
          })
        }
      }
      if (this.fileListPlan3.length > 0) {
        for (let i = 0; i < this.fileListPlan3.length; i++) {
          var p = this.getBase64(this.fileListPlan3[i].raw)
          await p.then(res => {
            this.fileBase64Plan3[i] = res
          })
        }
      }
      if (this.fileListPlan4.length > 0) {
        for (let i = 0; i < this.fileListPlan4.length; i++) {
          var p = this.getBase64(this.fileListPlan4[i].raw)
          await p.then(res => {
            this.fileBase64Plan4[i] = res
          })
        }
      }
      if (this.fileListPlan5.length > 0) {
        for (let i = 0; i < this.fileListPlan5.length; i++) {
          var p = this.getBase64(this.fileListPlan5[i].raw)
          await p.then(res => {
            this.fileBase64Plan5[i] = res
          })
        }
      }
      if (this.fileListPlan6.length > 0) {
        for (let i = 0; i < this.fileListPlan6.length; i++) {
          var p = this.getBase64(this.fileListPlan6[i].raw)
          await p.then(res => {
            this.fileBase64Plan6[i] = res
          })
        }
      }
      if (this.fileListPlan7.length > 0) {
        for (let i = 0; i < this.fileListPlan7.length; i++) {
          var p = this.getBase64(this.fileListPlan7[i].raw)
          await p.then(res => {
            this.fileBase64Plan7[i] = res
          })
        }
      }
      if (this.fileListPlan8.length > 0) {
        for (let i = 0; i < this.fileListPlan8.length; i++) {
          var p = this.getBase64(this.fileListPlan8[i].raw)
          await p.then(res => {
            this.fileBase64Plan8[i] = res
          })
        }
      }
      if (this.fileListPlan9.length > 0) {
        for (let i = 0; i < this.fileListPlan9.length; i++) {
          var p = this.getBase64(this.fileListPlan9[i].raw)
          await p.then(res => {
            this.fileBase64Plan9[i] = res
          })
        }
      }
    },
    // 图片转base64函数
    getBase64(file) {
      // console.log(file)
      return new Promise(function(resolve, reject) {
        var reader = new FileReader()
        let imgResult = ''
        reader.readAsDataURL(file)
        reader.onload = function() {
          imgResult = reader.result
        }
        reader.onerror = function(error) {
          reject(error)
        }
        reader.onloadend = function() {
          resolve(imgResult)
        }
      })
    },
    // 无人机图片上传
    handleChangePlan1(file, fileList) {
      // console.log(file, fileList)
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan1 = fileList
    },
    handleRemovePlan1(file, fileList) {
      this.fileListPlan1 = fileList
    },
    handleChangePlan2(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan2 = fileList
    },
    handleRemovePlan2(file, fileList) {
      this.fileListPlan2 = fileList
    },
    handleChangePlan3(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan3 = fileList
    },
    handleRemovePlan3(file, fileList) {
      this.fileListPlan3 = fileList
    },
    handleChangePlan4(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan4 = fileList
    },
    handleRemovePlan4(file, fileList) {
      this.fileListPlan4 = fileList
    },
    handleChangePlan5(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan5 = fileList
    },
    handleRemovePlan5(file, fileList) {
      this.fileListPlan5 = fileList
    },
    handleChangePlan6(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan6 = fileList
    },
    handleRemovePlan6(file, fileList) {
      this.fileListPlan6 = fileList
    },
    handleChangePlan7(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan7 = fileList
    },
    handleRemovePlan7(file, fileList) {
      this.fileListPlan7 = fileList
    },
    handleChangePlan8(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan8 = fileList
    },
    handleRemovePlan8(file, fileList) {
      this.fileListPlan8 = fileList
    },
    handleChangePlan9(file, fileList) {
      if (file.raw.type !== 'image/jpeg' && file.raw.type !== 'image/png') {
        this.$refs.uploadPlan1.handleRemove(file)
        this.$message.warning(`上传文件格式不符合`)
        return
      }
      this.fileListPlan9 = fileList
    },
    handleRemovePlan9(file, fileList) {
      this.fileListPlan9 = fileList
    },
    // 限制一天
    handleExceed(files, fileList) {
      this.$message.warning(`当前限制选择 1 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`)
    },
    // 走航车上传文件到upload
    handleChange1(file, fileList) {
      // console.log(file, fileList)
      this.fileList1 = fileList
      this.fileLists[0] = fileList
    },
    handleRemove1(file, fileList) {
      this.fileList1 = fileList
      this.fileLists[0] = fileList
    },
    handleChange2(file, fileList) {
      this.fileList2 = fileList
      this.fileLists[1] = fileList
    },
    handleRemove2(file, fileList) {
      this.fileList2 = fileList
      this.fileLists[1] = fileList
    },
    handleChange3(file, fileList) {
      this.fileList3 = fileList
      this.fileLists[2] = fileList
    },
    handleRemove3(file, fileList) {
      this.fileList3 = fileList
      this.fileLists[2] = fileList
    },
    handleChange4(file, fileList) {
      this.fileList4 = fileList
      this.fileLists[3] = fileList
    },
    handleRemove4(file, fileList) {
      this.fileList4 = fileList
      this.fileLists[3] = fileList
    },
    handleChange5(file, fileList) {
      this.fileList5 = fileList
      this.fileLists[4] = fileList
    },
    handleRemove5(file, fileList) {
      this.fileList5 = fileList
      this.fileLists[4] = fileList
    },
    handleChange6(file, fileList) {
      this.fileList6 = fileList
      this.fileLists[5] = fileList
    },
    handleRemove6(file, fileList) {
      this.fileList6 = fileList
      this.fileLists[5] = fileList
    },
    handleChange7(file, fileList) {
      this.fileList7 = fileList
      this.fileLists[6] = fileList
    },
    handleRemove7(file, fileList) {
      this.fileList7 = fileList
      this.fileLists[6] = fileList
    },
    handleChange8(file, fileList) {
      this.fileList8 = fileList
      this.fileLists[7] = fileList
    },
    handleRemove8(file, fileList) {
      this.fileList8 = fileList
      this.fileLists[7] = fileList
    },
    handleChange9(file, fileList) {
      this.fileList9 = fileList
      this.fileLists[8] = fileList
    },
    handleRemove9(file, fileList) {
      this.fileList9 = fileList
      this.fileLists[8] = fileList
    }
  }
}
</script>
 
<style scoped>
.dailyreport{
  width: 100%;
  height: 100%;
  overflow: auto;
}
.dailyreport::-webkit-scrollbar{
  width: 0;
}
.dailyTop{
  width: 80%;
  margin:auto;
  padding: 1%;
  margin-bottom: 3%;
}
.dailyDown{
  width: 100%;
  height: 74%;
  overflow: auto;
  display: flex;
  /*background-color: salmon;*/
  justify-content: center;
}
.boxCard{
  width: 80%;
  height: 96%;
  overflow: auto;
}
.upload-demo{
  /*width: 20rem;*/
  /*height: 16rem;*/
  width: 260px;
  height: 155px;
  /*float: left;*/
  /*margin: 1% 2%;*/
  /*overflow: auto;*/
}
.upload-demo p{
  padding: 0.15rem 0;
  margin: 0;
}
.dailyTop>div{
  margin-right: 1%;
}
/*/deep/ .el-upload{*/
/*  width: 100%;*/
/*}*/
/*/deep/ .el-upload-dragger{*/
/*  width: 100%;*/
/*  height: 140px;*/
/*}*/
/deep/ .el-upload-list{
  height: 94px;
  overflow: auto;
}
/deep/ .el-upload-list::-webkit-scrollbar{
  width: 4px;
  background-color: #FFFFFF;
}
/*定义滑块 样式*/
 
/deep/ .el-upload-list::-webkit-scrollbar-thumb {
  border-radius: 3px;
  background-color: #ccc;
}
.el-upload-dragger .el-icon-upload{
  font-size: 50px;
  margin: 10px 0;
  line-height: 1;
}
.btnPosition{
  position: absolute;
  right: 12px;
  bottom: 5px;
}
.btnPosition{
  padding: 8px 16px;
}
.divPosition{
  position: relative;
  margin: 1%;
  padding: 1%;
  float: left;
  border: 1px solid #dfdfdf;
}
.dailyBox{
  width: 90%;
  height: 100%;
  margin: auto;
}
/deep/ .el-dialog{
  width: 60%;
  height: 80%;
  overflow: auto;
}
.el-upload__tip{
  color: red;
}
/deep/ .el-dialog__footer{
  padding: 10px 40px 20px;
}
/deep/ .el-dialog__body{
  padding-top: 0px;
}
.openTop{
  padding-bottom: 15px;
}
.openTop>div{
  margin-right: 15px;
  margin-bottom: 15px;
}
.dateTimeBox>div{
  margin-bottom: 10px;
}
.innerDialog /deep/ .el-dialog__body{
  height: 90%;
}
</style>