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 };