From c40500d288339cd9b2200f8f909e3cd5471c0c22 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 30 八月 2024 17:38:29 +0800 Subject: [PATCH] 1. 优化3D动画中风向的变化逻辑; 2. 修复折线图切换因子时,数据直接跳转至起始处的问题; 3. 折线图和表格加回风向因子; 4. 优化风向的均值计算为矢量计算,同时最大最小值不显示; 5. 新增表格数据导出功能; --- src/api/missionApi.js | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/src/api/missionApi.js b/src/api/missionApi.js index e07e9fe..764199a 100644 --- a/src/api/missionApi.js +++ b/src/api/missionApi.js @@ -1,4 +1,5 @@ import { $http } from './index'; +import { Base64 } from 'js-base64'; /** * @@ -8,5 +9,31 @@ let params = `page=${page}&perPage=${pageSize}`; params += type ? `&type=${type}` : ''; return $http.get(`air/mission/type?${params}`).then((res) => res.data); + }, + + putNewMission(mission) { + return $http.post(`air/mission/create`, mission).then((res) => res.data); + }, + + deleteMission(missionCode) { + let params = `missionCode=${missionCode}`; + return $http.post(`air/mission/delete?${params}`).then((res) => res.data); + }, + + downloadReport(missionCode) { + let params = `missionCode=${missionCode}`; + return $http + .get(`air/mission/report?${params}`, { responseType: 'blob' }) + .then((res) => { + const name = Base64.decode(res.headers.get('fileName')); + const url = window.URL.createObjectURL(res.data); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', name); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + }); } }; -- Gitblit v1.9.3