diff --git a/src/components/hazard_inspect/SubtitleList.vue b/src/components/hazard_inspect/SubtitleList.vue index 3dec326..8a3fa8a 100644 --- a/src/components/hazard_inspect/SubtitleList.vue +++ b/src/components/hazard_inspect/SubtitleList.vue @@ -18,7 +18,7 @@ const props = defineProps({ const emit = defineEmits(['click']) // 点击项,向外抛出数据 -function handleItemClick(item: string, index: number) { +function handleItemClick(item: any[], index: number) { emit('click', item, index) } @@ -39,7 +39,7 @@ function handleItemClick(item: string, index: number) { - +
diff --git a/src/pages/nav/HazardCheckResult/index.vue b/src/pages/nav/HazardCheckResult/index.vue index a28c7bb..ee1c9b1 100644 --- a/src/pages/nav/HazardCheckResult/index.vue +++ b/src/pages/nav/HazardCheckResult/index.vue @@ -105,7 +105,7 @@ const totalFrames = computed(() => { function handleTimelineHazardClick(hazardId: string) { selectedHazard.value = Number(hazardId) - handleJumpToTimePoint(Number(hazardId)) + handleJumpToHazard(Number(hazardId)) } function handleFrameChange(frame: number) { @@ -197,15 +197,19 @@ function getData() { function handleHazardClick(item: string, index: number) { selectedHazard.value = index - handleJumpToTimePoint(selectedHazard.value) + handleJumpToHazard(selectedHazard.value) } // 点击跳转到隐患时间点,更新视频播放 -function handleJumpToTimePoint(index: number) { +function handleJumpToHazard(index: number) { const seconds = data.value.隐患数据[index].跳转时间点 // 实现跳转到指定时间点的逻辑 // console.log(`跳转到时间点: ${seconds}`) + handleJumpToTimePoint(seconds) +} + +function handleJumpToTimePoint(seconds: number) { // 校验:必须是数字且大于等于0 if (Number.isNaN(seconds) || seconds < 0) return @@ -297,7 +301,7 @@ onMounted(() => { if (data.value.隐患列表.length > 0) { selectedHazard.value = 0 - handleJumpToTimePoint(0) + handleJumpToHazard(0) } }) } @@ -379,7 +383,7 @@ onMounted(() => {
- + 跳转到隐患时间点 @@ -391,7 +395,7 @@ onMounted(() => { - +