#
luxiaotao1123
2024-10-18 769f753ca8581b717bcd27c63c637fe868dd37f1
#
1个文件已修改
39 ■■■■■ 已修改文件
zy-acs-flow/src/map/insight/agv/AgvControl.jsx 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-acs-flow/src/map/insight/agv/AgvControl.jsx
@@ -83,38 +83,71 @@
    const {
        options: endCodeOptions,
        setInputValue: setEndCodeInputValue,
        resetInput: resetEndCodeInput,
    } = useCoolHook('/code/page', 'data');
    const {
        options: startLocOptions,
        setInputValue: setStartLocInputValue,
        resetInput: resetStartLocInput,
    } = useCoolHook('/loc/page', 'locNo');
    const {
        options: endLocOptions,
        setInputValue: setEndLocInputValue,
        resetInput: resetEndLocInput,
    } = useCoolHook('/loc/page', 'locNo');
    const {
        options: startStaOptions,
        setInputValue: setStartStaInputValue,
        resetInput: resetStartStaInput,
    } = useCoolHook('/sta/page', 'staNo');
    const {
        options: endStaOptions,
        setInputValue: setEndStaInputValue,
        resetInput: resetEndStaInput,
    } = useCoolHook('/sta/page', 'staNo');
    useEffect(() => {
        const fieldsToClear = ['startCode', 'endCode', 'startLocNo', 'endLocNo', 'startStaNo', 'endStaNo'];
        const fieldsToClear = ['endCode', 'startLocNo', 'endLocNo', 'startStaNo', 'endStaNo'];
        fieldsToClear.forEach(field => {
            if (!showField(field)) {
                setValue(field, '');
                switch (field) {
                    case 'endCode':
                        resetEndCodeInput();
                        break;
                    case 'startLocNo':
                        resetStartLocInput();
                        break;
                    case 'endLocNo':
                        resetEndLocInput();
                        break;
                    case 'startStaNo':
                        resetStartStaInput();
                        break;
                    case 'endStaNo':
                        resetEndStaInput();
                        break;
                    default:
                        break;
                }
            }
        });
    }, [taskMode, setValue, showField]);
    }, [
        taskMode,
        setValue,
        showField,
        resetEndCodeInput,
        resetStartLocInput,
        resetEndLocInput,
        resetStartStaInput,
        resetEndStaInput
    ]);
    return (
        <>
            <form onSubmit={handleSubmit(onSubmit)}>