#
luxiaotao1123
2024-03-25 077ada8ac2c47b383b84398a3951b653767a6364
#
1个文件已修改
88 ■■■■ 已修改文件
zy-asrs-flow/src/pages/map/batch/modify.jsx 88 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/map/batch/modify.jsx
@@ -3,6 +3,7 @@
import {
    ProForm,
    StepsForm,
    ProFormSelect
} from '@ant-design/pro-components';
import { FormattedMessage, useIntl, useModel } from '@umijs/max';
import { createStyles } from 'antd-style';
@@ -29,19 +30,53 @@
    const [form] = Form.useForm();
    const [currentStep, setCurrentStep] = useState(0);
    const [uuidsOfBatchSprites, setUuidsOfBatchSprites] = useState([]);
    const resetForm = () => {
        form.resetFields();
        form.setFieldsValue({
            shelfType: Utils.SHELF_TYPE.STORE
        })
        setCurrentStep(0);
    };
    useEffect(() => {
        console.log(batchSprites);
        resetForm();
    }, [props]);
        if (batchSprites?.length > 0) {
            setUuidsOfBatchSprites(batchSprites?.filter(item => {
                return item.data?.type === Utils.SENSOR_TYPE.SHELF
            }).map(item => {
                return item.data?.no;
            }));
        } else {
            setUuidsOfBatchSprites([]);
        }
    }, [batchSprites]);
    const handleOk = (values) => {
        console.log(values);
        if (batchSprites?.length > 0) {
            // loading
            batchSprites.forEach(sprite => {
                if (sprite.data?.type === Utils.SENSOR_TYPE.SHELF) {
                    if (values.shelfType) {
                    }
                    Utils.showSheflType(sprite);
                }
            });
            return false;
        } else {
            return false;
        }
    }
    useEffect(() => {
        console.log(currentStep);
        if (currentStep === 1) {
            form.setFieldsValue({
                shelfType: Utils.SHELF_TYPE.STORE
            });
        }
    }, [currentStep]);
    return (
@@ -70,6 +105,9 @@
                        return props.step === 2 ? [] : dom;
                    },
                }}
                initialValues={{
                    shelfType: Utils.SHELF_TYPE.STORE
                }}
            >
                {/************************* first ****************************/}
                <StepsForm.StepForm
@@ -79,16 +117,9 @@
                        return true;
                    }}
                >
                    <ProForm.Item
                    >
                    <ProForm.Item>
                        <ShowJson
                            data={
                                batchSprites?.filter(item => {
                                    return item.data?.type === Utils.SENSOR_TYPE.SHELF
                                }).map(item => {
                                    return item.data?.no;
                                })
                            }
                            data={uuidsOfBatchSprites}
                            height='500px'
                            jsonType={0}
                        />
@@ -98,12 +129,9 @@
                <StepsForm.StepForm
                    name="checkbox"
                    title={intl.formatMessage({ id: 'map.settings.batch.set.params', defaultMessage: '设置参数' })}
                    onFinish={(values) => {
                        console.log(values);
                        return true;
                    }}
                    onFinish={handleOk}
                >
                    <ProForm.Item
                    {/* <ProForm.Item
                        name='shelfType'
                        label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '类型' })}
                        rules={[
@@ -130,7 +158,31 @@
                            ]}
                            defaultValue={0}
                        />
                    </ProForm.Item>
                    </ProForm.Item> */}
                    <ProFormSelect
                        name='shelfType'
                        label={intl.formatMessage({ id: 'map.settings.shelf.type', defaultMessage: '类型' })}
                        rules={[
                            {
                                required: true,
                            },
                        ]}
                        style={{ width: 120 }}
                        options={[
                            {
                                label: intl.formatMessage({ id: 'map.settings.shelf.store', defaultMessage: '库位' }),
                                value: Utils.SHELF_TYPE.STORE
                            },
                            {
                                label: intl.formatMessage({ id: 'map.settings.shelf.track', defaultMessage: '轨道' }),
                                value: Utils.SHELF_TYPE.TRACK
                            },
                            {
                                label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '禁用' }),
                                value: Utils.SHELF_TYPE.DISABLE
                            },
                        ]}
                    />
                    <ProForm.Item
                        label={intl.formatMessage({ id: 'map.settings.shelf.space', defaultMessage: '间距' })}
                    >