Commit fed47da77f0dc061f41abf1e00ee9e31e51e6790

Authored by chenxt
1 parent edd37f0b

弹窗关闭后刷新

src/components/Common/CommonHooks/useCommonBase.js
... ... @@ -103,7 +103,9 @@ const useCommonBase = props => {
103 103  
104 104 handleSaveState({ formData, ...addState });
105 105 }, []);
106   -
  106 + useEffect(() => {
  107 + // handleSaveState({ refreshTableList: [] });
  108 + }, [props?.refresh])
107 109 const { callbackRefresh, callback } = state;
108 110 // 使用useCallback钩子函数,确保callback函数在callbackRefresh改变时重新调用
109 111 useXlyCallback(callbackRefresh, callback, state, () => {
... ... @@ -3473,8 +3475,8 @@ const useCommonBase = props => {
3473 3475 if (tbName === 'master') {
3474 3476 const result = handleMasterChange(tbName, selectConfig.sName, {}, null, null, true, tableData);
3475 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 3480 item.sParentId = state?.masterData?.sId
3479 3481 })
3480 3482 }
... ... @@ -3776,7 +3778,7 @@ const useCommonBase = props => {
3776 3778 onSelectCommonPopup: handleSelectCommonPopup,
3777 3779 onDropDownBlur: handleTableBlur,
3778 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 2076 props.onSaveState({
2077 2077 [`${modalName}Params`]: {}
2078 2078 });
  2079 + props.onRefresh()
2079 2080 };
2080 2081  
2081 2082 const onOk = () => {
... ...
src/mes/indexMes/index.js
... ... @@ -1184,7 +1184,7 @@ const CommonModal = () => {
1184 1184 onCancel: () => {
1185 1185 window.bXingchejiluModal = false;
1186 1186 window.deviceTargetInfoModal = false;
1187   - dispatch(["saveState", { [`${sName}Visible`]: false }]);
  1187 + dispatch(["saveState", { [`${sName}Visible`]: false, refresh: true}]);
1188 1188 },
1189 1189 parentProps: hooksProps[`${sName}parentProps`],
1190 1190 modalCallback: hooksProps[`${sName}modalCallback`]
... ...