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 | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 109 insertions(+), 3 deletions(-)
diff --git a/src/views/dataAnalysis/components/DataReGasStation.vue b/src/views/dataAnalysis/components/DataReGasStation.vue
index 1748d1a..56e99c3 100644
--- a/src/views/dataAnalysis/components/DataReGasStation.vue
+++ b/src/views/dataAnalysis/components/DataReGasStation.vue
@@ -9,6 +9,7 @@
<a-radio-button :value="3"> 閫氳繃鐜� </a-radio-button>
<a-radio-button :value="4"> 瀹㈡埛 </a-radio-button>
<a-radio-button :value="5"> 娴佸け鐜� </a-radio-button>
+ <a-radio-button :value="6"> 閿�鍞噾棰� </a-radio-button>
</a-radio-group>
</div>
<div>
@@ -66,7 +67,7 @@
<a-range-picker style="width: 300px; margin: 0 12px" v-if="isContrast" @change="contrastTimeChange" />
</div>
<div class="fueling-overview-block">
- <div class="fueling-overview-item">
+ <div class="fueling-overview-item" id="traffic-flow-card">
<div class="fueling-overview-name">杞︽祦閲�</div>
<div class="fueling-overview-num">
<span style="margin-right: 24px">{{ statisTotalObj.carCount }}</span>
@@ -80,7 +81,7 @@
<span style="color: #16b777" v-if="isContrast">{{ contrastObj.appearCount }}</span>
</div>
</div>
- <div class="fueling-overview-item">
+ <div class="fueling-overview-item" id="oil-count-card">
<div class="fueling-overview-name">鍔犳补鏁�</div>
<div class="fueling-overview-num">
<span style="margin-right: 24px">{{ statisTotalObj.oilCount }}</span>
@@ -120,6 +121,13 @@
<div class="fueling-overview-num">
<span style="margin-right: 24px">{{ statisTotalObj.rebackRate }}%</span>
<span style="color: #16b777" v-if="isContrast">{{ contrastObj.rebackRate }}%</span>
+ </div>
+ </div>
+ <div class="fueling-overview-item">
+ <div class="fueling-overview-name">閿�鍞噾棰�(鍏�)</div>
+ <div class="fueling-overview-num">
+ <span style="margin-right: 24px">{{ statisTotalObj.totalAmount }}</span>
+ <span style="color: #16b777" v-if="isContrast">{{ contrastObj.totalAmount }}</span>
</div>
</div>
</div>
@@ -207,6 +215,29 @@
</div>
</div>
</div>
+ <div>
+ <div class="block-title">娌瑰搧绫诲瀷鍒嗘瀽</div>
+ <div style="display: flex">
+ <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>
+ <a-radio-button :value="6"> 閿�鍞噾棰� </a-radio-button>
+ </a-radio-group>
+ <DataRePieChart
+ style="width: 100%"
+ domId="oilTypePie"
+ ref="oilTypePieRef"
+ :chartData="oilTypePieData"
+ ></DataRePieChart>
+ </div>
+ </div>
+ </div>
<TopTenCustomers
:customerData="customerObj"
:typeOneTotal="customerOneTotal"
@@ -274,6 +305,7 @@
description: '鏁版嵁鎶ヨ〃锛堝姞娌圭珯锛�',
vehicleTypeSpecies: 1,
fuelingStationSpecies: 2,
+ oilTypeSpecies: 5,
searchWay: '1',
isContrast: false,
activeTime: '',
@@ -288,6 +320,8 @@
vehicleTypePieData: {}, //杞﹀瀷鍒嗘瀽楗煎浘鏁版嵁
fuelLevelLineData: {}, //鍔犳补浣嶅垎鏋愭姌绾垮浘鏁版嵁
fuelLevelPieData: {}, //鍔犳补浣嶅垎鏋愰ゼ鍥炬暟鎹�
+ oilTypeLineData: {}, //娌瑰搧绫诲瀷鍒嗘瀽鎶樼嚎鍥炬暟鎹�
+ oilTypePieData: {}, //娌瑰搧绫诲瀷鍒嗘瀽楗煎浘鏁版嵁
vehicleTypeLineData: {}, //杞﹀瀷鍒嗘瀽鎶樼嚎鍥炬暟鎹�
trendAnalysisType: 0, //瓒嬪娍鍒嗘瀽閫夋嫨绫诲瀷
trendAnalysisUnit: 'DAYS', //瓒嬪娍鍒嗘瀽閫夋嫨鏃堕棿
@@ -375,6 +409,18 @@
{ title: '瀹㈡埛绫诲瀷', align: 'center', dataIndex: 'clientName' },
{ title: '绱鍔犳补娆℃暟', align: 'center', dataIndex: 'oilCount' },
{ title: '绱娌瑰搧閿�閲�', align: 'center', dataIndex: 'oilSum' },
+ ]
+ }
+ if (this.trendAnalysisType == 6) {
+ return [
+ commonIndexColumn,
+ { title: '杩涚珯鏃堕棿', align: 'center', dataIndex: 'startTime' },
+ { title: '杞︾墝鍙�', align: 'center', dataIndex: 'licenseNum' },
+ { title: '琛屼负绫诲瀷', align: 'center', dataIndex: 'behaviorText' },
+ { title: '鍔犳补浣�', align: 'center', dataIndex: 'oilPosition' },
+ { title: '娌瑰搧閿�閲�', align: 'center', dataIndex: 'oilVolume' },
+ { title: '閿�鍞噾棰�(鍏�)', align: 'center', dataIndex: 'totalAmount' },
+ { title: '閫氳繃鐜�(鍒�)', align: 'center', dataIndex: 'spandTime' },
]
}
return [
@@ -473,10 +519,46 @@
this.fuelingStationSpecies = e.target.value
this.getFuelingStationPieData()
},
+ //鑾峰彇娌瑰搧绫诲瀷楗煎浘鏁版嵁
+ getOilTypePieData() {
+ postAction('/jyz/dataTable/statFan', {
+ orgCode: this.selectTreeObj.orgCode,
+ startTime: this.startTime,
+ endTime: this.endTime,
+ type: this.oilTypeSpecies,
+ }).then((res) => {
+ console.log(res)
+ this.oilTypePieData = res.result
+ this.$nextTick(() => {
+ this.$refs.oilTypePieRef.setChart()
+ })
+ })
+ },
+ //鑾峰彇娌瑰搧绫诲瀷鏌辩姸鍥炬暟鎹�
+ 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) {
let val = e.target.value
- if (val == 0 || val == 2 || val == 3 || val == 5) {
+ if (val == 0 || val == 2 || val == 3 || val == 5 || val == 6) {
this.trendAnalysisChartShowPercent = true
} else {
this.trendAnalysisChartShowPercent = false
@@ -630,6 +712,8 @@
this.getVehicleTypeLineData()
this.getVehicleStationPieData()
this.getFuelingStationPieData()
+ this.getOilTypePieData()
+ this.getOilTypeLineData()
this.getTrendAnalysis()
this.getOilFreqCompareData()
},
@@ -640,6 +724,8 @@
this.getVehicleTypeLineData()
this.getVehicleStationPieData()
this.getFuelingStationPieData()
+ this.getOilTypePieData()
+ this.getOilTypeLineData()
this.getTrendAnalysis()
},
},
@@ -647,6 +733,26 @@
created() {
this.initData()
},
+ mounted() {
+ this.$nextTick(() => {
+ setTimeout(() => {
+ const scrollTarget = localStorage.getItem('scrollToTarget')
+ if (scrollTarget) {
+ const element = document.getElementById(scrollTarget)
+ if (element) {
+ element.scrollIntoView({ behavior: 'smooth', block: 'center' })
+ localStorage.removeItem('scrollToTarget')
+ }
+ }
+ const trendType = localStorage.getItem('trendAnalysisType')
+ if (trendType) {
+ this.trendAnalysisType = parseInt(trendType)
+ localStorage.removeItem('trendAnalysisType')
+ this.getTrendAnalysis()
+ }
+ }, 500)
+ })
+ },
}
</script>
<style scoped lang="less">
--
Gitblit v1.8.0