From 8372d022614a1897120802cf1bac90d61651177f Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 14 三月 2025 18:20:56 +0800
Subject: [PATCH] 2025.3.14

---
 src/api/gridApi.js |   96 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 95 insertions(+), 1 deletions(-)

diff --git a/src/api/gridApi.js b/src/api/gridApi.js
index 6eb09f2..8abfe14 100644
--- a/src/api/gridApi.js
+++ b/src/api/gridApi.js
@@ -1,13 +1,15 @@
 import { $http } from './index';
 
+import { Base64 } from 'js-base64';
 /**
  * 鍗槦閬ユ祴缃戞牸鐩稿叧鎺ュ彛API
  */
 export default {
-  fetchGridGroup(area, page, perPage) {
+  fetchGridGroup(area, type, page, perPage) {
     return $http
       .post(`air/satellite/grid/group`, area, {
         params: {
+          type,
           page: page,
           per_page: perPage
         }
@@ -44,6 +46,23 @@
       .then((res) => res.data);
   },
 
+  // /**
+  //  * 鑾峰彇缃戞牸缁勪笅鐨勯仴娴媋od
+  //  * @param {*} groupId
+  //  * @param {*} dataTime
+  //  * @returns
+  //  */
+  // fetchGridAod(groupId, dataTime) {
+  //   return $http
+  //     .get(`air/satellite/grid/aod`, {
+  //       params: {
+  //         groupId,
+  //         dataTime
+  //       }
+  //     })
+  //     .then((res) => res.data);
+  // },
+
   fetchGridDataDetail(dataId, groupId, cellId) {
     return $http
       .get(`air/satellite/grid/data/detail`, {
@@ -54,5 +73,80 @@
         }
       })
       .then((res) => res.data);
+  },
+
+  createGridDataAndDataDetail(groupId, dataTime, dataDetailList) {
+    return $http
+      .post(`air/satellite/grid/data/create`, {
+        params: {
+          groupId,
+          dataTime
+        },
+        data: dataDetailList
+      })
+      .then((res) => res.data);
+  },
+
+  downloadTemplate() {
+    return $http
+      .get(`air/satellite/import/grid/data/download/template`, {
+        responseType: 'blob'
+      })
+      .then((res) => {
+        const name = Base64.decode(res.headers.get('fileName'));
+        const blob = new Blob([res.data], {
+          type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+        });
+        const url = window.URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = name;
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+        window.URL.revokeObjectURL(url);
+      });
+  },
+  importData(dataForm) {
+    return $http
+      .post(`air/satellite/import/grid/data`, dataForm)
+      .then((res) => res.data);
+  },
+  downloadAODTemplate() {
+    return $http
+      .get(`air/satellite/import/grid/aod/download/template`, {
+        responseType: 'blob'
+      })
+      .then((res) => {
+        const name = Base64.decode(res.headers.get('fileName'));
+        const blob = new Blob([res.data], {
+          type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+        });
+        const url = window.URL.createObjectURL(blob);
+        const link = document.createElement('a');
+        link.href = url;
+        link.download = name;
+        document.body.appendChild(link);
+        link.click();
+        document.body.removeChild(link);
+        window.URL.revokeObjectURL(url);
+      });
+  },
+  importAOD(dataForm) {
+    return $http
+      .post(`air/satellite/import/grid/aod`, dataForm)
+      .then((res) => res.data);
+  },
+
+  mixGridData(dataIdList) {
+    return $http
+      .post(`air/satellite/grid/data/mix`, dataIdList)
+      .then((res) => res.data);
+  },
+
+  buildUnderwayProduct(missionCode, groupId) {
+    return $http.get(`air/satellite/import/grid/aod/download/template`, {
+      responseType: 'blob'
+    });
   }
 };

--
Gitblit v1.9.3