桥梁自动播放功能修复
This commit is contained in:
parent
af40ee58e7
commit
7fe401b8df
|
|
@ -25,7 +25,7 @@
|
||||||
:key="point.id"
|
:key="point.id"
|
||||||
class="timeline-point-wrapper"
|
class="timeline-point-wrapper"
|
||||||
:style="{ left: `${pointPositions[point.id]}%` }"
|
:style="{ left: `${pointPositions[point.id]}%` }"
|
||||||
@click="store.setActiveTimePoint(point.id)"
|
@click="handleTimePointClick(point.id)"
|
||||||
>
|
>
|
||||||
<el-tooltip
|
<el-tooltip
|
||||||
class="timePoint-box-item"
|
class="timePoint-box-item"
|
||||||
|
|
@ -62,6 +62,11 @@
|
||||||
import { ref, defineExpose, watch, computed } from "vue"
|
import { ref, defineExpose, watch, computed } from "vue"
|
||||||
import { useKeyNodeStore2 } from "@/store/keyNodeStore2"
|
import { useKeyNodeStore2 } from "@/store/keyNodeStore2"
|
||||||
|
|
||||||
|
// 接收 stopAutomaticPlay 方法
|
||||||
|
const props = defineProps({
|
||||||
|
stopAutomaticPlay: { type: Function, required: true }
|
||||||
|
})
|
||||||
|
|
||||||
import BridgeCommunityGraph from "./graph/bridgeCommunityGraph.vue"
|
import BridgeCommunityGraph from "./graph/bridgeCommunityGraph.vue"
|
||||||
import DetailCommunityGraph from "./graph/detailCommunityGraph.vue"
|
import DetailCommunityGraph from "./graph/detailCommunityGraph.vue"
|
||||||
|
|
||||||
|
|
@ -164,6 +169,13 @@ const trackStyle = computed(() => {
|
||||||
})
|
})
|
||||||
|
|
||||||
defineExpose({ highlightNode })
|
defineExpose({ highlightNode })
|
||||||
|
// 添加时间点点击事件处理函数
|
||||||
|
const handleTimePointClick = (pointId) => {
|
||||||
|
// 停止自动播放
|
||||||
|
props.stopAutomaticPlay()
|
||||||
|
// 设置当前激活的时间点
|
||||||
|
store.setActiveTimePoint(pointId)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="middle-container">
|
<div class="middle-container">
|
||||||
<div class="graph">
|
<div class="graph">
|
||||||
<GraphPanel ref="graphPanelRef" />
|
<GraphPanel ref="graphPanelRef" :stopAutomaticPlay="stopAutomaticPlay" />
|
||||||
</div>
|
</div>
|
||||||
<div class="postList">
|
<div class="postList">
|
||||||
<PostDynamics :posts="store.posts" @handle:openDialog="handleOpenPostDialog" />
|
<PostDynamics :posts="store.posts" @handle:openDialog="handleOpenPostDialog" />
|
||||||
|
|
@ -94,6 +94,14 @@ const handleOpenPostDialog = (post) => {
|
||||||
store.openPostDetail(post)
|
store.openPostDetail(post)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加停止自动播放的方法
|
||||||
|
const stopAutomaticPlay = () => {
|
||||||
|
if (timer) {
|
||||||
|
clearInterval(timer)
|
||||||
|
timer = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let timer = null
|
let timer = null
|
||||||
const automaticPlay = () => {
|
const automaticPlay = () => {
|
||||||
let index = 1
|
let index = 1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user