From 1c7d254d178171b154d5947d3e0b88c3f91ff1ce Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Thu, 2 Apr 2026 21:44:54 +0800 Subject: [PATCH] 1.特定字段dAdvanceReportQty'dAdvanceLockUpFei', 'dAdvanceMadeUpFei', 'iAdvanceLaminatingPaper',如果在模态框中,如果再就不调用离开存储过程 --- src/components/Common/CommonComponent/index.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+), 0 deletions(-) diff --git a/src/components/Common/CommonComponent/index.js b/src/components/Common/CommonComponent/index.js index 1e08915..95e5668 100644 --- a/src/components/Common/CommonComponent/index.js +++ b/src/components/Common/CommonComponent/index.js @@ -307,6 +307,17 @@ export default class CommonComponent extends Component { this.onBlurText(event, 500); }; + // 判断是否在弹出框 + bInModal = (el) => { + if (!el || !el.classList) { + return false; + } else if (el.classList.contains("ant-modal-root")) { + return true; + } else { + return this.bInModal(el.parentNode); + } + }; + onBlurText = async (event, timeout = 0) => { const currentValue = event?.target?.value; if (currentValue == this.lastValue) { @@ -315,6 +326,23 @@ export default class CommonComponent extends Component { } const { name, record, onQuickFieldUpdate, showConfig } = this.props; + + // 定义需要在弹窗中特殊处理的字段列表 + const modalFields = [ + 'dAdvanceReportQty', + 'dAdvanceLockUpFei', + 'dAdvanceMadeUpFei', + 'iAdvanceLaminatingPaper' + ]; + + // 判断是否是特定字段并且在模态框中,如果是,就不调用 onQuickFieldUpdate + const isInModal = event?.target ? this.bInModal(event.target) : false; + console.log('字段:', showConfig?.sName, '是否在弹窗中:', isInModal); + if (showConfig && modalFields.includes(showConfig.sName) && isInModal) { + this.props.app.globalFun?.onSetMask(false); + return; + } + if (onQuickFieldUpdate && showConfig) { const { sName } = showConfig; const changeValue = { [sName]: currentValue }; -- libgit2 0.22.2