From ef46215d0fc7671c6cdb78622699968256469e35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Fri, 12 May 2023 16:51:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E8=96=AA=E9=85=AC=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E5=88=86=E6=9E=90=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/reportView/components/reportContent.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index b567e8e3..b69121cd 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -95,7 +95,7 @@ class ReportContent extends Component { } }).catch(() => this.setState({ loading: false })); }; - queryRangeSetting = (payload) => { + queryRangeSetting = (payload, isTab) => { const { dataSource, columns } = this.state; this.setState({ loading: true }); queryRangeSetting(payload).then(({ status, data }) => { @@ -108,11 +108,9 @@ class ReportContent extends Component { ...rangSet, rangeVal: data } - }, () => { - if (this.refs.chart) this.refs.chart.clear(); - if (this.refs.chart) this.refs.chart.paint(); }); if (id) { + if (!isTab) return; switch (viewType) { case "bar": this.setState({ @@ -150,6 +148,7 @@ class ReportContent extends Component { default: break; } + if (this.refs.chart) this.refs.chart.paint(); } else { this.setState({ chartsInfo: {} }); } @@ -157,12 +156,13 @@ class ReportContent extends Component { }).catch(() => this.setState({ loading: false })); }; handleChangeChartOpts = (chartsType, viewType) => { + if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear(); const { report: { id: reportId, dimensionId } } = this.props; const { rangSet } = this.state; viewType !== "setting" && this.setState({ chartsType, viewType }, () => { const { viewType, chartsType } = this.state; viewType !== "dataView" ? - this.queryRangeSetting({ reportId, chartsType }) : + this.queryRangeSetting({ reportId, chartsType }, true) : this.reportStatisticsReportGetData(reportId, dimensionId); }); viewType === "setting" && this.setState({ rangSet: { ...rangSet, visible: true, reportId } }, () => {