From 1693b9d3da13089a4d4bf4cf69198884afb7ce71 Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 12 Jun 2026 08:49:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=85=89=E5=AD=90=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=88=86=E6=9E=90/=E5=BA=93=E5=AD=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E3=80=81=E5=B7=A5=E5=BA=8F=E5=90=88=E6=A0=BC=E6=95=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/ppass_num.vue | 22 ++++++++++++++++++++++ src/views/statistics/stock_statistics.vue | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/views/statistics/ppass_num.vue b/src/views/statistics/ppass_num.vue index d1b37871..710cd9d4 100644 --- a/src/views/statistics/ppass_num.vue +++ b/src/views/statistics/ppass_num.vue @@ -274,8 +274,22 @@ export default { that.xAxisData = xAxisData; that.option.xAxis.data = that.xAxisData; that.option.series = seriesData; + that.$nextTick(() => { + that.resizeChart(xAxisData.length, nameData.length); + }); }); }, + resizeChart(xCount, materialCount) { + let chartDiv = document.getElementById("bachart1"); + if (!chartDiv) return; + let wrapper = chartDiv.parentElement; + let parentWidth = wrapper.clientWidth; + let groupWidth = Math.max(60, materialCount * 25 + 30); + let neededWidth = xCount * groupWidth + 80; + chartDiv.style.width = Math.max(parentWidth, neededWidth) + "px"; + let inst = this.$refs.echarts1 && this.$refs.echarts1.myChart; + if (inst) inst.resize(); + }, handleQuery() { if (this.queryDate !== "" && this.queryDate !== null) { if (this.queryType == "月") { @@ -357,4 +371,12 @@ export default { left: 4px; z-index: 10; } +.echarts-scroll { + width: 100%; + overflow-x: auto; + overflow-y: hidden; +} +.echarts-scroll > :deep(#bachart1) { + min-width: 100%; +} diff --git a/src/views/statistics/stock_statistics.vue b/src/views/statistics/stock_statistics.vue index 574cf4b6..69bf8836 100644 --- a/src/views/statistics/stock_statistics.vue +++ b/src/views/statistics/stock_statistics.vue @@ -28,7 +28,7 @@ :filter-method="filterModel1" filter-placement="bottom-end" /> -