Commit 1c7d254d178171b154d5947d3e0b88c3f91ff1ce
1 parent
99f84149
1.特定字段dAdvanceReportQty'dAdvanceLockUpFei',
'dAdvanceMadeUpFei', 'iAdvanceLaminatingPaper',如果在模态框中,如果再就不调用离开存储过程
Showing
1 changed file
with
28 additions
and
0 deletions
src/components/Common/CommonComponent/index.js
| ... | ... | @@ -307,6 +307,17 @@ export default class CommonComponent extends Component { |
| 307 | 307 | this.onBlurText(event, 500); |
| 308 | 308 | }; |
| 309 | 309 | |
| 310 | + // 判断是否在弹出框 | |
| 311 | + bInModal = (el) => { | |
| 312 | + if (!el || !el.classList) { | |
| 313 | + return false; | |
| 314 | + } else if (el.classList.contains("ant-modal-root")) { | |
| 315 | + return true; | |
| 316 | + } else { | |
| 317 | + return this.bInModal(el.parentNode); | |
| 318 | + } | |
| 319 | + }; | |
| 320 | + | |
| 310 | 321 | onBlurText = async (event, timeout = 0) => { |
| 311 | 322 | const currentValue = event?.target?.value; |
| 312 | 323 | if (currentValue == this.lastValue) { |
| ... | ... | @@ -315,6 +326,23 @@ export default class CommonComponent extends Component { |
| 315 | 326 | } |
| 316 | 327 | |
| 317 | 328 | const { name, record, onQuickFieldUpdate, showConfig } = this.props; |
| 329 | + | |
| 330 | + // 定义需要在弹窗中特殊处理的字段列表 | |
| 331 | + const modalFields = [ | |
| 332 | + 'dAdvanceReportQty', | |
| 333 | + 'dAdvanceLockUpFei', | |
| 334 | + 'dAdvanceMadeUpFei', | |
| 335 | + 'iAdvanceLaminatingPaper' | |
| 336 | + ]; | |
| 337 | + | |
| 338 | + // 判断是否是特定字段并且在模态框中,如果是,就不调用 onQuickFieldUpdate | |
| 339 | + const isInModal = event?.target ? this.bInModal(event.target) : false; | |
| 340 | + console.log('字段:', showConfig?.sName, '是否在弹窗中:', isInModal); | |
| 341 | + if (showConfig && modalFields.includes(showConfig.sName) && isInModal) { | |
| 342 | + this.props.app.globalFun?.onSetMask(false); | |
| 343 | + return; | |
| 344 | + } | |
| 345 | + | |
| 318 | 346 | if (onQuickFieldUpdate && showConfig) { |
| 319 | 347 | const { sName } = showConfig; |
| 320 | 348 | const changeValue = { [sName]: currentValue }; | ... | ... |