From 6b452dce36bf20733ed77a009334b79b64d1d4ea Mon Sep 17 00:00:00 2001
From: juzi <819872918@qq.com>
Date: Mon, 15 Apr 2024 09:35:00 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E8=83=BD=E6=BA=90bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../qoqAnalysis/components/lineChart.vue | 265 +++++++++---------
.../energy/analysis/trendAnalysis/index.vue | 27 +-
2 files changed, 138 insertions(+), 154 deletions(-)
diff --git a/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue b/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue
index ec8e3d7c..c0c4ae93 100644
--- a/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue
+++ b/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue
@@ -1,138 +1,139 @@
-
+
\ No newline at end of file
+ `;
+ })
+ .join(``)
+ );
+ },
+ },
+ legend: {
+ right: '1%',
+ icon: 'rect',
+ itemHeight: 8,
+ itemWidth: 8,
+ },
+ grid: {
+ left: '1%',
+ right: '1%',
+ bottom: '3%',
+ containLabel: true,
+ },
+ yAxis: {
+ type: 'value',
+ boundaryGap: [0, 0.01],
+ },
+ xAxis: {
+ type: 'category',
+ data: arr,
+ },
+ series: yData,
+ };
+ option && this.chart.setOption(option);
+ },
+ },
+};
+
diff --git a/src/views/energy/analysis/trendAnalysis/index.vue b/src/views/energy/analysis/trendAnalysis/index.vue
index a40aaea7..4af97e6e 100644
--- a/src/views/energy/analysis/trendAnalysis/index.vue
+++ b/src/views/energy/analysis/trendAnalysis/index.vue
@@ -74,29 +74,12 @@ export default {
},
// 导出excel
exportExl(params) {
- exportTrend({ ...params }).then((res) => {
- // let fileName = '';
- // const contentDisposition = res.headers['content-disposition'];
- // if (contentDisposition) {
- // fileName = decodeURIComponent(
- // contentDisposition.slice(
- // contentDisposition.indexOf('filename=') + 9
- // )
- // );
- // }
- const blob = new Blob([res.data]);
- const reader = new FileReader();
- reader.readAsDataURL(blob);
- reader.onload = (e) => {
- const a = document.createElement('a');
- a.download = '走势分析';
- a.href = e.target.result;
- document.body.appendChild(a);
- a.click();
- document.body.removeChild(a);
+ exportTrend({ ...params })
+ .then((response) => {
+ this.$download.excel(response, '走势分析.xls');
this.$message.success('导出成功');
- };
- });
+ })
+ .catch(() => {});
},
},
};
From b0078cb099be275f97a4c7a48a9cb9235af15a14 Mon Sep 17 00:00:00 2001
From: juzi <819872918@qq.com>
Date: Mon, 15 Apr 2024 14:49:28 +0800
Subject: [PATCH 2/2] 1
---
.../energy/analysis/qoqAnalysis/components/lineChart.vue | 8 --------
1 file changed, 8 deletions(-)
diff --git a/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue b/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue
index c0c4ae93..d7efe8a6 100644
--- a/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue
+++ b/src/views/energy/analysis/qoqAnalysis/components/lineChart.vue
@@ -58,20 +58,12 @@ export default {
type: 'bar',
data: [],
barWidth: 20,
- label: {
- show: true,
- position: 'top',
- },
},
{
name: '上期',
type: 'bar',
data: [],
barWidth: 20,
- // label: {
- // show: true,
- // position: 'top'
- // }
},
];
for (let j = 0; j < arr.length; j++) {