Helicopter.vue 6.4 KB

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