修意见领袖
This commit is contained in:
parent
7fe401b8df
commit
ba5f0fc774
|
|
@ -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%;
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user