From 1e376e8f5ea28a0f15cb883703b466f69835637b Mon Sep 17 00:00:00 2001
From: dongyukun <1208714201@qq.com>
Date: 星期五, 15 十一月 2024 17:00:02 +0800
Subject: [PATCH] 预测值导出

---
 src/views/model/pre/item/MmPredictItemChart.vue |    8 ++++----
 src/api/model/mcs/index.ts                      |    4 ++++
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/api/model/mcs/index.ts b/src/api/model/mcs/index.ts
index 0433f38..2cdaef3 100644
--- a/src/api/model/mcs/index.ts
+++ b/src/api/model/mcs/index.ts
@@ -21,3 +21,7 @@
 export const getPreDataItemChart = (data: PreDataItemChartReqVO) => {
   return request.post({ url: '/model/api/mcs/predict-data/item-chart', data })
 }
+
+export const exportPredictValue = (params) => {
+  return request.download({ url: '/model/api/mcs/predict-data/exportValue', params })
+}
diff --git a/src/views/model/pre/item/MmPredictItemChart.vue b/src/views/model/pre/item/MmPredictItemChart.vue
index 3fd55b5..b4dca60 100644
--- a/src/views/model/pre/item/MmPredictItemChart.vue
+++ b/src/views/model/pre/item/MmPredictItemChart.vue
@@ -217,15 +217,15 @@
 const exportLoading = ref(false)
 const handleExport = async () => {
   chartParams.itemId = dataForm.value.id;
-  chartParams.startTime = dataForm.value.startTime;
-  chartParams.endTime = dataForm.value.endTime;
+  chartParams.startTime = dataForm.value.startTime?dataForm.value.startTime:"";
+  chartParams.endTime = dataForm.value.endTime?dataForm.value.endTime:"";
   try {
     // 导出的二次确认
     await message.exportConfirm()
     // 发起导出
     exportLoading.value = true
-    /*const data = await DaPoint.exportDaPointValue(chartParams)
-    download.excel(data, dataForm.value.pointName + '.xls')*/
+    const data = await McsApi.exportPredictValue(chartParams)
+    download.excel(data, dataForm.value.itemName + '.xls')
   } catch {
   } finally {
     exportLoading.value = false

--
Gitblit v1.9.3