diff --git a/src/mes/common/RunningStatus/index.js b/src/mes/common/RunningStatus/index.js index b55c9b0..d7e3d6e 100644 --- a/src/mes/common/RunningStatus/index.js +++ b/src/mes/common/RunningStatus/index.js @@ -232,27 +232,31 @@ const RunningStatusModal = _props => { }); }; - const deviceTargetInfoClick = () => { + const deviceTargetInfoClick = async () => { const config = props.parentProps?.deviceTargetInfoConfig?.gdsconfigformslave?.find( item => item.sName === "sStatusNameSetting" ); if (config) { - const { table1Data = [], slave2Data = [] } = props; - setLoading(true); - setTimeout(() => { - props.onTableBtnClick({ - name: "table1", - record: { ...table1Data[0], ...slave2Data[0] }, - config, - onSuccess: () => { - props.parentProps.onSaveState({ refreshDeviceTargetInfo: true }); - props.app.globalFun.onCloseCommonModal({ type: "commonModal" }); - } - }); - }, 100); - } else { - message.info("请先配置sStatusNameSetting!"); - } + const { table1Data = [], slave2Data = [] } = props; + setLoading(true); + try { + props.onTableBtnClick({ + name: "table1", + record: { ...table1Data[0], ...slave2Data[0] }, + config, + onSuccess: () => { + props.parentProps.onSaveState({ refreshDeviceTargetInfo: true }); + props.app.globalFun.onCloseCommonModal({ type: "commonModal" }); + } + }); + } catch (error) { + console.error("操作失败!:", error); + } finally { + setLoading(false); + } + } else { + message.info("请先配置sStatusNameSetting!"); + } }; const btnProps = {