preMdeConfig.js 2.14 KB
import request from '@/utils/request'
import axios from 'axios';
import settings from "@/settings"
import { getToken } from '@/utils/auth'

//模板下载
export function downLoadTemplate(template) {
    return request({
        url: '/flightInfoImport/downLoadTemplate?template=' + template,
        method: 'get',
        responseType: 'blob',
    })
}

//航班目的地批量导入
/**
 * @param file * 文件
 * @param beginDate * 时间
 */
export function importFlightDestination(file, date) {
    let formData = new FormData();
    formData.append("file", file);
    formData.append("beginDate", date);
    return axios({
        method: 'post',
        url: settings.baseURL + '/flightDestination/importFlightDestination',
        headers: { 'Authorization': 'Bearer ' + getToken() },
        data: formData
    })
    // return request({
    //     url: '/flightDestination/importFlightDestination',
    //     method: 'post',
    //     data: formData
    // })
}

//URSA目的地批量导入
/**
 * @param file * 文件
 * @param beginDate * 时间
 */
export function importUrsaDestination(file, date) {
    let formData = new FormData();
    formData.append("file", file);
    formData.append("beginDate", date);
    return axios({
        method: 'post',
        url: settings.baseURL + '/ursaDestination/importUrsaDestination',
        headers: { 'Authorization': 'Bearer ' + getToken() },
        data: formData
    })
    // return request({
    //     url: '/ursaDestination/importUrsaDestination',
    //     method: 'post',
    //     data: formData
    // })
}

//航班目的地查询
/**
 * @param page * 页数
 * @param size * 长度
 * @param area 地区
 * @param fltNo 航班号
 */
export function searchFlightDestination(data) {
    return request({
        url: '/flightDestination/searchFlightDestination',
        method: 'post',
        data: data
    })
}

//URSA目的地查询
/**
 * @param page * 页数
 * @param size * 长度
 * @param area 地区
 * @param ursa ursa list
 */
export function searchUrsaDestination(data) {
    return request({
        url: '/ursaDestination/searchUrsaDestination',
        method: 'post',
        data: data
    })
}