Drone.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <div class="content">
  3. <div class="left-content">
  4. <div class="search-box">
  5. <el-input v-model="queryParams.equipment" class="custom-input" placeholder="搜索设备" @keyup.enter="getTree">
  6. <template #prefix>
  7. <el-icon class="el-input__icon"><search /></el-icon>
  8. </template>
  9. </el-input>
  10. </div>
  11. <div class="tree-container">
  12. <div class="tree-box">
  13. <div style="overflow-y: auto; height: 100%">
  14. <el-tree :data="treeData" accordion @node-click="handleNodeClick" />
  15. </div>
  16. </div>
  17. </div>
  18. </div>
  19. <!--
  20. <div class="right-content video-list">
  21. <HKVideo :dot_data="data" autoplay />
  22. </div>
  23. -->
  24. </div>
  25. </template>
  26. <script setup lang="ts">
  27. import { ref, reactive, toRefs, watch, onMounted } from 'vue';
  28. import { Search } from '@element-plus/icons-vue';
  29. // import { getAvconDeptTree } from '@/api/emergencyCommandMap/communication';
  30. import { getDroneTree } from '@/api/emergencyCommandMap/Drone';
  31. interface QueryParams {
  32. equipment: string;
  33. }
  34. const queryParams = reactive<QueryParams>({
  35. equipment: ''
  36. });
  37. // const queryParams2 = reactify({});
  38. const options = ref([]);
  39. // const treeData = ref([]);
  40. let data = ref({
  41. 'name': '东镇街道长塘居委会大湴村边2',
  42. 'invideoIds': true,
  43. 'area': '茂名市视频数据共享管理平台/茂名市应急管理局/信宜市应急管理局/信宜防溺水监控/东镇街道防溺水(移动)/长塘村',
  44. 'ip': '级联',
  45. 'status': '在线',
  46. 'status_lifetime': '68天23.79小时',
  47. 'record_status': '--',
  48. 'inspection_datetime': '2024-07-15 16:24:09',
  49. 'video_code_int': '44098301581314000465',
  50. 'video_code': '44098301581314000465',
  51. 'longitude': 110.908867,
  52. 'latitude': 22.357185
  53. });
  54. const getTree = () => {
  55. getDroneTree(queryParams).then((res) => {
  56. treeData.value = res.data;
  57. });
  58. };
  59. const handleNodeClick = (data) => {
  60. console.log('handleNodeClick', data)
  61. };
  62. const treeData = [
  63. {
  64. label: '无人机设备',
  65. children: [
  66. {
  67. label: '茂名市应急管理局',
  68. children: [
  69. {
  70. id: "1",
  71. label: '应急无人机',
  72. url: "http://19.152.196.223:5050/liveplay.html?liveurl=ws://10.100.100.103:9001/live/mmjk0002@mm.zw.yj_00.flv&channelid=mmjk0002@mm.zw.yj_00"
  73. }
  74. ]
  75. },
  76. {
  77. label: '电白区应急管理局',
  78. children: [
  79. {
  80. id: "2",
  81. label: '应急无人机',
  82. url: "http://19.152.196.223:5050/liveplay.html?liveurl=ws://10.100.100.103:9001/live/mmjk0002@mm.zw.yj_00.flv&channelid=mmjk0002@mm.zw.yj_00"
  83. }
  84. ]
  85. },
  86. {
  87. label: '茂南区应急管理局',
  88. children: [
  89. {
  90. id: "3",
  91. label: '应急无人机',
  92. url: "http://19.152.196.223:5050/liveplay.html?liveurl=ws://10.100.100.103:9001/live/mmjk0002@mm.zw.yj_00.flv&channelid=mmjk0002@mm.zw.yj_00"
  93. }
  94. ]
  95. }
  96. ]
  97. }
  98. ];
  99. onMounted(() => {
  100. getTree();
  101. });
  102. </script>
  103. <style scoped lang="scss">
  104. .content {
  105. display: flex;
  106. height: 430px;
  107. .left-content {
  108. height: 100%;
  109. flex: 1;
  110. margin-right: 20px;
  111. .search-box {
  112. display: flex;
  113. .custom-input {
  114. width: 100%;
  115. }
  116. }
  117. :deep(.el-tree) {
  118. background-color: transparent;
  119. color: #fbffff;
  120. font-size: 38px;
  121. .el-tree-node__content {
  122. height: auto;
  123. padding-top: 10px;
  124. padding-bottom: 10px;
  125. white-space: normal;
  126. word-break: break-all;
  127. }
  128. .el-tree-node__expand-icon {
  129. color: #297cfc;
  130. font-size: 23px;
  131. }
  132. .el-tree-node:focus > .el-tree-node__content,
  133. .el-tree-node__content:hover {
  134. background-color: transparent !important;
  135. }
  136. }
  137. }
  138. .right-content {
  139. height: 100%;
  140. flex-grow: 1;
  141. flex: 1;
  142. }
  143. }
  144. </style>