无人机管理后台前端(已迁走)
张含笑
2025-09-01 2ca94de8ede18ac07ccfd8dec7b6f6a707adde9b
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
<template>
  <basic-main-content>
    <avue-crud :option="option" :table-loading="loading" :data="data" v-model:page="page" ref="crud" @row-del="rowDel"
      v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen"
      @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange"
      @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"
      @tree-load="treeLoad">
      <template #menu-left>
        <el-button type="danger" icon="el-icon-delete" plain v-if="permission.device_delete" @click="handleDelete">删 除
        </el-button>
      </template>
      <template #dept_name="{ row }">
        <el-tag>{{ row.dept_name }}</el-tag>
      </template>
      <template #status="{ row }">
        <div v-if="row.status == true" class="onlineStatus">
          <div class="onlineStatus-dot"></div>
          <span class="online">在线</span>
        </div>
        <div v-if="row.status == false" class="onlineStatus">
          <div class="onlineStatus-dot1"></div>
          <span class="online">离线</span>
        </div>
      </template>
      <template #firmware_status="{ row }">
        <div v-if="row.firmware_status == 1" class="onlineStatus1">
          <el-tag type="info">无需升级</el-tag>
          <el-tag type="primary" effect="dark" class="active-element" @click="rollFirmware(row)">版本管理</el-tag>
          <!-- <div style="background-color: #f1f1f1; border-radius: 4px">无需升级</div> -->
        </div>
        <div v-if="row.firmware_status == 2" class="onlineStatus1">
          <!-- <el-tag type="success" effect="dark" class="active-element" @click="updateFirmware(row)"
            >升级固件</el-tag
          > -->
          <el-tag type="primary" effect="dark" class="active-element" @click="rollFirmware(row)">版本管理</el-tag>
          <!-- <div @click="updateFirmware(row)" class="firmware_status">升级固件</div> -->
        </div>
        <div v-if="row.firmware_status == 3" class="onlineStatus">
          <el-tag type="success" effect="dark" class="active-element" @click="updateFirmware(row)">一致性升级</el-tag>
          <!-- <div @click="updateFirmware(row)" class="firmware_status">一致性升级</div> -->
        </div>
        <div v-if="row.firmware_status == 4" class="onlineStatus">
          <el-tag effect="dark" class="active-element" @click="updateFirmware(row)">升级中</el-tag>
          <el-progress v-if="row.firmware_progress > 0 && row.firmware_progress < 100"
            :percentage="row.firmware_progress"></el-progress>
        </div>
      </template>
      <template #domain="{ row }">
        <span class="text">
          {{ row.domain == 3 ? '机巢' : row.domain == 0 ? '无人机' : '其他' }}
        </span>
      </template>
      <template #mode_code="{ row }">
        <span class="text" v-if="row.domain == 3 || row.domain == 0" :style="row.mode_code != '-1' ? 'color: #00ee8b' : 'color: #de5e5e'">
          {{ getModelText(row.mode_code) }}
        </span>
      </template>
      <template #menu="scope">
        <el-dropdown>
              <el-button type="primary" text icon="el-icon-more" v-if="permission.oss_set">更 多</el-button>
              <template #dropdown v-if="scope.row.domain == 3">
                <el-dropdown-menu teleported>
                  <el-dropdown-item command="a">
                    <el-button type="primary" text icon="el-icon-paperclip" v-if="permission.oss_set" @click.stop="handleOpenOssSet(scope.row, scope.index)">存储配置</el-button>
                  </el-dropdown-item>
                  <el-dropdown-item command="b">
                    <el-button type="primary" text icon="el-icon-share" v-if="permission.per_share && scope.row.domain == 3"
                      @click.stop="handleOpenDevicePerShare(scope.row, scope.index)">机场授权</el-button>
                  </el-dropdown-item>
                  <el-dropdown-item command="c"> <el-button type="primary" text icon="el-icon-position" :disabled="!scope.row.status"
                    v-if="permission.rang_con && scope.row.domain == 3"
                    @click.stop="handleOpenRemoteDebugging(scope.row, scope.index)">远程调试</el-button>
                  </el-dropdown-item>
                  <el-dropdown-item command="d"><el-button type="primary" text icon="el-icon-collection" v-if="permission.fly_device_offline"
                        @click.stop="rollFirmware(scope.row)">固件版本管理</el-button>
                  </el-dropdown-item>
                  <el-dropdown-item command="e"><el-button type="primary" text icon="el-icon-document-delete" v-if="permission.fly_device_offline"
                    @click.stop="handleDeviceOffline(scope.row)">注销</el-button>
                  </el-dropdown-item>
                </el-dropdown-menu>
              </template>
              <template #dropdown v-else>
                <el-dropdown-menu teleported>
                  <el-dropdown-item command="a">
                    <el-button type="primary" text icon="el-icon-circle-close" @click.stop="rowDel(scope.row, scope.index)">删除</el-button>
                  </el-dropdown-item>
                  <el-dropdown-item command="a">
                    <el-button type="primary" text icon="el-icon-key" v-if="permission.operate_password_set" @click.stop="handleOperatePassword(scope.row, scope.index)">操控密码设置</el-button>
                  </el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
      </template>
      
      <!-- 添加行政区划显示模板 -->
      <template #area_code="{ row }">
        <span>{{ row.area_name }}</span>
      </template>
    </avue-crud>
 
    <el-dialog title="操控密码设置" append-to-body v-model="operatePasswordSetBox" width="450px">
      <el-form :model="passwordForm" ref="passwordForm" label-width="80px" :rules="rules" v-loading="loadingForm">
        <el-form-item label="密码" prop="password">
          <el-input type="password" v-model="passwordForm.password" placeholder="请输入密码" show-password></el-input>
        </el-form-item>
        <el-form-item label="确认密码" prop="password2">
          <el-input type="password" v-model="passwordForm.password2" placeholder="请输入确认密码" show-password></el-input>
        </el-form-item>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="operatePasswordSetBox = false">取 消</el-button>
          <el-button type="primary" @click="setOperatePasswordConfirm">确 定</el-button>
        </span>
      </template>
    </el-dialog>
 
    <el-dialog title="操控密码查看" append-to-body v-model="operatePasswordViewBox" width="455px">
      <el-input v-model="operate_password" disabled></el-input>
    </el-dialog>
 
    <el-dialog title="固件升级" append-to-body v-model="firmwareBox" width="455px">
      <div>升级固件版本:{{ firmwareVersion }}</div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="firmwareBox = false">取 消</el-button>
          <el-button type="primary" @click="updateFirmwareConfirm">确 定</el-button>
        </span>
      </template>
    </el-dialog>
 
    <el-dialog title="存储配置" append-to-body v-model="ossSetBox" @close="handleOssSetClose" width="600px">
      <div class="onlineStatus">
        存储对象配置:
        <el-select v-model="ossEnd" clearable placeholder="请选择存储对象" style="width: 450px">
          <el-option v-for="item in ossList" :key="item.id" :label="item.name + ': ' + item.endpoint" :value="item.id">
            <span style="float: left">{{ item.name + ': ' + item.endpoint }}</span>
            <span v-if="item.status == 1" class="status1">{{ item.categoryName }}</span>
            <span v-if="item.status == 2" class="status2">{{ item.categoryName }}</span>
          </el-option>
        </el-select>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="cancelOssSet">取 消</el-button>
          <el-button type="danger" @click="cancelOssSetConfirm">取消配置</el-button>
          <el-button type="primary" @click="ossSetConfirm">配置</el-button>
        </span>
      </template>
    </el-dialog>
 
    <el-dialog title="固件版本管理" append-to-body v-model="rollFirmwareBox" width="455px">
      <div class="onlineStatus">
        固件版本升级/回退:
        <el-select v-model="rollFirmVersion" clearable placeholder="请选择固件版本" style="width: 240px">
          <el-option v-for="item in firmList" :key="item.firmware_version" :label="item.firmware_version"
            :value="item.firmware_version" />
        </el-select>
      </div>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="rollFirmwareBox = false">取 消</el-button>
          <el-button type="primary" @click="rollFirmwareConfirm">确 定</el-button>
        </span>
      </template>
    </el-dialog>
 
    <el-drawer class="ztzf-drawer-body-basic-container" title="机场授权管理" size="60%" append-to-body
      v-model="devicePerShareVisible" :direction="'rtl'">
      <DevicePerShare ref="devicePerShare" />
    </el-drawer>
 
    <el-drawer :title="operateTitle" append-to-body v-model="remoteDebuggingShow" size="40%">
      <DockControlPanel v-if="remoteDebuggingShow" :sn="curDeviceInfo.device_sn" :deviceInfo="curDeviceInfo">
      </DockControlPanel>
    </el-drawer>
  </basic-main-content>
