#
luxiaotao1123
2024-10-18 dcd0b098fe57e1f355f5c178c21402a1d64344a5
#
2个文件已修改
16 ■■■■ 已修改文件
zy-acs-flow/src/map/insight/agv/AgvControl.jsx 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/insight/agv/useCoolHook.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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 (
        <>
zy-acs-flow/src/map/insight/agv/useCoolHook.js
@@ -42,9 +42,12 @@
        debouncedFetch(inputValue);
    }, [inputValue, debouncedFetch]);
    const resetInput = () => setInputValue('');
    return {
        options,
        setInputValue,
        resetInput,
    };
}