From d0aa6e93a01a5b5712ff14f652075588ce125aaf 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, 20 Oct 2023 10:27:00 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8B=93=E6=89=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 3 +++ .../pages/salaryItemDiagram/index.js | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index af5bbfb0..3311b26c 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -42,6 +42,7 @@ import MySalaryView from "./pages/mySalary/mySalaryView"; import WatermarkPreview from "./pages/payroll/watermarkPreview"; import ExternalPersonManage from "./pages/externalPersonManage"; import AdjustSalaryManage from "./pages/adjustSalaryManage"; +import SalaryItemDiagram from "./pages/salaryItemDiagram"; import stores from "./stores"; import "./style/index"; @@ -95,6 +96,7 @@ const DataAcquisition = (props) => props.children; // reportView 薪酬报表查看 // externalPersonManage 非系统人员管理 // adjustSalaryManage 档案管理 +// salaryItemDiagram 薪资档案拓扑图 const Routes = ( + + ); + } +} + +export default Index; From 235e7cc6f02de3efb09dea2966c051ab4202a782 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, 27 Oct 2023 10:43:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8B=93=E6=89=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 3 - .../components/salaryEditCalc/diagramModal.js | 59 +++++++++++++++++++ .../salaryEditCalc/editCalcTable.js | 25 ++++++-- .../doCalc/components/salaryEditCalc/index.js | 2 +- .../pages/salaryItemDiagram/index.js | 2 +- 5 files changed, 82 insertions(+), 9 deletions(-) create mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/diagramModal.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index 3311b26c..af5bbfb0 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -42,7 +42,6 @@ import MySalaryView from "./pages/mySalary/mySalaryView"; import WatermarkPreview from "./pages/payroll/watermarkPreview"; import ExternalPersonManage from "./pages/externalPersonManage"; import AdjustSalaryManage from "./pages/adjustSalaryManage"; -import SalaryItemDiagram from "./pages/salaryItemDiagram"; import stores from "./stores"; import "./style/index"; @@ -96,7 +95,6 @@ const DataAcquisition = (props) => props.children; // reportView 薪酬报表查看 // externalPersonManage 非系统人员管理 // adjustSalaryManage 档案管理 -// salaryItemDiagram 薪资档案拓扑图 const Routes = ( - { + const { type } = data; + if (type === "initDiagram") this.postMessageToChild(this.props); + }; + + componentWillUnmount() { + window.removeEventListener("message", this.handleReceive, false); + } + + postMessageToChild = (payload = {}) => { + const { width, height } = this.diagramRef.state.style; + const i18n = { + "公式": getLabel(18125, "公式") + }; + const childFrameObj = document.getElementById("topologyDiagram"); + childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, width, height, i18n }), "*"); + }; + + render() { + return ( + this.diagramRef = dom} + scalable hasScroll className="diagramDialog" initLoadCss + title={getLabel(111, "拓扑图")} + style={{ + width: 1150, + height: 850, + minHeight: 200, + minWidth: 380, + maxHeight: "90%", + maxWidth: "90%", + overflow: "hidden", + transform: "translate(0px, 0px)" + }} + > + + + ); + } +} + +export default DiagramModal; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index 36198c34..a09a5052 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -11,6 +11,7 @@ import { inject, observer } from "mobx-react"; import { acctResultList, updateLockStatus } from "../../../../../apis/calculate"; import ProgressModal from "../../../../../components/progressModal"; import EditSalaryCalcSlide from "./editSalaryCalcSlide"; +import DiagramModal from "./diagramModal"; const getLabel = WeaLocaleProvider.getLabel; @@ -22,7 +23,8 @@ class EditCalcTable extends Component { this.state = { loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], progressVisible: false, progress: 0, - salaryCalcSlide: { visible: false, id: "" } + salaryCalcSlide: { visible: false, id: "" }, + diagramModal: { visible: false, salaryItemId: "", salarySobId: "" } }; this.timerLock = null; } @@ -59,13 +61,24 @@ class EditCalcTable extends Component { salaryCalcSlide: { visible: true, id: salaryCalcId } }); break; + case "DIAGRAM": + const { salarySobId } = this.props; + const { diagramModal } = this.state; + this.setState({ diagramModal: { ...diagramModal, ...params, visible: true, salarySobId } }); + break; default: break; } } }; updateLockStatus = (payload) => { - const { lockStatus } = payload; + const { salarySobId } = this.props; + const { diagramModal } = this.state; + const { lockStatus, salaryItemId } = payload; + if (lockStatus === "DIAGRAM") { + this.setState({ diagramModal: { ...diagramModal, visible: true, salarySobId, salaryItemId } }); + return; + } Modal.confirm({ title: getLabel(131329, "信息确认"), content:
@@ -125,7 +138,7 @@ class EditCalcTable extends Component { "当前状态未锁定,点击锁定": getLabel(111, "当前状态未锁定,点击锁定"), "共": getLabel(18609, "共"), "条": getLabel(18256, "条"), "总计": getLabel(523, "总计"), "批量解锁": getLabel(111, "批量解锁"), - "批量锁定": getLabel(111, "批量锁定") + "批量锁定": getLabel(111, "批量锁定"), "查看拓扑图": getLabel(111, "查看拓扑图") }; const childFrameObj = document.getElementById("atdTable"); childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, i18n }), "*"); @@ -160,7 +173,7 @@ class EditCalcTable extends Component { }; render() { - const { loading, progressVisible, progress, salaryCalcSlide } = this.state; + const { loading, progressVisible, progress, salaryCalcSlide, diagramModal } = this.state; return (
@@ -177,6 +190,10 @@ class EditCalcTable extends Component { id: "" } }, () => isFresh === "true" && this.queryCalcResultList())}/> + { + diagramModal.visible && + this.setState({ diagramModal: { visible: false } })}/> + } { progressVisible &&
- this.calcTableRef = dom} + this.calcTableRef = dom} salarySobId={salarySobCycle.salarySobId} {...this.props} showTotalCell={showTotalCell} onShowFormulaTd={this.handleShowFormulaTa}/>
diff --git a/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js b/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js index 6de256d3..51e16088 100644 --- a/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js @@ -13,7 +13,7 @@ class Index extends Component { style={{ border: 0, width: "100%", height: "100%" }} src="http://localhost:7607/#/salaryItemDiagram" // src="/spa/hrmSalary/hrmSalaryCalculateDetail/index.html#/salaryItemDiagram" - id="atdTable" + id="topologyDiagram" /> ); } From eed8d3a5bdd97143c31281aa32e6e98241cbcc1a 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, 27 Oct 2023 16:14:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feature/2.9.42310.01-=E8=96=AA=E8=B5=84?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8B=93=E6=89=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/index.js | 2 + .../components/salaryEditCalc/diagramModal.js | 59 ------------------- .../salaryEditCalc/editCalcTable.js | 17 ++---- .../components/ledgerSalaryItemTable.js | 8 ++- .../ledgerPage/components/ledgerSlide.js | 2 +- .../pages/salaryItemDiagram/index.js | 4 +- pc4mobx/hrmSalary/pages/topologyMap/index.js | 45 ++++++++++++++ 7 files changed, 62 insertions(+), 75 deletions(-) delete mode 100644 pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/diagramModal.js create mode 100644 pc4mobx/hrmSalary/pages/topologyMap/index.js diff --git a/pc4mobx/hrmSalary/index.js b/pc4mobx/hrmSalary/index.js index af5bbfb0..115db668 100644 --- a/pc4mobx/hrmSalary/index.js +++ b/pc4mobx/hrmSalary/index.js @@ -42,6 +42,7 @@ import MySalaryView from "./pages/mySalary/mySalaryView"; import WatermarkPreview from "./pages/payroll/watermarkPreview"; import ExternalPersonManage from "./pages/externalPersonManage"; import AdjustSalaryManage from "./pages/adjustSalaryManage"; +import TopologyMap from "./pages/topologyMap"; import stores from "./stores"; import "./style/index"; @@ -168,6 +169,7 @@ const Routes = ( + ); diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/diagramModal.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/diagramModal.js deleted file mode 100644 index 8f74a8c1..00000000 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/diagramModal.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Author: 黎永顺 - * name: 薪资项目拓扑图-查看 - * Description: - * Date: 2023/10/26 - */ -import React, { Component } from "react"; -import { WeaDialog, WeaLocaleProvider } from "ecCom"; -import SalaryItemDiagram from "../../../../salaryItemDiagram"; - -const getLabel = WeaLocaleProvider.getLabel; - -class DiagramModal extends Component { - componentDidMount() { - window.addEventListener("message", this.handleReceive, false); - } - - handleReceive = async ({ data }) => { - const { type } = data; - if (type === "initDiagram") this.postMessageToChild(this.props); - }; - - componentWillUnmount() { - window.removeEventListener("message", this.handleReceive, false); - } - - postMessageToChild = (payload = {}) => { - const { width, height } = this.diagramRef.state.style; - const i18n = { - "公式": getLabel(18125, "公式") - }; - const childFrameObj = document.getElementById("topologyDiagram"); - childFrameObj.contentWindow.postMessage(JSON.stringify({ ...payload, width, height, i18n }), "*"); - }; - - render() { - return ( - this.diagramRef = dom} - scalable hasScroll className="diagramDialog" initLoadCss - title={getLabel(111, "拓扑图")} - style={{ - width: 1150, - height: 850, - minHeight: 200, - minWidth: 380, - maxHeight: "90%", - maxWidth: "90%", - overflow: "hidden", - transform: "translate(0px, 0px)" - }} - > - - - ); - } -} - -export default DiagramModal; diff --git a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js index a09a5052..9a460c53 100644 --- a/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js +++ b/pc4mobx/hrmSalary/pages/calculate/doCalc/components/salaryEditCalc/editCalcTable.js @@ -11,7 +11,6 @@ import { inject, observer } from "mobx-react"; import { acctResultList, updateLockStatus } from "../../../../../apis/calculate"; import ProgressModal from "../../../../../components/progressModal"; import EditSalaryCalcSlide from "./editSalaryCalcSlide"; -import DiagramModal from "./diagramModal"; const getLabel = WeaLocaleProvider.getLabel; @@ -23,8 +22,7 @@ class EditCalcTable extends Component { this.state = { loading: false, pageInfo: { current: 1, pageSize: 10, total: 0 }, selectedRowKeys: [], progressVisible: false, progress: 0, - salaryCalcSlide: { visible: false, id: "" }, - diagramModal: { visible: false, salaryItemId: "", salarySobId: "" } + salaryCalcSlide: { visible: false, id: "" } }; this.timerLock = null; } @@ -63,8 +61,8 @@ class EditCalcTable extends Component { break; case "DIAGRAM": const { salarySobId } = this.props; - const { diagramModal } = this.state; - this.setState({ diagramModal: { ...diagramModal, ...params, visible: true, salarySobId } }); + const { salaryItemId: itemid, acctEmpId } = params; + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${itemid}?acctEmpId=${acctEmpId}`, "_blank"); break; default: break; @@ -73,10 +71,9 @@ class EditCalcTable extends Component { }; updateLockStatus = (payload) => { const { salarySobId } = this.props; - const { diagramModal } = this.state; const { lockStatus, salaryItemId } = payload; if (lockStatus === "DIAGRAM") { - this.setState({ diagramModal: { ...diagramModal, visible: true, salarySobId, salaryItemId } }); + window.open(`/spa/hrmSalary/static/index.html#/main/hrmSalary/topologyView/${salarySobId}/${salaryItemId}`, "_blank"); return; } Modal.confirm({ @@ -173,7 +170,7 @@ class EditCalcTable extends Component { }; render() { - const { loading, progressVisible, progress, salaryCalcSlide, diagramModal } = this.state; + const { loading, progressVisible, progress, salaryCalcSlide } = this.state; return (
@@ -190,10 +187,6 @@ class EditCalcTable extends Component { id: "" } }, () => isFresh === "true" && this.queryCalcResultList())}/> - { - diagramModal.visible && - this.setState({ diagramModal: { visible: false } })}/> - } { progressVisible && { + const { salarySobId, salaryItemId } = record; + return {text}; + } }, { title: diff --git a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js index 8b2e350e..cb768c92 100644 --- a/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js +++ b/pc4mobx/hrmSalary/pages/ledgerPage/components/ledgerSlide.js @@ -266,7 +266,7 @@ class LedgerSlide extends Component { className="slideOuterWrapper" visible={visible} top={0} - width={65} + width={100} height={100} direction="right" measure="%" diff --git a/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js b/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js index 51e16088..710a6387 100644 --- a/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js +++ b/pc4mobx/hrmSalary/pages/salaryItemDiagram/index.js @@ -11,8 +11,8 @@ class Index extends Component { return (