</template>
 
<script>
import { ElMessage, ElMessageBox } from 'element-plus'
import { pxToRem } from '@/utils/rem'
import {
  getList,
  remove,
  update,
  add,
  getDetail,
  getDeviceUpgradeInfo,
  ota,
  getDeviceFirmwareList,
  getDevices,
  deviceOffline
} from '@/api/device/device'
import { deleteByOssId, addOrUpdate as addOrUpdateOssBind } from '@/api/device/ossBind'
import { getListPage as getOssList } from '@/api/resource/oss'
import { getLazyTree } from '@/api/base/region'
import { EDockModeText, EDockModeCode } from '@/types/device'
import { mapGetters } from 'vuex'
import FirmwareManage from './components/firmwareManage.vue'
import DevicePerShare from './components/devicePerShare.vue'
import DockControlPanel from './components/DockControlPanel.vue'
import { getWebsocketUrl } from '@/utils/websocket/config';
import ConnectWebSocket from '@/utils/websocket';
export default {
  components: {
    FirmwareManage,
    DevicePerShare,
    DockControlPanel,
  },
  data () {
    const validatePass = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请输入密码'))
      } else {
        callback()
      }
    }
    const validatePass2 = (rule, value, callback) => {
      if (value === '') {
        callback(new Error('请再次输入密码'))
      } else if (value !== this.passwordForm.password) {
        callback(new Error('两次输入密码不一致!'))
      } else {
        callback()
      }
    }
    return {
      rules: {
        password: [{ required: true, validator: validatePass, trigger: 'blur' }],
        password2: [{ required: true, validator: validatePass2, trigger: 'blur' }],
      },
      passwordForm: {
        id: '',
        password: '',
        password2: '',
      },
      operatePasswordSetBox: false,
      operatePasswordViewBox: false,
      operate_password: '',
      bindOssId: null,
      deviceSn: '',
      ossSetBox: false,
      ossList: [],
      ossEnd: '',
      operateTitle: '',
      rollFirmVersion: '',
      firmList: [],
      rollFirmwareBox: false,
      // 用于记录已经创建的websocket,防止重复创建
      webSocketIdSet: new Set(),
      // 用于保存多组websocket
      websocketMap: new Map(),
      scheduleNum: 0,
      webSocket: '',
      devicePerShareVisible: false,
      remoteDebuggingShow: false,
      curDeviceInfo: {},
      firmwareManageVisible: false,
      percentageNum: 0,
      firmwareBox: false,
      firmwareInfo: {},
      form: {},
      query: {},
      firmwareVersion: '',
      loading: true,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      selectionList: [],
      option: {
        lazy: true,
        tree: true,
 
        dialogWidth: 1050,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        viewBtn: true,
        delBtn: false,
        selection: true,
        excelBtn: false,
        addBtn: false,
        dialogClickModal: false,
        grid: false,
 
        height: 'auto',
        calcHeight: 180,
 
        column: [
          {
            label: '设备类型',
            prop: 'domain',
            editDisabled: true,
            editDisplay: false, //编辑显示
            viewDisplay: true, //查看显示
            search: false,
            slot: true,
            searchSpan: 4,
            labelWidth: 130,
            width: 120,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入设备类型',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '设备型号',
            prop: 'device_name',
            editDisabled: true,
            viewDisplay: true, //查看显示
            search: false,
            searchSpan: 4,
            labelWidth: 130,
            width: 120,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入设备型号',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '设备SN',
            prop: 'device_sn',
            labelWidth: 130,
            width: 120,
            overHidden: true,
            searchSpan: 4,
            editDisabled: true,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入设备SN',
            //     trigger: 'blur',
            //   },
            // ],
          },
          // {
          //   label: '机巢编号',
          //   prop: 'machine_nest_sn',
          //   labelWidth: 130,
          //   editDisabled: true,
          //   rules: [
          //     {
          //       required: false,
          //       message: '请输入机巢编号',
          //       trigger: 'blur',
          //     },
          //   ],
          // },
          {
            label: '设备名称',
            prop: 'nickname',
            labelWidth: 130,
            width: 100,
            searchSpan: 4,
            search: true,
            overHidden: true,
            editDisplay: true, //编辑显示
            rules: [
              {
                required: true,
                message: '请输入设备名称',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '设备位置',// '行政区划',
            prop: 'area_name',
            // hide: true,
            overHidden: true,
            editDisplay: false, //编辑显示
            viewDisplay: false, //查看显示
            labelWidth: 130,
            width: 100,
          },
          {
            label: '设备位置',
            prop: 'area_code',
            type: 'cascader',
            labelWidth: 130,
            searchSpan: 4,
            hide: true,
            search: true,
            // overHidden: true,
            editDisplay: true,
            viewDisplay: true,
            props: {
              label: 'title',
              value: 'value',
              emitPath: false,
              checkStrictly: true,
              multiple: false,
              expandTrigger: 'hover',
            },
            dataType: 'string',
            rules: [
              {
                required: true,
                message: '请选择设备位置',
                trigger: 'change',
              },
            ],
            lazy: true,
            lazyLoad (node, resolve) {
              let level = node.level
              let list = []
              let callback = () => {
                resolve(
                  (list || []).map(ele => ({
                    ...ele,
                    value: ele.value,
                    leaf: level >= 2,
                  }))
                )
              }
 
              if (level === 0) {
                getLazyTree('000000000000').then(res => {
                  list = res.data.data
                  callback()
                })
              } else if (level === 1) {
                getLazyTree(node.value).then(res => {
                  list = res.data.data
                  callback()
                })
              } else if (level === 2) {
                getLazyTree(node.value).then(res => {
                  list = res.data.data
                  callback()
                })
              } else {
                callback()
              }
            },
          },
          // {
          //   label: '设备位置',
          //   prop: 'address',
          //   labelWidth: 130,
          //   width: 100,
          //   overHidden: true,
          //   rules: [
          //     {
          //       required: true,
          //       message: '请输入设备位置',
          //       trigger: 'blur',
          //     },
          //   ],
          // },
          
          {
            label: '负载设备',
            prop: 'payload_str',
            labelWidth: 130,
            width: 100,
            overHidden: true,
            editDisabled: true,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入负载设备',
            //     trigger: 'blur',
            //   },
            // ],
          },
          // {
          //   label: '保险有效期',
          //   prop: 'insureExpiredTime',
          //   labelWidth: 130,
          //   width: 110,
          //   rules: [
          //     {
          //       required: true,
          //       message: '请输入保险有效期',
          //       trigger: 'blur',
          //     },
          //   ],
          // },
          {
            label: '流量剩余',
            prop: 'traffic_remaining',
            labelWidth: 130,
            width: 100,
            editDisabled: true,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入流量剩余',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '流量到期时间',
            prop: 'traffic_expire_time',
            labelWidth: 130,
            width: 120,
            type: 'date',
            format: 'YYYY-MM-DD',
            editDisabled: true,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入流量到期时间',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '固件版本',
            prop: 'firmware_version',
            labelWidth: 130,
            width: 110,
            editDisabled: true,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入固件版本',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '固件升级',
            prop: 'firmware_status',
            labelWidth: 130,
            width: 100,
            hide: true,
            viewDisabled: true,
            addDisabled: true,
            editDisabled: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入固件升级',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '所属单位',
            prop: 'dept_name',
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            labelWidth: 130,
            width: 180,
            rules: [
              {
                required: true,
                message: '请输入所属单位',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '所属单位',
            prop: 'dept_id',
            hide: true,
            type: 'tree',
            defaultExpandAll: true,
            search: true,
            searchSpan: 4,
            labelWidth: 130,
            dicUrl: '/blade-system/dept/getTree',
            props: {
              label: 'name',
              value: 'id',
            },
            rules: [
              {
                required: true,
                message: '请输入所属单位',
                trigger: 'blur',
              },
            ],
          },
          // {
          //   label: '加入组织时间',
          //   prop: 'bound_time',
          //   addDisplay: false,
          //   editDisplay: false,
          //   type: 'date',
          //   labelWidth: 130,
          //   width: 160,
          //   format: 'YYYY-MM-DD HH:mm:ss',
          //   // valueFormat: 'YYYY-MM-DD HH:mm:ss',
          //   rules: [
          //     {
          //       required: true,
          //       message: '请输入在线状态',
          //       trigger: 'blur',
          //     },
          //   ],
          // },
          
 
          {
            hide: true,
            label: '保险有效期',
            prop: 'duration_of_insurance',
            labelWidth: 130,
            type: 'daterange',
            format: 'YYYY-MM-DD',
            valueFormat: 'YYYY-MM-DD HH:mm:ss',
            startPlaceholder: '保险开始日期',
            endPlaceholder: '保险结束日期',
            rules: [
              {
                required: true,
                message: '请选择保险有效期',
                trigger: 'blur',
              },
            ],
          },
 
          {
            label: '在线时间',
            prop: 'login_time',
            type: 'date',
            editDisplay: true, //编辑显示
            editDisabled: true,
            viewDisplay: true, //查看显示
            addDisplay: true,
            labelWidth: 130,
            width: 160,
            overHidden: true,
            format: 'YYYY-MM-DD HH:mm:ss',
            // valueFormat: 'YYYY-MM-DD HH:mm:ss',
            startPlaceholder: '任务开始时间',
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入在线时间',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '注册时间',
            prop: 'create_time',
            type: 'date',
            editDisplay: true, //编辑显示
            editDisabled: true,
            viewDisplay: true, //查看显示
            addDisplay: true,
            overHidden: true,
            labelWidth: 130,
            width: 160,
            format: 'YYYY-MM-DD HH:mm:ss',
            // valueFormat: 'YYYY-MM-DD HH:mm:ss',
            startPlaceholder: '创建时间',
            // rules: [
            //   {
            //     required: true,
            //     message: '请输入创建时间',
            //     trigger: 'blur',
            //   },
            // ],
          },
          {
            label: '设备状态',
            prop: 'cnstatus',
            hide: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            labelWidth: 130,
          },
          {
            label: '设备状态',
            prop: 'status',
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            labelWidth: 100,
            hide: true,
            // searchSpan: 4,
            // search: true,
            slot: true,
            width: 100,
 
            rules: [
              {
                required: true,
                message: '请输入在线状态',
                trigger: 'blur',
              },
            ],
          },
          {
            label: '设备状态',
            prop: 'cnmode_code',
            hide: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: true,
            labelWidth: 130,
            width: 110,
          },
          {
            label: '设备状态',
            prop: 'mode_code',
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            labelWidth: 130,
            searchSpan: 4,
            search: true,
            type: 'select',
            dicData: [
              { label: '在线', value: 0 },
              { label: '离线', value: -1 },
              { label: '远程调试', value: 2 },
              { label: '现场调试', value: 1 },
              { label: '固件升级中', value: 3 }
            ],
            slot: true,
            width: 110,
 
            rules: [
              {
                required: true,
                message: '请输入机场状态',
                trigger: 'blur',
              },
            ],
          },
        ],
      },
      data: [],
      DeviceFirmwareTypeEnum: {
        // 普通升级
        ToUpgraded: 3,
        // 一致性升级
        ConsistencyUpgrade: 2,
      },
      DeviceFirmwareStatusEnum: {
        None: 1, // 无需升级
        ToUpgraded: 2, // 待升级
        ConsistencyUpgrade: 3, // 一致性升级
        DuringUpgrade: 4, // 升级中
      },
    }
  },
  computed: {
    ...mapGetters(['permission']),
    permissionList () {
      return {
        addBtn: this.validData(this.permission.air_add, true),
        viewBtn: this.validData(this.permission.air_view, true),
        delBtn: this.validData(this.permission.air_delete, true),
        editBtn: this.validData(this.permission.air_edit, true),
      }
    },
    ids () {
      let ids = []
      this.selectionList.forEach(ele => {
        ids.push(ele.id)
      })
      return ids.join(',')
    },
  },
  destroyed () {
    this.websocketMap.forEach((k, v) => {
      if (null != v) {
        v.close()
        this.websocketMap.delete(k)
        this.webSocketIdSet.delete(k)
      }
    })
  },
  mounted() {
 
  },
  methods: {
    getDockModeText (value) {
      return EDockModeText[value] || ''
    },
    getModelText (value) {
      let txt = '离线'
      if (value === 0 || value === 4) {
        txt = '在线'
      } else if(value === 1) {
        txt = '现场调试'
      } else if(value === 2) {
        txt = '远程调试'
      } else if(value === 3) {
        txt = '固件升级中'
      }
      return txt
    },
    // 关闭所有的webscoket
    closeAllWebsoket () {
      this.websocketMap.forEach((k, v) => {
        if (null != v) {
          v.close()
          this.websocketMap.delete(k)
          this.webSocketIdSet.delete(k)
        }
      })
    },
    // 连接webSocket
    connectWebSocket (data) {
      const webSocketId = data.workspace_id
      if (!this.webSocketIdSet.has(webSocketId)) {
        // 防止重复连接
        this.webSocketIdSet.add(webSocketId)
        const webSorketUrl = getWebsocketUrl() + '&workspace-id=' + data.workspace_id
        // 监听ws 消息
        this.useConnectWebSocket1(webSocketId, webSorketUrl)
      }
    },
    useConnectWebSocket1 (webSocketId, url) {
      const websocket = new ConnectWebSocket(url)
      // 加入 webscoket map
      this.websocketMap.set(webSocketId, websocket)
      websocket?.registerMessageHandler(this.messageHandler)
      websocket?.initSocket()
    },
    async messageHandler (payload) {
      if (!payload) {
        return
      }
      if (payload.biz_code != 'ota_progress') {
        return
      }
      var data = payload.data
      this.data.forEach(e => {
        if (e.device_sn == data.sn && data.output.status == 'in_progress') {
          e.firmware_progress = data.output.progress.percent
        }
 
        if (e.device_sn == data.sn && data.output.status == 'ok') {
          // 升级完成修改状态
          e.firmware_status = 1
          const webscoket = this.websocketMap.get(e.workspace_id)
          // 关闭
          webscoket?.close()
          //删除对应的webscoket
          this.websocketMap.delete(e.workspace_id)
          this.webSocketIdSet.delete(e.workspace_id)
        }
      })
    },
    init () {
      (this.page = {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      }),
        this.onLoad(this.page)
    },
    // 打开权限分享页面
    handleOpenDevicePerShare (row) {
      var that = this
      this.devicePerShareVisible = true
      this.$nextTick(() => {
        that.$refs.devicePerShare.init(row)
      })
    },
    // 打开远程调试
    handleOpenRemoteDebugging (row) {
      this.curDeviceInfo = row
      this.remoteDebuggingShow = true
      this.operateTitle = row.nickname + ' - ' + row.device_sn
    },
 
    // 设备下线
    handleDeviceOffline (row) {
      ElMessageBox.confirm('确定注销该设备吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          deviceOffline(row.device_sn)
            .then(res => {
              ElMessage.success('注销成功')
 
              this.init()
            })
            .catch(error => {
              ElMessage.error('注销失败')
            })
        })
        .catch(() => { })
    },
 
    // 打开存储对象配置页面
    handleOpenOssSet (row) {
      var that = this
      this.deviceSn = row.device_sn
      this.ossSetBox = true
      this.bindOssId = row.oss_id
      this.ossEnd = row.oss_id
      // 查询下拉列表
      const param = {
        categoryKeys: '1,3,6',
      }
      getOssList(1, 50, param).then(res => {
        const data = res.data.data
        that.ossList = data.records
      })
    },
    // 打开固件管理页面
    handleOpenFirmwarm (row) {
      var that = this
      this.firmwareManageVisible = true
      this.$nextTick(() => {
        that.$refs.firmwareManage.init(row)
      })
    },
    // 版本回退点击事件
    rollFirmware (row) {
      if (row.status == 0) {
        this.$message({
          type: 'warning',
          message: '设备不在线!',
        })
        return
      }
      // 如果是机场,查询飞机对应的信息
      if (row.domain === 3) {
        // 查询子设备名称
        getDevices(row.workspace_id, row.child_sn).then(res => {
          const data = res.data.data
          that.firmwareInfo['child_device_name'] = data.device_name
          that.firmwareInfo['child_version'] = data.firmware_version
          that.firmwareInfo['child_status'] = data.status
        })
      }
      var that = this
      this.rollFirmwareBox = true
      const param = {
        device_name: row.device_name,
      }
      // 获取固件最新版本信息
      getDeviceFirmwareList(1, 20, param).then(res => {
        that.firmList = []
        const data = res.data.data.records
        if (data.length === 0) {
          return
        }
        data.forEach(e => {
          if (e.firmware_version != row.firmware_version) {
            that.firmList.push(e)
          }
        })
        that.firmwareInfo['device_name'] = row.device_name
        that.firmwareInfo['sn'] = row.device_sn
        // 3-普通升级,2-一致性升级;
        that.firmwareInfo['firmware_upgrade_type'] = 3
        that.firmwareInfo['workspaceId'] = row.workspace_id
        that.firmwareInfo['firmware_version'] = row.firmware_version
        that.firmwareInfo['status'] = row.status
        // domain 0:飞机  3:机场
        that.firmwareInfo['domain'] = row.domain
        that.firmwareInfo['child_sn'] = row.child_sn
        that.firmwareInfo['now_version'] = row.firmware_version
      })
    },
    // 比较版本大小
    compare (version1, version2) {
      let arr1 = version1.split('.')
      let arr2 = version2.split('.')
      let length = Math.max(arr1.length, arr2.length)
      for (let i = 0; i < length; i++) {
        const n1 = Number(arr1[i] || 0)
        const n2 = Number(arr2[i] || 0)
        // version1 > version2 返回1,如果 version1 < version2 返回-1,不然返回0
        if (n1 > n2) return 1
        if (n1 < n2) return -1
      }
      return 0
    },
    // 版本回退
    rollFirmwareConfirm () {
      // 无人机升级/回滚
      if (this.rollFirmVersion == '') {
        this.$message({
          type: 'warning',
          message: '请先选择回退的固件版本!',
        })
        return
      }
      var that = this
      var arr = []
      that.firmwareInfo['product_version'] = this.rollFirmVersion
      // 机场信息设置
      arr.push(that.firmwareInfo)
      // 判断是机场升级还是飞机升级,如果是机场升级则把无人机信息一起带过去
      if (that.firmwareInfo.domain === 3) {
        // 判断当前机场和无人机固件版本是否一致
        var dockFlag = this.compare(
          this.firmwareInfo.firmware_version,
          this.firmwareInfo.child_version
        )
        // 机场和无人机版本一致情况
        if (dockFlag == 0) {
          if (!this.firmwareInfo.status || !this.firmwareInfo.child_status) {
            this.$message({
              type: 'warning',
              message: '请先更新无人机固件版本后再进行机场固件版本更新!',
            })
            return
          }
          // 只有同时在线并且是升级才能操作
          // 判断升级还是降级,不能降级
          var upDownFlag = this.compare(this.rollFirmVersion, this.firmwareInfo.firmware_version)
          if (upDownFlag == -1) {
            this.$message({
              type: 'warning',
              message: '请先回滚无人机固件版本后再进行机场固件版本更新!',
            })
            return
          }
          // 同时升级操作
          // 无人机信息设置
          arr.push({
            device_name: that.firmwareInfo.child_device_name,
            sn: that.firmwareInfo.child_sn,
            product_version: this.rollFirmVersion,
            firmware_upgrade_type: 3,
          })
        } else {
          // 版本不一致情况
          // 比对需要改变的版本号和无人机版本号是否一致,不一致提示不能操作
          var verFlag = this.compare(this.rollFirmVersion, this.firmwareInfo.child_version)
          if (verFlag == -1 || verFlag == 1) {
            this.$message({
              type: 'warning',
              message: '更新版本与当前无人机固件版本不一致,请更新和无人机一致的版本!',
            })
            return
          }
          // 需要改变的版本号和无人机版本号如果是一致,进行单独的机场升级/回滚操作
        }
      }
      ota(that.firmwareInfo.workspaceId, arr).then(res => {
        that.firmwareVersion = ''
        that.firmwareInfo = {}
        that.rollFirmwareBox = false
        this.$message({
          type: 'success',
          message: '操作成功!',
        })
        this.onLoad(this.page)
        done()
      })
    },
    // 升级固件按钮事件
    updateFirmware (row) {
      if (row.status == 0) {
        this.$message({
          type: 'warning',
          message: '设备不在线!',
        })
        return
      }
      var that = this
      this.firmwareBox = true
      const param = {
        device_name: row.device_name,
      }
      // 获取固件最新版本信息
      getDeviceUpgradeInfo(param).then(res => {
        const data = res.data.data
        if (data.length === 0) {
          return
        }
        that.firmwareVersion = data[0].product_version
        that.firmwareInfo['device_name'] = row.device_name
        that.firmwareInfo['sn'] = row.device_sn
        that.firmwareInfo['product_version'] = data[0].product_version
        // 3-普通升级,2-一致性升级;
        that.firmwareInfo['firmware_upgrade_type'] =
          row.firmware_status === that.DeviceFirmwareStatusEnum.ToUpgraded
            ? that.DeviceFirmwareTypeEnum.ToUpgraded
            : that.DeviceFirmwareTypeEnum.ConsistencyUpgrade
        that.firmwareInfo['workspaceId'] = row.workspace_id
      })
    },
    // 确定升级固件版本
    updateFirmwareConfirm () {
      var that = this
      var arr = []
      arr.push(that.firmwareInfo)
      ota(that.firmwareInfo.workspaceId, arr).then(res => {
        that.firmwareVersion = ''
        that.firmwareInfo = {}
        that.firmwareBox = false
        this.$message({
          type: 'success',
          message: '操作成功!',
        })
        this.onLoad(this.page)
        done()
      })
    },
    handleOssSetClose () {
      this.ossEnd = ''
      this.deviceSn = ''
      this.bindOssId = null
    },
    // 存储对象配置确定
    ossSetConfirm () {
      var that = this
      // 判断是否已选择
      if (!this.ossEnd) {
        this.$message({
          type: 'warning',
          message: '请选择对于的存储对象!',
        })
        return
      }
      // 新增或者修改操作
      const data = {
        oss_id: this.ossEnd,
        sn: this.deviceSn,
      }
      // 新增
      addOrUpdateOssBind(data).then(res => {
        this.$message({
          type: 'success',
          message: '操作成功!',
        })
        that.ossSetBox = false
        this.onLoad(this.page)
        done()
      })
    },
    // 取消配置
    cancelOssSetConfirm () {
      var that = this
      // 判断是否已有配置
      if (!this.bindOssId) {
        this.$message({
          type: 'warning',
          message: '当前机场尚未配置存储对象信息!',
        })
        return
      }
      deleteByOssId(this.bindOssId).then(() => {
        that.ossSetBox = false
        this.onLoad(this.page)
        this.$message({
          type: 'success',
          message: '操作成功!',
        })
      })
    },
    // 取消按钮 oss
    cancelOssSet () {
      this.ossEnd = ''
      this.deviceSn = ''
      this.bindOssId = null
      this.ossSetBox = false
    },
    rowSave (row, done, loading) {
      let areaCode = row.area_code
      if (Array.isArray(areaCode)) {
        areaCode = areaCode[areaCode.length - 1]
      } else if (typeof areaCode === 'string' && areaCode.includes(',')) {
        const codes = areaCode.split(',')
        areaCode = codes[codes.length - 1]
      }
      row.area_code = areaCode || null
 
      add(row).then(
        () => {
          this.onLoad(this.page)
          this.$message({
            type: 'success',
            message: '操作成功!',
          })
          done()
        },
        error => {
          window.console.log(error)
          loading()
        }
      )
    },
    rowUpdate (row, index, done, loading) {
      const submitData = {
        ...row,
        area_code: row.area_code.split(',').pop(),
        insure_start_time: row.duration_of_insurance[0],
        insure_expired_time: row.duration_of_insurance[1],
      }
 
      delete submitData.duration_of_insurance
 
      update(submitData).then(
        () => {
          this.onLoad(this.page)
          this.$message({
            type: 'success',
            message: '操作成功!',
          })
          done()
        },
        error => {
          window.console.log(error)
          loading()
        }
      )
    },
    rowDel (row) {
      this.$confirm('确定将选择数据删除?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page)
          this.$message({
            type: 'success',
            message: '操作成功!',
          })
        })
    },
    searchReset () {
      this.query = {}
      this.onLoad(this.page)
    },
    searchChange (params, done) {
      this.query = params
      this.page.currentPage = 1
      this.onLoad(this.page, params)
      done()
    },
    selectionChange (list) {
      this.selectionList = list
    },
    selectionClear () {
      this.selectionList = []
      this.$refs.crud.toggleSelection()
    },
    handleDelete () {
      if (this.selectionList.length === 0) {
        this.$message.warning('请选择至少一条数据')
        return
      }
      this.$confirm('确定将选择数据删除?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          return remove(this.ids)
        })
        .then(() => {
          this.onLoad(this.page)
          this.$message({
            type: 'success',
            message: '操作成功!',
          })
          this.$refs.crud.toggleSelection()
        })
    },
    async getFullAreaCode (areaCode) {
      if (!areaCode) return ''
 
      const code = areaCode.toString()
 
      if (code.includes(',')) return code
 
      if (code.endsWith('0000000000')) {
        return code
      } else if (code.endsWith('00000000') && !code.endsWith('0000000000')) {
        const provinceCode = code.substring(0, 2) + '0000000000'
        return `${provinceCode},${code}`
      } else {
        const provinceCode = code.substring(0, 2) + '0000000000'
        const cityCode = code.substring(0, 4) + '00000000'
        return `${provinceCode},${cityCode},${code}`
      }
    },
    beforeOpen (done, type) {
      if (['edit', 'view'].includes(type)) {
        getDetail(this.form.id).then(async res => {
          const data = res.data.data
 
          this.form = {
            ...data,
            area_code: await this.getFullAreaCode(data.area_code),
            area_name: this.form.area_name,
            cnmode_code: this.getDockModeText(this.form.mode_code),
            domain: data.domain === 0 ? '无人机' : data.domain === 3 ? '机巢' : '未知',
            cnstatus: this.form.status === false ? '离线' : '在线',
            duration_of_insurance: [data?.insure_start_time || '', data?.insure_expired_time || ''],
          }
 
          done()
        })
      }
    },
    currentChange (currentPage) {
      this.page.currentPage = currentPage
    },
    sizeChange (pageSize) {
      this.page.pageSize = pageSize
    },
    refreshChange () {
      this.onLoad(this.page, this.query)
    },
    onLoad (page, params = {}) {
      // this.closeAllWebsoket();
      const { releaseTimeRange } = this.query
      let values = {
        ...params,
        ...this.query,
      }
      if (releaseTimeRange) {
        values = {
          ...values,
          releaseTime_datege: releaseTimeRange[0],
          releaseTime_datelt: releaseTimeRange[1],
        }
        values.releaseTimeRange = null
      }
      values['type'] = 1
      this.loading = true
      getList(page.currentPage, page.pageSize, values).then(res => {
        const data = res.data.data
        this.page.total = data.total
        data.records.forEach(e => {
          e['hasChildren'] = e.has_children
          if (e.firmware_status == 4) {
            this.connectWebSocket(e)
          }
        })
        this.data = data.records
        this.loading = false
        this.selectionClear()
      })
    },
    treeLoad (tree, treeNode, resolve) {
      var params = {
        childSn: tree.child_sn,
      }
      getList(1, 10, params).then(res => {
        const data = res.data.data.records
        resolve(data)
      })
    },
    rowDel (row) {
      this.$confirm('确定将选择数据删除?', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
      })
        .then(() => {
          return remove(row.id)
        })
        .then(() => {
          this.onLoad(this.page)
          this.$message({
            type: 'success',
            message: '操作成功!',
          })
        })
    },
    // 设置无人机操作密码
    setOperatePasswordConfirm () {
      var that = this
      this.$refs.passwordForm.validate(valid => {
        if (valid) {
          this.loadingForm = true
          const data = {
            id: this.passwordForm.id,
            operate_password: this.passwordForm.password,
          }
          // 提交
          operatePasswordUpdate(data).then(res => {
            this.loadingForm = false
            this.operatePasswordSetBox = false
            that.passwordForm = {}
            this.onLoad(this.page)
            this.$message({
              type: 'success',
              message: '操作成功!',
            })
          })
        } else {
          console.log('error submit!!')
          return false
        }
      })
    },
    // 操作密码设置
    handleOperatePassword (row) {
      this.operatePasswordSetBox = true
      this.passwordForm.id = row.id
    },
  },
}
</script>
 
