diff --git a/src/views/BI/components/historical_trajectory_options.vue b/src/views/BI/components/historical_trajectory_options.vue index 3175a92..4d7e519 100644 --- a/src/views/BI/components/historical_trajectory_options.vue +++ b/src/views/BI/components/historical_trajectory_options.vue @@ -36,12 +36,14 @@
- - - + + -
- + + + +
+
{{ data.time }} @@ -49,7 +51,7 @@
-
+
@@ -69,6 +71,7 @@ import { reactive } from "vue"; import { ElMessage } from "element-plus"; import { VideoPause, VideoPlay } from "@element-plus/icons-vue"; +import { useInterval } from "@vueuse/core"; const data = reactive({ searchForm: { @@ -76,12 +79,19 @@ const data = reactive({ dates: [], }, isPlay: false, - currentSchedule: 10, maxSchedule: 100, time: "2021-08-01 12:00:00", position: "图层1", speed: 1.0, }); +const { + counter: currentSchedule, + pause, + resume, +} = useInterval(() => 1000 / data.speed, { + immediate: false, + controls: true, +}); const fnGetData = () => { if (data.searchForm.personnel === "") { ElMessage.warning("请选择人员"); @@ -94,7 +104,12 @@ const fnGetData = () => { ElMessage.success("搜索成功"); }; const fnPlay = () => { - data.isPlay = !data.isPlay; + data.isPlay = true; + resume(); +}; +const fnPause = () => { + data.isPlay = false; + pause(); };