From a83d261c206de5f3d4597e7af2528c43f8088fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E6=B0=B8=E9=A1=BA?= <971387674@qq.com> Date: Wed, 4 Jan 2023 11:39:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=96=AA=E8=B5=84=E9=A1=B9=E7=9B=AE=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js | 1 + pc4mobx/hrmSalary/pages/salaryItem/testModal.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index d0d52100..638f93d8 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -255,6 +255,7 @@ export default class FormalFormModal extends React.Component { this.parameters.push(parameterItem); let propsTextarea = this.contentProps.refs.textareaNormal.refs.input.refs.input; // 获取dom节点实例 let position = this.insertText(propsTextarea, fieldName); // 光标的位置 + this.forceUpdate(); } handleChangeTestValue = (record, value) => { diff --git a/pc4mobx/hrmSalary/pages/salaryItem/testModal.js b/pc4mobx/hrmSalary/pages/salaryItem/testModal.js index b53a6d55..dc5c8d76 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/testModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/testModal.js @@ -16,7 +16,7 @@ export default class TestModal extends React.Component { } componentWillReceiveProps(nextProps, nextContext) { - if (nextProps.parameters !== this.props.parameters && nextProps.parameters) { + if (nextProps.parameters) { this.setState({ testValue: nextProps.parameters }); @@ -27,6 +27,7 @@ export default class TestModal extends React.Component { }); } } + renderInputItem = () => { const { onChangeTestValue } = this.props; const { testValue } = this.state;