<style lang="scss" scoped>
.status2 {
  float: right;
  color: #40cb8b;
  font-size: 13px;
}
 
.status1 {
  float: right;
  color: #8492a6;
  font-size: 13px;
}
 
.online {
  margin-left: 5px;
}
 
.onlineStatus1 {
  display: flex;
  flex-direction: column;
  align-items: center;
}
 
.onlineStatus {
  display: flex;
  flex-direction: row;
  align-items: center;
}
 
.onlineStatus-dot {
  width: 15px;
  height: 15px;
  background-color: #40cb8b;
  border-radius: 50%;
}
 
.onlineStatus-dot1 {
  width: 15px;
  height: 15px;
  background-color: #de5e5e;
  border-radius: 50%;
}
 
.firmware_status {
  background-color: aqua;
  border-radius: 4px;
}
 
.firmware_status:hover {
  cursor: pointer;
  /* color: aqua; */
}
 
.active-element {
  cursor: pointer;
 
  &:hover {
    background-color: #409eff;
    border-color: #409eff;
  }
}
:deep(.avue-crud__menu) {
  display: flex;
}
.more-container {
  position: relative;
}
.show-more-do {
  position: absolute;
  background-color: #ffffff;
  // border: 1px solid #409eff;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  width: 140px;
  font-size: 12px;
  // height: 140px;
  height: 190px;
  right: 0;
}
 
 
</style>