| | |
| | | <div class="val">{{ formData.stayDuration }}</div> |
| | | </el-col> |
| | | </el-row> |
| | | <div class="detail-title">轨迹点</div> |
| | | <div class="detail-title" style="display: flex; align-items: center"> |
| | | 轨迹点 |
| | | <el-icon class="track-play-btn" :size="26" @click.stop="handlePlayClick"> |
| | | <VideoPause v-if="isPlaying" /> |
| | | <VideoPlay v-else /> |
| | | </el-icon> |
| | | </div> |
| | | <div class="command-table-container"> |
| | | <div class="command-table-content"> |
| | | <el-table ref="pointTableRef" class="command-table" :data="list" :row-class-name="getRowClassName"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="footer"> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button v-if="dialogMode != 'view'" color="#2B2B4C" @click="handleCancel"> |
| | | {{ dialogReadonly ? '关闭' : '取消' }} |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { Close } from '@element-plus/icons-vue' |
| | | import { Close, VideoPause, VideoPlay } from '@element-plus/icons-vue' |
| | | |
| | | import { computed, nextTick, ref } from 'vue' |
| | | import { computed, nextTick, onBeforeUnmount, ref } from 'vue' |
| | | import CommonCesiumMap from '@/components/map-container/common-cesium-map.vue' |
| | | import { fwDroneFlightRecordDetailApi } from '@/views/recordManage/historyTracks/fwDroneFlightRecord' |
| | | import { fwDroneFlightRecordDetailPageApi } from '@/views/recordManage/historyTracks/flyTrajectory' |
| | |
| | | |
| | | // 关闭后重置 |
| | | function handleClosed() { |
| | | stopTrackPlay() |
| | | formData.value = initForm() |
| | | list.value = [] |
| | | selectedPointIndex.value = 0 |
| | |
| | | // 当前选中的轨迹点索引(与地图时间轴联动) |
| | | const selectedPointIndex = ref(0) |
| | | const pointTableRef = ref(null) |
| | | const isPlaying = ref(false) |
| | | const PLAY_INTERVAL = 1000 |
| | | let playTimer = null |
| | | let playIndex = 0 |
| | | |
| | | // 停止轨迹播放 |
| | | function stopTrackPlay() { |
| | | if (playTimer) { |
| | | clearInterval(playTimer) |
| | | playTimer = null |
| | | } |
| | | isPlaying.value = false |
| | | } |
| | | |
| | | // 播放下一个轨迹点 |
| | | function playNextPoint() { |
| | | if (!list.value.length) { |
| | | stopTrackPlay() |
| | | return |
| | | } |
| | | if (playIndex >= list.value.length) playIndex = 0 |
| | | mapRef.value?.clickWeekTime?.(list.value[playIndex], playIndex) |
| | | playIndex += 1 |
| | | } |
| | | |
| | | // 切换轨迹播放状态 |
| | | function handlePlayClick() { |
| | | if (isPlaying.value) { |
| | | stopTrackPlay() |
| | | return |
| | | } |
| | | if (!list.value.length) return |
| | | playIndex = selectedPointIndex.value || 0 |
| | | isPlaying.value = true |
| | | playNextPoint() |
| | | playTimer = setInterval(playNextPoint, PLAY_INTERVAL) |
| | | } |
| | | |
| | | // 地图上点击轨迹点后,同步高亮表格对应行,并滚动到该行 |
| | | function handlePointChange({ index } = {}) { |
| | |
| | | |
| | | // 打开弹框 |
| | | async function open({ mode, row } = {}) { |
| | | stopTrackPlay() |
| | | dialogMode.value = mode || 'add' |
| | | visible.value = true |
| | | await nextTick() |
| | |
| | | } |
| | | |
| | | defineExpose({ open }) |
| | | |
| | | // 卸载时清理播放定时器 |
| | | onBeforeUnmount(() => { |
| | | stopTrackPlay() |
| | | }) |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | :deep(.alarm-row) { |
| | | background: #2B2B4C !important; |
| | | background: #2b2b4c !important; |
| | | |
| | | td { |
| | | background-color: transparent !important; |
| | |
| | | color: #4faaff !important; |
| | | } |
| | | } |
| | | |
| | | .track-play-btn { |
| | | margin-left: 6px; |
| | | cursor: pointer; |
| | | } |
| | | </style> |