Update ModalTerminal.tsx

This commit is contained in:
nguyentrungthat 2026-02-05 09:22:05 +07:00
parent c24febf32a
commit daddb7d812
1 changed files with 9 additions and 4 deletions

View File

@ -147,6 +147,7 @@ const ModalTerminal = ({
setDataTicket(INIT_TICKET); setDataTicket(INIT_TICKET);
setValueBaud(""); setValueBaud("");
setActiveStep(0); setActiveStep(0);
setActiveTabs("general");
} }
}, [opened, line?.tickets]); }, [opened, line?.tickets]);
@ -605,7 +606,7 @@ const ModalTerminal = ({
active={activeStep} active={activeStep}
onStepClick={(step) => { onStepClick={(step) => {
if (!line) return; if (!line) return;
if (step === 0) { if (step === 0 && !isDisable) {
const dpelp = scenarios?.find( const dpelp = scenarios?.find(
(el) => el.title.toUpperCase() === "DPELP" (el) => el.title.toUpperCase() === "DPELP"
); );
@ -633,7 +634,7 @@ const ModalTerminal = ({
setIsDisable(false); setIsDisable(false);
}, 10000); }, 10000);
} }
if (step === 1) { if (step === 1 && !isDisable) {
setActiveTabs("physical"); setActiveTabs("physical");
socket?.emit("run_physical_test", { socket?.emit("run_physical_test", {
lineId: line?.id, lineId: line?.id,
@ -644,7 +645,7 @@ const ModalTerminal = ({
setIsDisable(false); setIsDisable(false);
}, 15000); }, 15000);
} }
if (step === 2 && !isDisable) { if (activeStep === 2 && !isDisable) {
setIsDisable(true); setIsDisable(true);
setTimeout(() => { setTimeout(() => {
setIsDisable(false); setIsDisable(false);
@ -669,7 +670,11 @@ const ModalTerminal = ({
<Stepper.Step <Stepper.Step
disabled={isDisable} disabled={isDisable}
label="Completed" label="Completed"
description="Click to send report" description={
activeStep !== 2
? "Complete all to send report"
: "Click to send report"
}
></Stepper.Step> ></Stepper.Step>
</Stepper> </Stepper>
<Flex></Flex> <Flex></Flex>