diff --git a/pc4mobx/hrmSalary/apis/ruleconfig.js b/pc4mobx/hrmSalary/apis/ruleconfig.js index b5f4f87f..f52953bb 100644 --- a/pc4mobx/hrmSalary/apis/ruleconfig.js +++ b/pc4mobx/hrmSalary/apis/ruleconfig.js @@ -1,5 +1,5 @@ import { WeaTools } from "ecCom"; -import { postFetch } from "../util/request"; +import { postExportFetch, postFetch } from "../util/request"; //通用字典表 {enumClass:""} export const commonEnumList = (params) => { @@ -75,3 +75,7 @@ export const reportGetForm = params => { export const saveSalarySendFeedback = (params) => { return postFetch("/api/bs/hrmsalary/sys/saveSalarySendFeedback", params); }; +// 数据分析列表导出 +export const exportDataReport = (params) => { + return postExportFetch("/api/bs/hrmsalary/report/statistics/report/exportData", params); +}; diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js index 2fc4c28b..37581080 100644 --- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js +++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js @@ -5,7 +5,7 @@ * Date: 2023/4/21 */ import React, { Component } from "react"; -import { Spin } from "antd"; +import { message, Spin } from "antd"; import { WeaEchart, WeaLocaleProvider } from "ecCom"; import RightOptions from "./rightOptions"; import ChartsRangeSettingsModal from "./chartsRangeSettingsModal"; @@ -205,6 +205,11 @@ class ReportContent extends Component { }).catch(() => this.setState({ loading: false })); }; handleChangeChartOpts = (chartsType, viewType) => { + const { loading } = this.state; + if (loading) { + message.info(getLabel(111, "列表正在加载中,请稍后")); + return; + } this.setState({ chartsInfo: {} }); if (this.refs.chart && viewType !== "setting" && viewType !== "dataView" && !this.state.rangSet.visible) this.refs.chart.clear(); const { report: { id: reportId } } = this.props; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js index 82f935e5..4d01e7c0 100644 --- a/pc4mobx/hrmSalary/pages/reportView/index.js +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -6,13 +6,12 @@ */ import React, { Component } from "react"; import { inject, observer } from "mobx-react"; -import { WeaLeftRightLayout, WeaLocaleProvider, WeaSelect, WeaTop } from "ecCom"; +import { WeaLeftRightLayout, WeaLoadingGlobal, WeaLocaleProvider, WeaSelect, WeaTop } from "ecCom"; import { message, Modal } from "antd"; import LeftTab from "./components/leftTab"; import ReportContent from "./components/reportContent"; import StatisticalMicroSettingsSlide, { getSalaryMonthValue } from "./components/statisticalMicroSettingsSlide"; -import { reportGetForm, reportStatisticsReportSave } from "../../apis/ruleconfig"; -import { convertToUrlString } from "../../util/url"; +import { exportDataReport, reportGetForm, reportStatisticsReportSave } from "../../apis/ruleconfig"; import TopBtns from "./components/topBtns"; import "./index.less"; @@ -92,6 +91,10 @@ class Index extends Component { * Date: 2023/4/24 */ exportData = () => { + if (this.reportRef.state.loading) { + message.info(getLabel(111, "列表正在加载中,请稍后")); + return; + } const { report } = this.state; const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = report; const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType); @@ -99,7 +102,8 @@ class Index extends Component { id, dimensionId, isShare, salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01" }; - window.open(`${window.location.origin}/api/bs/hrmsalary/report/statistics/report/exportData?${convertToUrlString(payload)}`, "_blank"); + WeaLoadingGlobal.start(); + const promise = exportDataReport(payload); }; render() {