From 33ac08515e8f547fab12d9af45f7077d67fba10d 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, 1 Mar 2023 09:05:57 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js | 10 +++++++--- pc4mobx/hrmSalary/pages/salaryItem/testModal.js | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js index bf7b51d9..2d7b1782 100644 --- a/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js +++ b/pc4mobx/hrmSalary/pages/salaryItem/formalFormModal.js @@ -12,6 +12,7 @@ export default class FormalFormModal extends React.Component { constructor(props) { super(props); this.state = { + formalua: false, //是否删除操作过公式数据 validateType: "", returnType: "", value: "", @@ -107,6 +108,7 @@ export default class FormalFormModal extends React.Component { const index = value.lastIndexOf("{", end - 1); const currentValue = value.substring(index, end); this.setState({ + formalua: true, value: value.replace(currentValue, "") }, () => { if (propsTextarea.setSelectionRange) { @@ -141,7 +143,7 @@ export default class FormalFormModal extends React.Component { this.parameters = []; } this.setState({ - value + value, formalua: true }); } @@ -209,6 +211,7 @@ export default class FormalFormModal extends React.Component { referenceType: this.referenceType == "" ? this.props.valueType == "2" ? "formula" : this.props.valueType == "3" ? "sql" : "" : this.referenceType }; saveFormual(params).then(data => { + this.setState({ formalua: false }); this.props.onSaveFormal(data); this.props.onCancel(); }); @@ -319,13 +322,13 @@ export default class FormalFormModal extends React.Component { render() { const { salaryItemStore } = this.props; const { searchGroup, searchFields } = salaryItemStore; - const { value, formulaDatasourceList, extendParam, testVisible, showTestVal } = this.state; + const { value, formulaDatasourceList, extendParam, testVisible, showTestVal, formalua } = this.state; const title =
{`${(this.props.valueType == 2 || this.props.valueType === "FORMULA") ? "函数" : "SQL"}公式`}
{ value &&