From 7c60a44e6699390e18f009641f06ddf80201b748 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, 20 Apr 2023 15:36:51 +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=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 5 +- .../components/reportList.js | 13 ++- .../components/statisticsModal.js | 2 +- .../pages/reportView/components/leftTab.js | 72 +++++++++++++ pc4mobx/hrmSalary/pages/reportView/index.js | 78 ++++++++++++++ pc4mobx/hrmSalary/pages/reportView/index.less | 100 ++++++++++++++++++ 6 files changed, 266 insertions(+), 4 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/reportView/components/leftTab.js create mode 100644 pc4mobx/hrmSalary/pages/reportView/index.js create mode 100644 pc4mobx/hrmSalary/pages/reportView/index.less diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 24931140..3037a01b 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -32,7 +32,8 @@ import SysConfig from "./pages/sysConfig"; import RuleConfig from "./pages/ruleConfig"; import Appconfig from "./pages/appConfig"; import FieldManagement from "./pages/fieldManagement"; -import AnalysisOfSalaryStatistics from "./pages/analysisOfSalaryStatistics" +import AnalysisOfSalaryStatistics from "./pages/analysisOfSalaryStatistics"; +import ReportView from "./pages/reportView"; import stores from "./stores"; import "./style/index"; @@ -80,6 +81,7 @@ const DataAcquisition = (props) => props.children; // appconfig 应用配置 // fieldManagement 字段管理 // analysisOfSalaryStatistics 薪酬统计分析 +// reportView 薪酬报表查看 const Routes = ( + ); diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js index 7ff65ad2..6510d5b1 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/reportList.js @@ -27,7 +27,7 @@ class ReportList extends Component { handleOptsClick = ({ key }, id, dimensionId) => { if (key === "delete") { - this.reportStatisticsReportDelete({ ids: id.split(",") }); + this.reportStatisticsReportDelete(id.split(",")); } else if (key === "edit") { this.props.onEdit("addReport", id); } @@ -56,6 +56,15 @@ class ReportList extends Component { } }); }; + /* + * Author: 黎永顺 + * Description: 报表查看 + * Params: + * Date: 2023/4/20 + */ + handleGoReportView = (id) => { + window.open(`${window.location.origin}/spa/hrmSalary/static/index.html#/main/hrmSalary/reportView?id=${id}`); + }; render() { const { dataSource } = this.state; @@ -65,7 +74,7 @@ class ReportList extends Component { _.isEmpty(dataSource) ?
{getLabel(111, "暂无数据")}
: _.map(dataSource, it => { const { reportName, dimension, id, dimensionId } = it; - return + return this.handleGoReportView(id)}>
diff --git a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js index fcddfaab..c8920887 100644 --- a/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js +++ b/pc4mobx/hrmSalary/pages/analysisOfSalaryStatistics/components/statisticsModal.js @@ -55,7 +55,7 @@ class StatisticsModal extends Component { return ( { + const { reportName, selectedKeys } = this.state; + const { onChangeTab } = this.props; + reportStatisticsReportList({ reportName }).then(({ status, data: reportList }) => { + if (status) this.setState({ reportList }, () => { + onChangeTab(_.find(this.state.reportList, it => it.id === selectedKeys[0])); + }); + }); + }; + + render() { + const { reportName, selectedKeys, reportList } = this.state; + const { onChangeTab } = this.props; + return ( +
+
+ this.setState({ reportName })} + placeholder={getLabel(111, "请输入报表名称")} onSearch={this.reportStatisticsReportList} + /> +
+ { + this.setState({ selectedKeys: key.split(",") }, () => { + onChangeTab(_.find(reportList, it => it.id === key)); + }); + }} + > + { + _.map(reportList, item => { + const { reportName, id } = item; + return {reportName}; + }) + } + +
+ ); + } +} + +export default LeftTab; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.js b/pc4mobx/hrmSalary/pages/reportView/index.js new file mode 100644 index 00000000..0b80f004 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/index.js @@ -0,0 +1,78 @@ +/* + * Author: 黎永顺 + * name: 薪酬报表查看 + * Description: + * Date: 2023/4/20 + */ +import React, { Component } from "react"; +import { WeaLeftRightLayout, WeaLocaleProvider, WeaSelect, WeaTop } from "ecCom"; +import LeftTab from "./components/leftTab"; +import { reportGetForm } from "../../apis/ruleconfig"; +import "./index.less"; + + +const { getLabel } = WeaLocaleProvider; + +class Index extends Component { + constructor(props) { + super(props); + this.state = { + report: {}, + dimensionList: [] + }; + } + + componentDidMount() { + this.reportGetForm(); + } + + reportGetForm = () => { + reportGetForm().then(({ status, data }) => { + if (status) { + const { statsDimOptions } = data; + this.setState({ + dimensionList: _.map(statsDimOptions, it => ({ key: it.id, showname: it.content })) + }); + } + }); + }; + + render() { + const { report, dimensionList } = this.state; + return ( + } + iconBgcolor="#F14A2D" + showDropIcon={false} + className="reportViewWrapper" + > + this.setState({ report })}/>} + > +
+
+
+
{report.reportName}
+
+
+
+ {getLabel(111, "统计维度")}: + +
+
+
+
+
+
+ {/* 内容区 */} + +
+
+
+ ); + } +} + +export default Index; diff --git a/pc4mobx/hrmSalary/pages/reportView/index.less b/pc4mobx/hrmSalary/pages/reportView/index.less new file mode 100644 index 00000000..8baa98f2 --- /dev/null +++ b/pc4mobx/hrmSalary/pages/reportView/index.less @@ -0,0 +1,100 @@ +.reportViewWrapper { + height: 100%; + display: flex; + flex-direction: column; + + .wea-new-top-content { + flex: 1; + + .leftTabWrapper { + background: #FFF; + height: 100%; + overflow-y: auto; + + .searchArea { + width: 100%; + height: 49px; + line-height: 49px; + padding: 0 6px; + + .wea-input-focus { + width: 100%; + } + } + + .ant-menu { + border-right-color: transparent !important; + + .ant-menu-item, .ant-menu-item { + border-left: 4px solid transparent; + border-right: none; + } + + .ant-menu-item-selected, .ant-menu-selected { + border-left: 4px solid #2db7f5; + background: #f5f5f5; + border-right: none; + } + + .ant-menu-item-active, .ant-menu-item:hover, .ant-menu-submenu-active, .ant-menu-submenu-title:hover { + background: #f5f5f5; + } + } + } + + .rightLayout { + .layoutHeader { + height: 50px; + + .layoutRow { + height: 100%; + display: flex; + align-content: center; + padding: 8px 16px; + background-color: #f9f9f9; + border-bottom: 1px solid #e5e5e5; + + .layoutCol { + flex: 1; + height: 100%; + display: flex; + align-items: center; + + .rightColTitle { + height: 100%; + display: flex; + align-items: center; + white-space: nowrap; + + .icon-coms02-currency { + font-size: 16px; + color: #2db7f5; + margin: 0 10px; + cursor: pointer; + } + + .dimension { + display: flex; + align-items: center; + + .wea-select { + width: 150px; + margin-left: 10px; + } + } + + .iconWrapper { + display: flex; + align-items: center; + } + } + } + + .layoutColRight { + justify-content: flex-end; + } + } + } + } + } +}