| | |
| | | startLoopFetchRealTimeData, |
| | | clearFetchingTask |
| | | } from '@/utils/factor/data'; |
| | | import thirdPartyDataApi from '@/api/thirdPartyDataApi'; |
| | | |
| | | // const mapAnimation = new MapAnimation(); |
| | | |
| | |
| | | }, |
| | | fetchRealTimeData() { |
| | | this.fetchData((page) => { |
| | | return fetchHistoryData({ |
| | | deviceCode: this.deviceCode, |
| | | // startTime: '2024-08-20 06:00:00', |
| | | // endTime: '2024-08-20 06:02:00', |
| | | page, |
| | | perPage: 100 |
| | | }).then((res) => { |
| | | return fetchHistoryData( |
| | | { |
| | | deviceCode: this.deviceCode, |
| | | // startTime: '2024-08-20 06:00:00', |
| | | // endTime: '2024-08-20 06:02:00', |
| | | page, |
| | | perPage: 100 |
| | | }, |
| | | false |
| | | ).then((res) => { |
| | | this.onFetchData(res.data); |
| | | this.onMapData(res.data); |
| | | // if (res.data.length > 0) { |
| | | // this.fetchNextData(res.data[res.data.length - 1].time); |
| | | // } |
| | | this.fetchNextData(); |
| | | thirdPartyDataApi.fetchLatestData(this.deviceType, this.deviceCode); |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | (res) => { |
| | | this.onFetchData(res.data); |
| | | this.onMapData(res.data); |
| | | thirdPartyDataApi.fetchLatestData(this.deviceType, this.deviceCode); |
| | | } |
| | | ); |
| | | }, |
| | |
| | | this.notFirstFetch = true; |
| | | } |
| | | startIndex = startIndex < 0 ? 0 : startIndex; |
| | | return new Promise((resolve, reject) => { |
| | | return new Promise(() => { |
| | | this.allFactorDatas.addData(dataList, this.drawMode, () => { |
| | | realTimeMapAnimation.moveAnimation( |
| | | this.allFactorDatas, |