From d73579737607d1d970f80f7a51f7704dc55d16fe Mon Sep 17 00:00:00 2001 From: pengm <674192343@qq.com> Date: Tue, 17 Mar 2026 14:18:53 +0800 Subject: [PATCH] 1.处理设备状态确定后,调用存储过程,按钮状态没回置问题 --- src/mes/common/RunningStatus/index.js | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) 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 = { -- libgit2 0.22.2