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/stores/mission.js | 35 ++++++++++++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 1 deletions(-) diff --git a/src/stores/mission.js b/src/stores/mission.js index cb79aa8..37c2871 100644 --- a/src/stores/mission.js +++ b/src/stores/mission.js @@ -1,9 +1,42 @@ import { ref } from 'vue'; import { defineStore } from 'pinia'; +import missionApi from '@/api/missionApi'; +import { useFetchData } from '@/composables/fetchData'; // 璧拌埅浠诲姟 export const useMissionStore = defineStore('mission', () => { const missionList = ref([]); + const { loading, fetchData } = useFetchData(); - return { missionList }; + function fetchMission(type) { + return fetchData((page, pageSize) => { + return missionApi + .fethchMission({ type: type, page, pageSize }) + .then((res) => { + missionList.value = res.data; + return res; + }); + }); + } + + function deleteMission(missionCode) { + return fetchData(() => { + return missionApi.deleteMission(missionCode).then((res) => { + let index = -1; + for (let i = 0; i < missionList.value.length; i++) { + const e = missionList.value[i]; + if (e.missionCode == missionCode) { + index = i; + break; + } + } + if (index != -1) { + missionList.value.splice(index, 1); + } + return res; + }); + }); + } + + return { missionList, loading, fetchMission, deleteMission }; }); -- Gitblit v1.9.3