#
luxiaotao1123
2024-10-18 dcd0b098fe57e1f355f5c178c21402a1d64344a5
zy-acs-flow/src/map/insight/agv/AgvControl.jsx
@@ -25,7 +25,7 @@
    const theme = useTheme();
    const translate = useTranslate();
    const { control, handleSubmit, reset, watch } = useForm({
    const { control, handleSubmit, reset, watch, setValue } = useForm({
        defaultValues: {
            taskMode: 'MOVE',
            startCode: '',
@@ -49,7 +49,7 @@
    useEffect(() => {
        reset();
    }, [curAgvNo]);
    }, [curAgvNo, reset]);
    const onSubmit = (data) => {
        if (curAgvNo) {
@@ -105,6 +105,15 @@
        setInputValue: setEndStaInputValue,
    } = useCoolHook('/sta/page', 'staNo');
    useEffect(() => {
        const fieldsToClear = ['startCode', 'endCode', 'startLocNo', 'endLocNo', 'startStaNo', 'endStaNo'];
        fieldsToClear.forEach(field => {
            if (!showField(field)) {
                setValue(field, '');
            }
        });
    }, [taskMode, setValue, showField]);
    return (
        <>