MobileUnmannedVehicle.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="menu-content">
  3. <div class="container">
  4. <div class="gradient-text title">机动无人机</div>
  5. <!-- <div class="box2">-->
  6. <div class="box-left">
  7. <el-input v-model="queryParams.keywords" class="custom-input" placeholder="搜索" @input="initData">
  8. <template #prefix>
  9. <el-icon class="el-input__icon"><search /></el-icon>
  10. </template>
  11. </el-input>
  12. <div class="btn" @click="handleCancel">取消</div>
  13. </div>
  14. </div>
  15. <div class="flex-container">
  16. <div class="text-item">机动无人机</div>
  17. <div class="button-item common-btn-primary2 edit-icon" @click="showMoreVideos">全部播放</div>
  18. </div>
  19. <div class="custom-table">
  20. <div class="th">
  21. <div class="td">机动无人机</div>
  22. <!-- <div class="td" style="width: 220px; flex: unset">操作</div>-->
  23. </div>
  24. <div class="table-content">
  25. <div v-for="item in dataList" :key="item.id" class="tr">
  26. <div class="td">{{ item.drone_name }}</div>
  27. <!-- <div class="td" style="width: 220px; flex: unset">-->
  28. <!-- <div class="text" @click="handleConnect(index, item)">视频</div>-->
  29. <!--&lt;!&ndash; <div class="text" @click="handleCollaborate(index, item)">协同</div>&ndash;&gt;-->
  30. <!-- <div class="text" @click="handleTrack(item)">轨迹</div>-->
  31. <!-- </div>-->
  32. </div>
  33. </div>
  34. <div class="footer">
  35. <el-pagination
  36. background
  37. :hide-on-single-page="true"
  38. layout="total, prev, pager, next"
  39. :total="total"
  40. :page-size="queryParams.size"
  41. :current-current="queryParams.current"
  42. @current-change="handleChangePage"
  43. />
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script setup lang="ts">
  49. import { Search } from '@element-plus/icons-vue';
  50. import { onMounted, reactive } from 'vue';
  51. import { getDroneResourcesList, getDroneResourcesTrajectory, getDroneResourcesVideo } from '@/api/globalMap/MobileUnmannedVehicle';
  52. const getDataMethod = ref(null);
  53. const showMoreVideos = () => {
  54. getDataMethod.value = () => getDroneResourcesVideo(id);
  55. };
  56. const trackPlayback = inject('trackPlayback');
  57. // 数据列表,直接定义为数组
  58. const dataList = ref([]);
  59. //入参
  60. const queryParams = reactive({
  61. current: 1,
  62. size: 10,
  63. keywords: ''
  64. });
  65. const total = ref(0);
  66. //调接口
  67. const initData = () => {
  68. getDroneResourcesList({
  69. current: queryParams.current,
  70. size: queryParams.size,
  71. query: {
  72. keywords: queryParams.keywords
  73. }
  74. }).then((res) => {
  75. dataList.value = res.rows;
  76. total.value = res.total;
  77. });
  78. };
  79. const handleChangePage = (newNum) => {
  80. queryParams.current = newNum;
  81. initData();
  82. };
  83. // 取消按钮的逻辑,搜索框清空并重新加载数据
  84. const handleCancel = () => {
  85. queryParams.keywords = '';
  86. queryParams.current = 1;
  87. initData();
  88. };
  89. const handleConnect = () => {};
  90. const handleCollaborate = () => {};
  91. // 轨迹
  92. const handleTrack = (item) => {
  93. getDroneResourcesTrajectory(item.id).then((res) => {
  94. const trajectory = [];
  95. res.rows.forEach((item) => {
  96. trajectory.push([item.longitude, item.latitude]);
  97. });
  98. trackPlayback(trajectory);
  99. });
  100. };
  101. //调用函数
  102. onMounted(() => {
  103. initData();
  104. });
  105. </script>
  106. <style lang="scss" scoped>
  107. .menu-content {
  108. width: 1579px;
  109. height: 1394px;
  110. background: url('@/assets/images/map/rightMenu/content.png') no-repeat;
  111. padding: 130px 20px 20px 20px;
  112. font-size: 36px;
  113. position: relative;
  114. color: #ffffff;
  115. }
  116. .title {
  117. font-size: 60px;
  118. position: absolute;
  119. top: 30px;
  120. left: 160px;
  121. }
  122. .box-left {
  123. display: flex;
  124. margin-top: 30px;
  125. margin-bottom: 20px;
  126. .btn {
  127. width: 140px;
  128. min-width: 140px;
  129. height: 60px;
  130. background: url('@/assets/images/map/rightMenu/potentialFloodHazard/btn.png') no-repeat;
  131. display: flex;
  132. justify-content: center;
  133. align-items: center;
  134. cursor: pointer;
  135. margin-left: 20px;
  136. color: #ffffff;
  137. font-size: 32px;
  138. }
  139. }
  140. .custom-input {
  141. height: 60px;
  142. line-height: 40px;
  143. }
  144. .custom-table {
  145. width: 100%;
  146. height: 1015px;
  147. display: flex;
  148. flex-direction: column;
  149. .table-content {
  150. flex: 1;
  151. overflow-y: auto;
  152. }
  153. .th {
  154. width: 100%;
  155. height: 151px;
  156. background: url('@/assets/images/map/rightMenu/th.png') no-repeat;
  157. background-size: 100% 100%;
  158. display: flex;
  159. }
  160. .tr {
  161. width: 100%;
  162. height: 139px;
  163. background: url('@/assets/images/map/rightMenu/td.png') no-repeat;
  164. background-size: 100% 100%;
  165. display: flex;
  166. padding-right: 20px;
  167. &:hover {
  168. background: url('@/assets/images/map/rightMenu/td_checked.png') no-repeat;
  169. background-size: 100% 100%;
  170. }
  171. }
  172. .td {
  173. flex: 1;
  174. color: #edfaff;
  175. font-size: 38px;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. cursor: pointer;
  180. }
  181. .td-text {
  182. /* 设置字体透明 */
  183. color: transparent;
  184. /* 使用 -webkit-background-clip 属性将背景剪裁至文本形状 */
  185. -webkit-background-clip: text;
  186. /* 非Webkit内核浏览器需要使用标准前缀 */
  187. background-clip: text;
  188. font-family: 'YouSheBiaoTiHei';
  189. /* 设置线性渐变,从红色渐变到蓝色 */
  190. background-image: linear-gradient(to bottom, #ffffff 50%, #3075d3 100%);
  191. font-size: 48px;
  192. }
  193. .text-green {
  194. background-image: linear-gradient(to bottom, #ffffff 50%, #40c75f 100%);
  195. }
  196. .text-danger {
  197. background-image: linear-gradient(to bottom, #ffffff 50%, #ff2f3c 100%);
  198. }
  199. }
  200. .text {
  201. font-size: 38px;
  202. color: #00e8ff;
  203. margin-right: 20px;
  204. &:last-child {
  205. margin-right: 0;
  206. }
  207. }
  208. .flex-container {
  209. display: flex;
  210. justify-content: space-between; /* 左右两端对齐 */
  211. align-items: center; /* 垂直居中对齐 */
  212. margin: 15px 0;
  213. }
  214. .text-item {
  215. font-size: 32px; /* 根据需要设置字体大小 */
  216. line-height: 1; /* 确保行高一致 */
  217. }
  218. .button-item {
  219. font-size: 32px; /* 根据需要设置字体大小 */
  220. line-height: 1; /* 确保行高一致 */
  221. }
  222. .footer {
  223. height: 64px;
  224. display: flex;
  225. justify-content: flex-end;
  226. margin-top: 25px;
  227. .pagination-container {
  228. height: 64px;
  229. margin: 0;
  230. }
  231. :deep(.el-pagination__total) {
  232. color: #a7ccdf;
  233. font-size: 32px;
  234. }
  235. :deep(.el-pagination) {
  236. .btn-next,
  237. .btn-prev {
  238. background-color: transparent;
  239. border: none;
  240. .el-icon {
  241. font-size: 22px;
  242. color: #a7ccdf;
  243. }
  244. }
  245. .btn-prev:disabled,
  246. .btn-next:disabled {
  247. background-color: transparent;
  248. border: none;
  249. }
  250. .el-pager li {
  251. width: 64px;
  252. height: 64px;
  253. line-height: 64px;
  254. text-align: center;
  255. font-size: 38px;
  256. color: #a7ccdf;
  257. background-color: #0e3064;
  258. border: 1px solid #0c57a7;
  259. margin: 0 6px;
  260. &:hover {
  261. background-color: #038dff;
  262. border: 1px solid #038dff;
  263. }
  264. }
  265. .el-pager li.is-active {
  266. background-color: #038dff;
  267. border: 1px solid #038dff;
  268. }
  269. .el-pagination__goto {
  270. font-size: 38px;
  271. color: #a7ccdf;
  272. }
  273. }
  274. }
  275. </style>