From 3a8dd06e3c6760f8d811fc14cd6b08ac77c89c47 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, 30 Jun 2023 10:17:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A7=E5=93=81-=E5=B7=A5=E8=B5=84=E5=8D=95?= =?UTF-8?q?=E6=B0=B4=E5=8D=B0=E9=A2=84=E8=A7=88=E5=92=8C=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98=E5=A4=84?= =?UTF-8?q?=E7=90=86=EF=BC=8C=E8=B4=A6=E5=A5=97=E9=A1=B9=E7=9B=AE=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E9=9A=90=E8=97=8F=E5=88=86=E7=BB=84=E6=9C=AA=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=EF=BC=8C=C2=A0=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=98=8E=E7=BB=86=E6=97=B6=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AF=B9=E9=BD=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/dataAcquisition/components/index.less | 6 +++--- .../dataAcquisition/components/tableRecord.js | 15 +++++++++++++-- pc4mobx/hrmSalary/pages/ledger/slideBaseForm.js | 2 +- .../ledgerPage/components/ledgerBaseSetting.js | 2 +- .../components/ledgerSalaryItemPreviewModal.js | 2 +- .../hrmSalary/pages/payroll/watermarkPreview.js | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less b/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less index 80d08cf2..4d16b78a 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/components/index.less @@ -2,12 +2,12 @@ .accumulated { .wea-form-cell-wrapper { & > div:first-child { - width: 10% !important; + height: 46px !important; line-height: 46px; } & > div:nth-child(2) { - width: 40% !important; + //width: 40% !important; .wea-form-item-wrapper { display: flex !important; @@ -20,7 +20,7 @@ } & > div:last-child { - width: 40% !important; + //width: 40% !important; } } } diff --git a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js index f3c9e716..9db08fac 100644 --- a/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js +++ b/pc4mobx/hrmSalary/pages/dataAcquisition/components/tableRecord.js @@ -18,6 +18,7 @@ class TableRecord extends Component { loading: { query: false }, + width: 0, dataSource: [], columns: [], selectedRowKeys: [], @@ -37,13 +38,23 @@ class TableRecord extends Component { } componentDidMount() { + this.setState({ width: window.innerWidth }); this.convertData(this.props); + window.addEventListener("resize", this.resizeWidth); + } + + componentWillUnmount() { + window.removeEventListener("resize", this.resizeWidth); } componentWillReceiveProps(nextProps, nextContext) { this.convertData(nextProps); } + resizeWidth = (e) => { + this.setState({ width: e.target.innerWidth }); + }; + convertData = (props) => { const { recordPayload } = this.state; const { record, screenParams } = props; @@ -116,7 +127,7 @@ class TableRecord extends Component { render() { const { className, screenParams, taxAgentOption, record } = this.props; - const { columns, dataSource, loading, selectedRowKeys, pageInfo, recordPayload } = this.state; + const { columns, dataSource, loading, selectedRowKeys, pageInfo, recordPayload, width } = this.state; const rowSelection = { selectedRowKeys, onChange: (selectedRowKeys) => this.setState({ selectedRowKeys }) @@ -172,7 +183,7 @@ class TableRecord extends Component {