riku
2024-12-27 1c31659852f8360cc0fdfac26aff51e54b8b8b67
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { $http } from './index';
 
/**
 * 第三方走航数据接口
 */
export default {
  /**
   * 启动获取任务范围内的走航数据后台任务
   * @param {*} missionCode
   */
  fetchMissionData(missionCode) {
    let label = null;
    if (import.meta.env.VITE_DATA_MODE == 'jingan') {
      label = 'shenxin';
    }
    if (!label) return;
 
    let params = `label=${label}&missionCode=${missionCode}`;
    return $http
      .get(`air/thirdParty/data/fetch/mission?${params}`)
      .then((res) => res.data);
  },
 
  /**
   * 启动获取设备实时最新走航数据后台任务
   * @param {*} deviceType
   * @param {*} deviceCode
   * @param {*} startTime
   * @returns
   */
  fetchLatestData(deviceType, deviceCode, startTime) {
    let label = null;
    if (import.meta.env.VITE_DATA_MODE == 'jingan') {
      label = 'shenxin';
    }
    if (!label) return;
 
    let params = `label=${label}&deviceType=${deviceType}&deviceCode=${deviceCode}`;
    params += startTime ? `&startTime=${startTime}` : '';
    return $http
      .get(`air/thirdParty/data/fetch/latest?${params}`)
      .then((res) => res.data);
  }
};