From 4d2058b180951384bc3d6cfb8003fdb32edff7ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Thu, 11 Jul 2024 15:05:00 +0800
Subject: [PATCH 1/2] hotfix/2.14.2.2406.02
---
.../reportView/components/reportContent.js | 22 +++++++++++++------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js
index a7808410..98486950 100644
--- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js
+++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js
@@ -6,7 +6,7 @@
*/
import React, { Component } from "react";
import { Spin } from "antd";
-import { WeaEchart } from "ecCom";
+import { WeaEchart, WeaLocaleProvider } from "ecCom";
import RightOptions from "./rightOptions";
import ChartsRangeSettingsModal from "./chartsRangeSettingsModal";
import { mapBarOptions, mapLineOptions, mapPieOptions } from "./condition";
@@ -15,6 +15,8 @@ import PovitpivotChartModal from "./povitpivotChartModal";
import { getSalaryMonthValue } from "./statisticalMicroSettingsSlide";
import "../index.less";
+const getLabel = WeaLocaleProvider.getLabel;
+
class ReportContent extends Component {
constructor(props) {
super(props);
@@ -33,7 +35,8 @@ class ReportContent extends Component {
rangSet: {
visible: false, reportId: "",
rangeVal: {}
- }
+ },
+ pageInfo: { current: 0, pageSize: 10, total: 0 }
};
}
@@ -76,24 +79,29 @@ class ReportContent extends Component {
}
};
postMessageToChild = (payload) => {
+ const i18n = {
+ "共": getLabel(18609, "共"), "条": getLabel(18256, "条"),
+ "总计": getLabel(523, "总计")
+ };
const childFrameObj = document.getElementById("atdTable");
const { dataSource, columns, showSum, countResult } = payload;
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({
- dataSource, columns, showSum, countResult
+ dataSource, columns, showSum, countResult, i18n
}), "*");
};
reportStatisticsReportGetData = (params) => {
+ const { pageInfo } = this.state;
const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = params;
const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType);
const payload = {
- id, dimensionId, isShare,
+ id, dimensionId, isShare, ...pageInfo,
salaryStartMonth: (salaryStartMonth || start) + "-01", salaryEndMonth: (salaryEndMonth || end) + "-01"
};
this.setState({ loading: true });
reportStatisticsReportGetData(payload).then(({ status, data }) => {
this.setState({ loading: false });
if (status && id.toString() === data.reportId.toString()) {
- const { countResult, columns, pageInfo: { list } } = data;
+ const { countResult, columns, pageInfo: { list, pageNum, pageSize, total } } = data;
this.setState({
countResult,
columns: _.map(columns, it => ({
@@ -244,8 +252,8 @@ class ReportContent extends Component {
viewType === "dataView" ?
: this.renderCharts()
}
From 8df63d4a8c13660430d4b695b13566620cadf91a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com>
Date: Mon, 15 Jul 2024 11:35:53 +0800
Subject: [PATCH 2/2] hotfix/2.14.2.2406.02
---
.../reportView/components/reportContent.js | 26 ++++++++++---------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js
index 98486950..2fc4c28b 100644
--- a/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js
+++ b/pc4mobx/hrmSalary/pages/reportView/components/reportContent.js
@@ -36,7 +36,7 @@ class ReportContent extends Component {
visible: false, reportId: "",
rangeVal: {}
},
- pageInfo: { current: 0, pageSize: 10, total: 0 }
+ pageInfo: { current: 1, pageSize: 10, total: 0 }
};
}
@@ -59,9 +59,9 @@ class ReportContent extends Component {
handleReceive = ({ data }) => {
const { type, payload: { id, params } = {} } = data;
if (type === "init") {
- const { columns, countResult, dataSource } = this.state;
+ const { columns, countResult, dataSource, pageInfo } = this.state;
this.postMessageToChild({
- columns, countResult, dataSource,
+ columns, countResult, dataSource, pageInfo,
showSum: !_.isEmpty(countResult)
});
} else if (type === "turn") {
@@ -75,6 +75,8 @@ class ReportContent extends Component {
visible: true, id: pivotId, dimensionId, dimensionValue, isShare
}
});
+ } else if (id === "PAGEINFO") {
+ this.setState({ pageInfo: { ...this.state.pageInfo, ...params } }, () => this.reportStatisticsReportGetData(this.props.report));
}
}
};
@@ -84,14 +86,14 @@ class ReportContent extends Component {
"总计": getLabel(523, "总计")
};
const childFrameObj = document.getElementById("atdTable");
- const { dataSource, columns, showSum, countResult } = payload;
+ const { dataSource, columns, showSum, countResult, pageInfo } = payload;
childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({
- dataSource, columns, showSum, countResult, i18n
+ dataSource, columns, showSum, countResult, i18n, pageInfo
}), "*");
};
reportStatisticsReportGetData = (params) => {
const { pageInfo } = this.state;
- const { id, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = params;
+ const { id, dimension, dimensionId, isShare, timeType, salaryEndMonth: end, salaryStartMonth: start } = params;
const [salaryStartMonth, salaryEndMonth] = getSalaryMonthValue(timeType);
const payload = {
id, dimensionId, isShare, ...pageInfo,
@@ -103,7 +105,8 @@ class ReportContent extends Component {
if (status && id.toString() === data.reportId.toString()) {
const { countResult, columns, pageInfo: { list, pageNum, pageSize, total } } = data;
this.setState({
- countResult,
+ countResult, dataSource: list || [],
+ pageInfo: dimension === getLabel(111, "人员") ? { ...pageInfo, current: pageNum, pageSize, total } : null,
columns: _.map(columns, it => ({
...it,
dataIndex: it.column, width: it.width ? it.width + "px" : 150,
@@ -113,12 +116,11 @@ class ReportContent extends Component {
dataIndex: child.column, width: child.width ? child.width + "px" : 150,
title: child.text, align: "center"
})) : []
- })),
- dataSource: list || []
+ }))
}, () => {
this.postMessageToChild({
columns: this.state.columns, countResult: this.state.countResult,
- dataSource: this.state.dataSource,
+ dataSource: this.state.dataSource, pageInfo: this.state.pageInfo,
showSum: !_.isEmpty(this.state.countResult)
});
});
@@ -252,8 +254,8 @@ class ReportContent extends Component {
viewType === "dataView" ?
: this.renderCharts()
}