From e0cb2008ffb01348b54a7370180a100f3c975877 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 06 二月 2026 10:49:24 +0800
Subject: [PATCH] Merge branch 'dev_New' into dev_天津军泰伟业
---
src/views/reportAnalysis/productionAnalysis/components/right-bottom.vue | 82 ++++++++++++++++++----------------------
1 files changed, 37 insertions(+), 45 deletions(-)
diff --git a/src/views/reportAnalysis/productionAnalysis/components/right-bottom.vue b/src/views/reportAnalysis/productionAnalysis/components/right-bottom.vue
index 95a4907..28de03b 100644
--- a/src/views/reportAnalysis/productionAnalysis/components/right-bottom.vue
+++ b/src/views/reportAnalysis/productionAnalysis/components/right-bottom.vue
@@ -28,29 +28,27 @@
import DateTypeSwitch from './DateTypeSwitch.vue'
import Echarts from '@/components/Echarts/echarts.vue'
-const dateType = ref(1) // 1=鍛� 2=鏈� 3=瀛e害
+const dateType = ref(1)
const chartStyle = {
width: '100%',
height: '140%',
}
-const grid = { left: '10%', right: '4%', bottom: '3%', top: '10%', containLabel: true }
+const grid = { left: '3%', right: '4%', bottom: '3%', top: '10%', containLabel: true }
const barLegend = {
show: true,
textStyle: { color: '#B8C8E0' },
- data: ['浜ч噺', '宸ヨ祫', '鍚堟牸鐜�'],
+ data: ['瀹屾垚鏁伴噺', '宸ヨ祫閲戦', '鍚堟牸鐜�'],
}
-// 鏌辩姸鍥撅細浜ч噺銆佸伐璧勶紱鎶樼嚎鍥撅細鍚堟牸鐜囷紙缁胯壊锛�
const chartSeries = ref([
{
- name: '浜ч噺',
+ name: '瀹屾垚鏁伴噺',
type: 'bar',
barWidth: 20,
barGap: '40%',
- yAxisIndex: 0,
emphasis: { focus: 'series' },
itemStyle: {
color: {
@@ -68,11 +66,10 @@
data: [],
},
{
- name: '宸ヨ祫',
+ name: '宸ヨ祫閲戦',
type: 'bar',
barGap: '40%',
barWidth: 20,
- yAxisIndex: 1,
emphasis: { focus: 'series' },
itemStyle: {
color: {
@@ -92,7 +89,7 @@
{
name: '鍚堟牸鐜�',
type: 'line',
- yAxisIndex: 2,
+ yAxisIndex: 1,
showSymbol: true,
symbol: 'circle',
symbolSize: 8,
@@ -103,31 +100,21 @@
},
])
-const tooltip = {
- trigger: 'axis',
- axisPointer: { type: 'cross' },
- formatter(params) {
- let result = params[0].axisValueLabel + '<br/>'
- params.forEach((item) => {
- let unit = '浠�'
- if (item.seriesName === '鍚堟牸鐜�') unit = '%'
- else if (item.seriesName === '宸ヨ祫') unit = '鍏�'
- result += `<div>${item.marker} ${item.seriesName}: ${item.value}${unit}</div>`
- })
- return result
- },
-}
-
const xAxis1 = ref([
{ type: 'category', axisTick: { show: false }, axisLabel: { color: '#B8C8E0' }, data: [] },
])
+
const yAxis1 = [
- { type: 'value', name: '浜ч噺(浠�)', position: 'left', axisLabel: { color: '#B8C8E0' }, nameTextStyle: { color: '#B8C8E0' } },
- { type: 'value', name: '宸ヨ祫(鍏�)', position: 'left', offset: 50, axisLabel: { color: '#B8C8E0' }, nameTextStyle: { color: '#B8C8E0' } },
+ {
+ type: 'value',
+ name: '鏁伴噺/閲戦',
+ axisLabel: { color: '#B8C8E0' },
+ nameTextStyle: { color: '#B8C8E0' },
+ // splitLine: { lineStyle: { color: 'rgba(184, 200, 224, 0.2)' } },
+ },
{
type: 'value',
name: '鍚堟牸鐜�(%)',
- position: 'right',
min: 0,
max: 100,
axisLabel: { color: '#B8C8E0', formatter: '{value}%' },
@@ -136,6 +123,19 @@
},
]
+const tooltip = {
+ trigger: 'axis',
+ axisPointer: { type: 'cross' },
+ formatter(params) {
+ let result = params[0].axisValueLabel + '<br/>'
+ params.forEach((item) => {
+ const unit = item.seriesName === '鍚堟牸鐜�' ? '%' : (item.seriesName === '宸ヨ祫閲戦' ? ' 鍏�' : ' 涓�')
+ result += `<div>${item.marker} ${item.seriesName}: ${item.value}${unit}</div>`
+ })
+ return result
+ },
+}
+
const handleDateTypeChange = () => {
fetchData()
}
@@ -143,28 +143,19 @@
const fetchData = () => {
productionAccountingAnalysis({ type: dateType.value })
.then((res) => {
- console.log('res ======> ', res)
+ if (res.code === 200 && Array.isArray(res.data)) {
+ const items = res.data
- if (!Array.isArray(res?.data)) return
-
- const items = res.data
-
- xAxis1.value[0].data = items.map(d => d.dateStr)
-
- // 浜ч噺
- chartSeries.value[0].data = items.map(d => Number(d.numberOfCompleted) || 0)
-
- // 宸ヨ祫
- chartSeries.value[1].data = items.map(d => Number(d.amount) || 0)
-
- // 鍚堟牸鐜�
- chartSeries.value[2].data = items.map(d => Number(d.passRate) || 0)
+ xAxis1.value[0].data = items.map(item => item.dateStr)
+ chartSeries.value[0].data = items.map(item => Number(item.numberOfCompleted) || 0)
+ chartSeries.value[1].data = items.map(item => Number(item.amount) || 0)
+ chartSeries.value[2].data = items.map(item => Number(item.passRate) || 0)
+ }
})
.catch((err) => {
- console.error('鑾峰彇浜ч噺銆佸伐璧勪笌鍚堟牸鐜囨暟鎹け璐�:', err)
+ console.error('鏁版嵁鍔犺浇澶辫触', err)
})
}
-
onMounted(() => {
fetchData()
@@ -191,5 +182,6 @@
padding: 18px;
width: 100%;
height: 449px;
+ box-sizing: border-box;
}
-</style>
+</style>
\ No newline at end of file
--
Gitblit v1.9.3