From 009b81b7074cd2655dff9dfb50ba29bd6c233aaa 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, 26 May 2023 10:44:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E8=96=AA=E8=B5=84=E6=A1=A3?= =?UTF-8?q?=E6=A1=88=E5=88=97=E8=A1=A8=E6=94=B9=E9=80=A0=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/payrollFiles/index.js | 132 ++++++------------ .../hrmSalary/pages/payrollFiles/index.less | 1 + 2 files changed, 40 insertions(+), 93 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/payrollFiles/index.js b/pc4mobx/hrmSalary/pages/payrollFiles/index.js index f3010961..d20192a3 100644 --- a/pc4mobx/hrmSalary/pages/payrollFiles/index.js +++ b/pc4mobx/hrmSalary/pages/payrollFiles/index.js @@ -22,7 +22,7 @@ import { WeaTop } from "ecCom"; import { WeaTableNew } from "comsMobx"; -import { Button, Dropdown, Menu, message, Modal, Popover, Spin } from "antd"; +import { Button, Dropdown, Menu, message, Modal, Spin } from "antd"; import ImportMenu from "./components/importMenu"; import ExportMenu from "./components/exportMenu"; import AllWithoutPay from "./components/allWithoutPay"; @@ -167,25 +167,36 @@ class Index extends Component { ellipsis: true })); const { type, payload: { id, params } = {} } = data; - const { dataSource, pageInfo } = this.state; + const { dataSource, pageInfo, selectedKey, selectedRowKeys } = this.state; if (type === "init") { this.postMessageToChild({ - columns, dataSource, showOperateBtn, - showSum: false, pageInfo, pointerXY: window.pointerXY + columns, dataSource, showOperateBtn, selectedKey, + showSum: false, pageInfo, selectedRowKeys }); } else if (type === "turn") { if (id === "PAGEINFO") { const { pageNum: current, size: pageSize } = params; - console.log(current, pageSize); - } else if (id === "USERCARD") { + this.setState({ pageInfo: { ...pageInfo, current, pageSize } }, () => this.query()); + } else if (id === "EDIT") { + const { record } = params; + this.handleEdit(record); + } else if (id === "MOREOPT") { + const { id, event: e } = params; + this.handleMenuClick(e, id); + } else if (id === "CANCELSTOP") { + const { id } = params; + this.cancelStop(id); + } else if (id === "ROWSELECTION") { + const { selectedRowKeys } = params; + this.setState({ selectedRowKeys }); } } }; postMessageToChild = (payload) => { const childFrameObj = document.getElementById("atdTable"); - const { dataSource, columns, showSum, pageInfo } = payload; + const { dataSource, columns, showSum, pageInfo, showOperateBtn, selectedKey, selectedRowKeys } = payload; childFrameObj && childFrameObj.contentWindow.postMessage(JSON.stringify({ - dataSource, columns, showSum, pageInfo + dataSource, columns, showSum, pageInfo, showOperateBtn, selectedKey, selectedRowKeys }), "*"); }; @@ -227,7 +238,7 @@ class Index extends Component { }; queryList = (url) => { const { loading, pageInfo, searchItemsValue } = this.state; - const { payrollFilesStore: { tableStore, queryList } } = this.props; + const { payrollFilesStore: { tableStore, queryList }, taxAgentStore: { showOperateBtn } } = this.props; const payload = { ...pageInfo }; this.setState({ loading: { ...loading, query: true } @@ -481,85 +492,18 @@ class Index extends Component { return []; }; getColumns = () => { - const { selectedKey } = this.state; const { payrollFilesStore: { tableStore }, taxAgentStore: { showOperateBtn } } = this.props; - let columns = _.filter(toJS(tableStore.columns), (item) => item.display === "true"); - return _.map([ - ...columns], item => { - if (item.dataIndex === "username") { - return { - ...item, - render: (text, record) => { - return window.pointerXY(e)} - className="ellipsis" - title={text} - > - {text} - ; - } - }; - } else if (item.dataIndex === "operate") { - return { - ...item, - render: (text, record) => { - if (!showOperateBtn) { - return
; - } else { - if (selectedKey === "pending") { - return