From cd1f2d9605c2e208bb7e70f5d3bc83b45a9ec8a6 Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期四, 18 六月 2026 15:16:53 +0800
Subject: [PATCH] feat: 产品规格带出产品大类
---
src/views/reportAnalysis/financialAnalysis/components/center-bottom.vue | 27 ++++++++++++++++++++-------
1 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/views/reportAnalysis/financialAnalysis/components/center-bottom.vue b/src/views/reportAnalysis/financialAnalysis/components/center-bottom.vue
index 1d15a39..a26e712 100644
--- a/src/views/reportAnalysis/financialAnalysis/components/center-bottom.vue
+++ b/src/views/reportAnalysis/financialAnalysis/components/center-bottom.vue
@@ -19,9 +19,11 @@
</template>
<script setup>
-import { ref, onMounted } from 'vue'
+import { ref } from 'vue'
import Echarts from '@/components/Echarts/echarts.vue'
import PanelHeader from './PanelHeader.vue'
+import { profitTrendAnalysis } from '@/api/viewIndex.js'
+import { usePolling } from '@/hooks/usePolling.js'
const chartStyle = { width: '100%', height: '150%' }
const grid = { left: '3%', right: '4%', bottom: '3%', top: '4%', containLabel: true }
@@ -70,11 +72,22 @@
const yAxis1 = [{ type: 'value', axisLabel: { color: '#B8C8E0' } }]
-onMounted(() => {
- // 鍏堢敤鏈湴鍋囨暟鎹紙鍚庣画濡傛湁鎺ュ彛鍙浛鎹級
- xAxis1.value[0].data = ['1鏈�', '2鏈�', '3鏈�', '4鏈�', '5鏈�', '6鏈�']
- barSeries1.value[0].data = [12000, 18000, 9000, 16000, 14000, 20000]
-})
+const fetchData = () => {
+ profitTrendAnalysis()
+ .then((res) => {
+ if (res.code === 200 && Array.isArray(res.data)) {
+ const list = res.data
+ xAxis1.value[0].data = list.map((d) => d.name)
+ barSeries1.value[0].data = list.map((d) => parseFloat(d.value) || 0)
+ }
+ })
+ .catch((err) => {
+ console.error('鑾峰彇鍒╂鼎瓒嬪娍鍒嗘瀽澶辫触:', err)
+ })
+}
+
+// 鍚姩杞锛屾瘡鍒嗛挓鍒锋柊涓�娆℃暟鎹�
+usePolling(fetchData)
</script>
<style scoped>
@@ -88,7 +101,7 @@
border: 1px solid #1a58b0;
padding: 18px;
width: 100%;
- height: 428px;
+ height: 432px;
}
</style>
--
Gitblit v1.9.3