Commit d73579737607d1d970f80f7a51f7704dc55d16fe
1 parent
01b7daac
1.处理设备状态确定后,调用存储过程,按钮状态没回置问题
Showing
1 changed file
with
21 additions
and
17 deletions
src/mes/common/RunningStatus/index.js
| ... | ... | @@ -232,27 +232,31 @@ const RunningStatusModal = _props => { |
| 232 | 232 | }); |
| 233 | 233 | }; |
| 234 | 234 | |
| 235 | - const deviceTargetInfoClick = () => { | |
| 235 | + const deviceTargetInfoClick = async () => { | |
| 236 | 236 | const config = props.parentProps?.deviceTargetInfoConfig?.gdsconfigformslave?.find( |
| 237 | 237 | item => item.sName === "sStatusNameSetting" |
| 238 | 238 | ); |
| 239 | 239 | if (config) { |
| 240 | - const { table1Data = [], slave2Data = [] } = props; | |
| 241 | - setLoading(true); | |
| 242 | - setTimeout(() => { | |
| 243 | - props.onTableBtnClick({ | |
| 244 | - name: "table1", | |
| 245 | - record: { ...table1Data[0], ...slave2Data[0] }, | |
| 246 | - config, | |
| 247 | - onSuccess: () => { | |
| 248 | - props.parentProps.onSaveState({ refreshDeviceTargetInfo: true }); | |
| 249 | - props.app.globalFun.onCloseCommonModal({ type: "commonModal" }); | |
| 250 | - } | |
| 251 | - }); | |
| 252 | - }, 100); | |
| 253 | - } else { | |
| 254 | - message.info("请先配置sStatusNameSetting!"); | |
| 255 | - } | |
| 240 | + const { table1Data = [], slave2Data = [] } = props; | |
| 241 | + setLoading(true); | |
| 242 | + try { | |
| 243 | + props.onTableBtnClick({ | |
| 244 | + name: "table1", | |
| 245 | + record: { ...table1Data[0], ...slave2Data[0] }, | |
| 246 | + config, | |
| 247 | + onSuccess: () => { | |
| 248 | + props.parentProps.onSaveState({ refreshDeviceTargetInfo: true }); | |
| 249 | + props.app.globalFun.onCloseCommonModal({ type: "commonModal" }); | |
| 250 | + } | |
| 251 | + }); | |
| 252 | + } catch (error) { | |
| 253 | + console.error("操作失败!:", error); | |
| 254 | + } finally { | |
| 255 | + setLoading(false); | |
| 256 | + } | |
| 257 | + } else { | |
| 258 | + message.info("请先配置sStatusNameSetting!"); | |
| 259 | + } | |
| 256 | 260 | }; |
| 257 | 261 | |
| 258 | 262 | const btnProps = { | ... | ... |