Commit cfbe72ed6694080d75f65e317639d8996d81b922

Authored by ww
1 parent 179744a6

perf: map component add time range

@@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
22 import { formatToDateTime } from '/@/utils/dateUtil'; 22 import { formatToDateTime } from '/@/utils/dateUtil';
23 import { isEqual } from 'lodash-es'; 23 import { isEqual } from 'lodash-es';
24 import { useAsyncQueue } from '/@/views/device/localtion/useAsyncQueue'; 24 import { useAsyncQueue } from '/@/views/device/localtion/useAsyncQueue';
  25 + import { useMessage } from '/@/hooks/web/useMessage';
25 26
26 // useVisualBoardContext(); 27 // useVisualBoardContext();
27 type TrackRecord = Record<'lng' | 'lat' | 'ts', number>; 28 type TrackRecord = Record<'lng' | 'lat' | 'ts', number>;
@@ -199,7 +200,13 @@ @@ -199,7 +200,13 @@
199 return (trackAni.value || {})._status; 200 return (trackAni.value || {})._status;
200 }); 201 });
201 202
  203 + const { createMessage } = useMessage();
202 const handlePlay = () => { 204 const handlePlay = () => {
  205 + const { start, end } = timeRange;
  206 +
  207 + if (!props.random && (!start || !end)) {
  208 + createMessage.warning('请先选择时间范围');
  209 + }
203 if (unref(getTrackPlayStatus) === TrackAnimationStatus.DONE) unref(trackAni).start(); 210 if (unref(getTrackPlayStatus) === TrackAnimationStatus.DONE) unref(trackAni).start();
204 else if (unref(getTrackPlayStatus) === TrackAnimationStatus.PLAY) unref(trackAni).pause(); 211 else if (unref(getTrackPlayStatus) === TrackAnimationStatus.PLAY) unref(trackAni).pause();
205 else if (unref(getTrackPlayStatus) === TrackAnimationStatus.PAUSE) unref(trackAni).continue(); 212 else if (unref(getTrackPlayStatus) === TrackAnimationStatus.PAUSE) unref(trackAni).continue();