Helicopter.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  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="custom-table">
  16. <div class="th">
  17. <div class="td">直升机</div>
  18. <!-- <div class="td" style="width: 220px; 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.helicopter_name }}</div>
  23. <!-- <div class="td" style="width: 220px; flex: unset">-->
  24. <!-- <div class="text" @click="handleConnect">连线</div>-->
  25. <!-- &lt;!&ndash; <div class="text" @click="handleCollaborate(index, item)">协同</div>&ndash;&gt;-->
  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-current="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 { getHelicopterList, getHelicopterTrajectory } from '@/api/globalMap/Helicopter';
  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. getHelicopterList({
  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. getHelicopterTrajectory(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: 1579px;
  101. height: 1394px;
  102. background: url('@/assets/images/map/rightMenu/content.png') no-repeat;
  103. padding: 130px 20px 20px 20px;
  104. font-size: 36px;
  105. position: relative;
  106. color: #ffffff;
  107. }
  108. .title {
  109. font-size: 60px;
  110. position: absolute;
  111. top: 30px;
  112. left: 160px;
  113. }
  114. .box-left {
  115. display: flex;
  116. margin-top: 30px;
  117. margin-bottom: 20px;
  118. .btn {
  119. width: 140px;
  120. min-width: 140px;
  121. height: 60px;
  122. background: url('@/assets/images/map/rightMenu/potentialFloodHazard/btn.png') no-repeat;
  123. display: flex;
  124. justify-content: center;
  125. align-items: center;
  126. cursor: pointer;
  127. margin-left: 20px;
  128. color: #ffffff;
  129. font-size: 32px;
  130. }
  131. }
  132. .custom-input {
  133. height: 60px;
  134. line-height: 40px;
  135. }
  136. .custom-table {
  137. width: 100%;
  138. height: 1120px;
  139. display: flex;
  140. flex-direction: column;
  141. .table-content {
  142. flex: 1;
  143. overflow-y: auto;
  144. }
  145. .th {
  146. width: 100%;
  147. height: 151px;
  148. background: url('@/assets/images/map/rightMenu/th.png') no-repeat;
  149. background-size: 100% 100%;
  150. display: flex;
  151. }
  152. .tr {
  153. width: 100%;
  154. height: 139px;
  155. background: url('@/assets/images/map/rightMenu/td.png') no-repeat;
  156. background-size: 100% 100%;
  157. display: flex;
  158. padding-right: 20px;
  159. &:hover {
  160. background: url('@/assets/images/map/rightMenu/td_checked.png') no-repeat;
  161. background-size: 100% 100%;
  162. }
  163. }
  164. .td {
  165. flex: 1;
  166. color: #edfaff;
  167. font-size: 38px;
  168. display: flex;
  169. justify-content: center;
  170. align-items: center;
  171. cursor: pointer;
  172. }
  173. .td-text {
  174. /* 设置字体透明 */
  175. color: transparent;
  176. /* 使用 -webkit-background-clip 属性将背景剪裁至文本形状 */
  177. -webkit-background-clip: text;
  178. /* 非Webkit内核浏览器需要使用标准前缀 */
  179. background-clip: text;
  180. font-family: 'YouSheBiaoTiHei';
  181. /* 设置线性渐变,从红色渐变到蓝色 */
  182. background-image: linear-gradient(to bottom, #ffffff 50%, #3075d3 100%);
  183. font-size: 48px;
  184. }
  185. .text-green {
  186. background-image: linear-gradient(to bottom, #ffffff 50%, #40c75f 100%);
  187. }
  188. .text-danger {
  189. background-image: linear-gradient(to bottom, #ffffff 50%, #ff2f3c 100%);
  190. }
  191. }
  192. .text {
  193. font-size: 38px;
  194. color: #00e8ff;
  195. margin-right: 20px;
  196. &:last-child {
  197. margin-right: 0;
  198. }
  199. }
  200. .flex-container {
  201. display: flex;
  202. justify-content: space-between; /* 左右两端对齐 */
  203. align-items: center; /* 垂直居中对齐 */
  204. }
  205. .text-item {
  206. font-size: 32px; /* 根据需要设置字体大小 */
  207. line-height: 1; /* 确保行高一致 */
  208. }
  209. .button-item {
  210. font-size: 32px; /* 根据需要设置字体大小 */
  211. line-height: 1; /* 确保行高一致 */
  212. }
  213. .footer {
  214. height: 64px;
  215. display: flex;
  216. justify-content: flex-end;
  217. margin-top: 25px;
  218. .pagination-container {
  219. height: 64px;
  220. margin: 0;
  221. }
  222. :deep(.el-pagination__total) {
  223. color: #a7ccdf;
  224. font-size: 32px;
  225. }
  226. :deep(.el-pagination) {
  227. .btn-next,
  228. .btn-prev {
  229. background-color: transparent;
  230. border: none;
  231. .el-icon {
  232. font-size: 22px;
  233. color: #a7ccdf;
  234. }
  235. }
  236. .btn-prev:disabled,
  237. .btn-next:disabled {
  238. background-color: transparent;
  239. border: none;
  240. }
  241. .el-pager li {
  242. width: 64px;
  243. height: 64px;
  244. line-height: 64px;
  245. text-align: center;
  246. font-size: 38px;
  247. color: #a7ccdf;
  248. background-color: #0e3064;
  249. border: 1px solid #0c57a7;
  250. margin: 0 6px;
  251. &:hover {
  252. background-color: #038dff;
  253. border: 1px solid #038dff;
  254. }
  255. }
  256. .el-pager li.is-active {
  257. background-color: #038dff;
  258. border: 1px solid #038dff;
  259. }
  260. .el-pagination__goto {
  261. font-size: 38px;
  262. color: #a7ccdf;
  263. }
  264. }
  265. }
  266. </style>