对话列表新增点击跳转到对应时间点
This commit is contained in:
parent
ee208d5b16
commit
63e77ebbc0
|
|
@ -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)
|
||||
}
|
||||
</script>
|
||||
|
|
@ -39,7 +39,7 @@ function handleItemClick(item: string, index: number) {
|
|||
<el-row v-for="(item, index) in props.data" :key="index">
|
||||
<!-- 无物体类型标签 隐患等级体颜色显示在编号标签上 -->
|
||||
<!-- 0为隐患等级 1为隐患描述 -->
|
||||
<el-button class="message-btn" text @click="handleItemClick(item as string, index)">
|
||||
<el-button class="message-btn" text @click="handleItemClick(item as any[], index)">
|
||||
<div class="flex flex-col items-start">
|
||||
<div class="flex flex-row gap-2">
|
||||
<el-text class="item-text" type="info" size="small">
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
|||
<div class="py-1" />
|
||||
</template>
|
||||
<el-row>
|
||||
<el-button style="width: 100%;" @click="handleJumpToTimePoint(selectedHazard)">
|
||||
<el-button style="width: 100%;" @click="handleJumpToHazard(selectedHazard)">
|
||||
跳转到隐患时间点
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
|
@ -391,7 +395,7 @@ onMounted(() => {
|
|||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="flex: 1; overflow-y: auto; border-top: 1px solid var(--ep-border-color);">
|
||||
<SubtitleList title="对话" :data="data.对话列表" />
|
||||
<SubtitleList title="对话" :data="data.对话列表" @click="(item: any[]) => handleJumpToTimePoint(Number(item[0]))" />
|
||||
</el-row>
|
||||
<!-- <el-row class="px-1 py-1">
|
||||
<el-button>
|
||||
|
|
|
|||
Loading…
Reference in New Issue