From fed47da77f0dc061f41abf1e00ee9e31e51e6790 Mon Sep 17 00:00:00 2001 From: chenxt <10125295+chen-xintao97@user.noreply.gitee.com> Date: Wed, 24 Dec 2025 09:02:27 +0800 Subject: [PATCH] 弹窗关闭后刷新 --- src/components/Common/CommonHooks/useCommonBase.js | 10 ++++++---- src/mes/common/commonModelComponent/index.js | 1 + src/mes/indexMes/index.js | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/Common/CommonHooks/useCommonBase.js b/src/components/Common/CommonHooks/useCommonBase.js index 3b3d4b3..567f557 100644 --- a/src/components/Common/CommonHooks/useCommonBase.js +++ b/src/components/Common/CommonHooks/useCommonBase.js @@ -103,7 +103,9 @@ const useCommonBase = props => { handleSaveState({ formData, ...addState }); }, []); - + useEffect(() => { + // handleSaveState({ refreshTableList: [] }); + }, [props?.refresh]) const { callbackRefresh, callback } = state; // 使用useCallback钩子函数,确保callback函数在callbackRefresh改变时重新调用 useXlyCallback(callbackRefresh, callback, state, () => { @@ -3473,8 +3475,8 @@ const useCommonBase = props => { if (tbName === 'master') { const result = handleMasterChange(tbName, selectConfig.sName, {}, null, null, true, tableData); tableData = result.masterData; - } else if (tbName.includes('slave')){ - tableData.forEach(item=>{ + } else if (tbName.includes('slave')) { + tableData.forEach(item => { item.sParentId = state?.masterData?.sId }) } @@ -3776,7 +3778,7 @@ const useCommonBase = props => { onSelectCommonPopup: handleSelectCommonPopup, onDropDownBlur: handleTableBlur, onDel: handleDel, // 删除 - onBtnExamine: handleAudit, + // onBtnExamine: handleAudit, }; // 切换页面时,加载角标数据 diff --git a/src/mes/common/commonModelComponent/index.js b/src/mes/common/commonModelComponent/index.js index 4ff4806..a6b7a7f 100644 --- a/src/mes/common/commonModelComponent/index.js +++ b/src/mes/common/commonModelComponent/index.js @@ -2076,6 +2076,7 @@ const CommonRepairComponent = props => { props.onSaveState({ [`${modalName}Params`]: {} }); + props.onRefresh() }; const onOk = () => { diff --git a/src/mes/indexMes/index.js b/src/mes/indexMes/index.js index 2fd3fae..9747c46 100644 --- a/src/mes/indexMes/index.js +++ b/src/mes/indexMes/index.js @@ -1184,7 +1184,7 @@ const CommonModal = () => { onCancel: () => { window.bXingchejiluModal = false; window.deviceTargetInfoModal = false; - dispatch(["saveState", { [`${sName}Visible`]: false }]); + dispatch(["saveState", { [`${sName}Visible`]: false, refresh: true}]); }, parentProps: hooksProps[`${sName}parentProps`], modalCallback: hooksProps[`${sName}modalCallback`] -- libgit2 0.22.2