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