This commit is contained in:
qumeng039@126.com 2025-08-15 16:59:07 +08:00
commit 59b0fba857
3 changed files with 25 additions and 6 deletions

View File

@ -59,7 +59,7 @@
</template> </template>
<script setup> <script setup>
import { ref, defineExpose, watch, computed } from "vue" import { ref, defineExpose, watch, computed, defineProps } from "vue"
import { useKeyNodeStore2 } from "@/store/keyNodeStore2" import { useKeyNodeStore2 } from "@/store/keyNodeStore2"
// stopAutomaticPlay // stopAutomaticPlay
@ -179,7 +179,6 @@ const handleTimePointClick = (pointId) => {
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.right-panel { .right-panel {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -217,7 +216,6 @@ const handleTimePointClick = (pointId) => {
top: 0; top: 0;
margin: 0 auto; margin: 0 auto;
} }
} }
.chart-container { .chart-container {
width: 100%; width: 100%;

View File

@ -20,7 +20,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
@ -57,11 +57,16 @@
</template> </template>
<script setup> <script setup>
import { ref, defineExpose } from "vue" import { ref, defineExpose, defineProps } from "vue"
import { useKeyNodeStore1 } from "@/store/keyNodeStore1" import { useKeyNodeStore1 } from "@/store/keyNodeStore1"
import DynamicGraph from "./graph/dynamicGraph.vue" import DynamicGraph from "./graph/dynamicGraph.vue"
import { watch, computed } from "vue" import { watch, computed } from "vue"
// stopAutomaticPlay
const props = defineProps({
stopAutomaticPlay: { type: Function, required: true }
})
const store = useKeyNodeStore1() const store = useKeyNodeStore1()
const leaderGraphRef = ref(null) const leaderGraphRef = ref(null)
@ -140,6 +145,14 @@ const trackStyle = computed(() => {
} }
}) })
//
const handleTimePointClick = (pointId) => {
//
props.stopAutomaticPlay()
//
store.setActiveTimePoint(pointId)
}
defineExpose({ highlightNode }) defineExpose({ highlightNode })
</script> </script>

View File

@ -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" />
@ -108,6 +108,14 @@ const automaticPlay = () => {
}, 1500) }, 1500)
} }
//
const stopAutomaticPlay = () => {
if (timer) {
clearInterval(timer)
timer = null
}
}
onMounted(() => { onMounted(() => {
store.initializeTimePoints() store.initializeTimePoints()
automaticPlay() automaticPlay()