Commit fed47da77f0dc061f41abf1e00ee9e31e51e6790
1 parent
edd37f0b
弹窗关闭后刷新
Showing
3 changed files
with
8 additions
and
5 deletions
src/components/Common/CommonHooks/useCommonBase.js
| @@ -103,7 +103,9 @@ const useCommonBase = props => { | @@ -103,7 +103,9 @@ const useCommonBase = props => { | ||
| 103 | 103 | ||
| 104 | handleSaveState({ formData, ...addState }); | 104 | handleSaveState({ formData, ...addState }); |
| 105 | }, []); | 105 | }, []); |
| 106 | - | 106 | + useEffect(() => { |
| 107 | + // handleSaveState({ refreshTableList: [] }); | ||
| 108 | + }, [props?.refresh]) | ||
| 107 | const { callbackRefresh, callback } = state; | 109 | const { callbackRefresh, callback } = state; |
| 108 | // 使用useCallback钩子函数,确保callback函数在callbackRefresh改变时重新调用 | 110 | // 使用useCallback钩子函数,确保callback函数在callbackRefresh改变时重新调用 |
| 109 | useXlyCallback(callbackRefresh, callback, state, () => { | 111 | useXlyCallback(callbackRefresh, callback, state, () => { |
| @@ -3473,8 +3475,8 @@ const useCommonBase = props => { | @@ -3473,8 +3475,8 @@ const useCommonBase = props => { | ||
| 3473 | if (tbName === 'master') { | 3475 | if (tbName === 'master') { |
| 3474 | const result = handleMasterChange(tbName, selectConfig.sName, {}, null, null, true, tableData); | 3476 | const result = handleMasterChange(tbName, selectConfig.sName, {}, null, null, true, tableData); |
| 3475 | tableData = result.masterData; | 3477 | tableData = result.masterData; |
| 3476 | - } else if (tbName.includes('slave')){ | ||
| 3477 | - tableData.forEach(item=>{ | 3478 | + } else if (tbName.includes('slave')) { |
| 3479 | + tableData.forEach(item => { | ||
| 3478 | item.sParentId = state?.masterData?.sId | 3480 | item.sParentId = state?.masterData?.sId |
| 3479 | }) | 3481 | }) |
| 3480 | } | 3482 | } |
| @@ -3776,7 +3778,7 @@ const useCommonBase = props => { | @@ -3776,7 +3778,7 @@ const useCommonBase = props => { | ||
| 3776 | onSelectCommonPopup: handleSelectCommonPopup, | 3778 | onSelectCommonPopup: handleSelectCommonPopup, |
| 3777 | onDropDownBlur: handleTableBlur, | 3779 | onDropDownBlur: handleTableBlur, |
| 3778 | onDel: handleDel, // 删除 | 3780 | onDel: handleDel, // 删除 |
| 3779 | - onBtnExamine: handleAudit, | 3781 | + // onBtnExamine: handleAudit, |
| 3780 | }; | 3782 | }; |
| 3781 | 3783 | ||
| 3782 | // 切换页面时,加载角标数据 | 3784 | // 切换页面时,加载角标数据 |
src/mes/common/commonModelComponent/index.js
| @@ -2076,6 +2076,7 @@ const CommonRepairComponent = props => { | @@ -2076,6 +2076,7 @@ const CommonRepairComponent = props => { | ||
| 2076 | props.onSaveState({ | 2076 | props.onSaveState({ |
| 2077 | [`${modalName}Params`]: {} | 2077 | [`${modalName}Params`]: {} |
| 2078 | }); | 2078 | }); |
| 2079 | + props.onRefresh() | ||
| 2079 | }; | 2080 | }; |
| 2080 | 2081 | ||
| 2081 | const onOk = () => { | 2082 | const onOk = () => { |
src/mes/indexMes/index.js
| @@ -1184,7 +1184,7 @@ const CommonModal = () => { | @@ -1184,7 +1184,7 @@ const CommonModal = () => { | ||
| 1184 | onCancel: () => { | 1184 | onCancel: () => { |
| 1185 | window.bXingchejiluModal = false; | 1185 | window.bXingchejiluModal = false; |
| 1186 | window.deviceTargetInfoModal = false; | 1186 | window.deviceTargetInfoModal = false; |
| 1187 | - dispatch(["saveState", { [`${sName}Visible`]: false }]); | 1187 | + dispatch(["saveState", { [`${sName}Visible`]: false, refresh: true}]); |
| 1188 | }, | 1188 | }, |
| 1189 | parentProps: hooksProps[`${sName}parentProps`], | 1189 | parentProps: hooksProps[`${sName}parentProps`], |
| 1190 | modalCallback: hooksProps[`${sName}modalCallback`] | 1190 | modalCallback: hooksProps[`${sName}modalCallback`] |