From 27c7661cae945f65f8d2752cae41801e3c2b1485 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期三, 25 三月 2026 14:21:37 +0800
Subject: [PATCH] 修改折线图
---
src/views/dataAnalysis/components/DataReGasStation.vue | 29 +++++++++++++-
src/views/dataAnalysis/components/DataReLineChart.vue | 46 +++++++++--------------
2 files changed, 44 insertions(+), 31 deletions(-)
diff --git a/src/views/dataAnalysis/components/DataReGasStation.vue b/src/views/dataAnalysis/components/DataReGasStation.vue
index bcf7370..56e99c3 100644
--- a/src/views/dataAnalysis/components/DataReGasStation.vue
+++ b/src/views/dataAnalysis/components/DataReGasStation.vue
@@ -218,9 +218,12 @@
<div>
<div class="block-title">娌瑰搧绫诲瀷鍒嗘瀽</div>
<div style="display: flex">
- <div style="width: 70%; display: flex; align-items: center; justify-content: center; color: #999;">
- 娌瑰搧绫诲瀷閿�鍞崰姣�
- </div>
+ <DataReLineChart
+ style="width: 70%"
+ domId="oilTypeLine"
+ ref="oilTypeLineRef"
+ :chartData="oilTypeLineData"
+ ></DataReLineChart>
<div style="width: 30%">
<a-radio-group v-model="oilTypeSpecies" size="small" @change="oilTypeSpeciesChange">
<a-radio-button :value="5"> 娌瑰搧閿�閲� </a-radio-button>
@@ -317,6 +320,7 @@
vehicleTypePieData: {}, //杞﹀瀷鍒嗘瀽楗煎浘鏁版嵁
fuelLevelLineData: {}, //鍔犳补浣嶅垎鏋愭姌绾垮浘鏁版嵁
fuelLevelPieData: {}, //鍔犳补浣嶅垎鏋愰ゼ鍥炬暟鎹�
+ oilTypeLineData: {}, //娌瑰搧绫诲瀷鍒嗘瀽鎶樼嚎鍥炬暟鎹�
oilTypePieData: {}, //娌瑰搧绫诲瀷鍒嗘瀽楗煎浘鏁版嵁
vehicleTypeLineData: {}, //杞﹀瀷鍒嗘瀽鎶樼嚎鍥炬暟鎹�
trendAnalysisType: 0, //瓒嬪娍鍒嗘瀽閫夋嫨绫诲瀷
@@ -530,9 +534,26 @@
})
})
},
+ //鑾峰彇娌瑰搧绫诲瀷鏌辩姸鍥炬暟鎹�
+ getOilTypeLineData() {
+ const barType = this.oilTypeSpecies == 5 ? 3 : 4
+ postAction('/jyz/dataTable/statBar', {
+ orgCode: this.selectTreeObj.orgCode,
+ startTime: this.startTime,
+ endTime: this.endTime,
+ type: barType,
+ }).then((res) => {
+ console.log(res)
+ this.oilTypeLineData = res.result
+ this.$nextTick(() => {
+ this.$refs.oilTypeLineRef.setChart()
+ })
+ })
+ },
oilTypeSpeciesChange(e) {
this.oilTypeSpecies = e.target.value
this.getOilTypePieData()
+ this.getOilTypeLineData()
},
//瓒嬪娍鍒嗘瀽绫诲瀷鍒囨崲
trendAnalysisTypeChange(e) {
@@ -692,6 +713,7 @@
this.getVehicleStationPieData()
this.getFuelingStationPieData()
this.getOilTypePieData()
+ this.getOilTypeLineData()
this.getTrendAnalysis()
this.getOilFreqCompareData()
},
@@ -703,6 +725,7 @@
this.getVehicleStationPieData()
this.getFuelingStationPieData()
this.getOilTypePieData()
+ this.getOilTypeLineData()
this.getTrendAnalysis()
},
},
diff --git a/src/views/dataAnalysis/components/DataReLineChart.vue b/src/views/dataAnalysis/components/DataReLineChart.vue
index de65a92..228831b 100644
--- a/src/views/dataAnalysis/components/DataReLineChart.vue
+++ b/src/views/dataAnalysis/components/DataReLineChart.vue
@@ -357,21 +357,16 @@
if (this.chartData.lineData) {
option.series.push({
name: this.chartData.lineName,
- type: 'bar',
- barWidth: '12px',
+ type: 'line',
+ smooth: true,
+ symbol: 'circle',
+ symbolSize: 6,
+ lineStyle: {
+ width: 2,
+ color: '#16B777',
+ },
itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#16B777',
- },
- {
- offset: 1,
- color: '#0D6E4A',
- },
- ]),
- },
+ color: '#16B777',
},
data: this.chartData.lineData,
})
@@ -403,21 +398,16 @@
if (this.chartData.lineData2) {
option.series.push({
name: this.chartData.lineName2,
- type: 'bar',
- barWidth: '12px',
+ type: 'line',
+ smooth: true,
+ symbol: 'circle',
+ symbolSize: 6,
+ lineStyle: {
+ width: 2,
+ color: '#FFD93D',
+ },
itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: '#FFD93D',
- },
- {
- offset: 1,
- color: '#B8860B',
- },
- ]),
- },
+ color: '#FFD93D',
},
data: this.chartData.lineData2,
})
--
Gitblit v1.8.0