#
Junjie
2024-04-13 e9a4418c14ef68fb454300b092c413e8df259ec2
zy-asrs-flow/src/pages/map/components/configSettings.jsx
@@ -3,7 +3,6 @@
import { FormattedMessage, useIntl, useModel } from '@umijs/max';
import { createStyles } from 'antd-style';
import * as Utils from '../utils'
import * as PIXI from 'pixi.js';
const useStyles = createStyles(({ token, css }) => {
@@ -14,6 +13,8 @@
    const { styles } = useStyles();
    const { curSprite, configForm: form } = props;
    const [showLiftNoItem, setShowLiftNoItem] = React.useState(false);
    useEffect(() => {
        form.resetFields();
        if (curSprite) {
@@ -21,6 +22,7 @@
                shelfType: Utils.SHELF_TYPE.STORE,
                ...curSprite.data
            })
            setShowLiftNoItem(form.getFieldValue('shelfType') === Utils.SHELF_TYPE.LIFT);
        }
    }, [props, form]);
@@ -77,6 +79,10 @@
                                    no: ''
                                });
                            }
                            break;
                        case 'shelfType':
                            const shelfType = form.getFieldValue('shelfType');
                            setShowLiftNoItem(shelfType === Utils.SHELF_TYPE.LIFT);
                            break;
                        default:
                            break;
@@ -215,12 +221,41 @@
                                        value: Utils.SHELF_TYPE.TRACK
                                    },
                                    {
                                        label: intl.formatMessage({ id: 'map.settings.shelf.lift', defaultMessage: '提升机' }),
                                        value: Utils.SHELF_TYPE.LIFT
                                    },
                                    {
                                        label: intl.formatMessage({ id: 'map.settings.shelf.charge', defaultMessage: '充电站' }),
                                        value: Utils.SHELF_TYPE.CHARGE
                                    },
                                    {
                                        label: intl.formatMessage({ id: 'map.settings.shelf.diable', defaultMessage: '禁用' }),
                                        value: Utils.SHELF_TYPE.DISABLE
                                    },
                                ]}
                            />
                        </Form.Item>
                        {showLiftNoItem && (
                            <>
                                <Form.Item
                                    name='liftNo'
                                    label={intl.formatMessage({ id: 'map.settings.lift.no', defaultMessage: '提升机编号' })}
                                    rules={[
                                        {
                                            required: true,
                                        },
                                    ]}
                                >
                                    <InputNumber
                                        style={{
                                            width: '50%',
                                        }}
                                    />
                                </Form.Item>
                            </>
                        )}
                        <Form.Item
                            label={intl.formatMessage({ id: 'map.settings.shelf.space', defaultMessage: '间距' })}
                        >
@@ -290,6 +325,26 @@
                    </>
                )}
                {curSprite?.data?.type === Utils.SENSOR_TYPE.CONVEYOR && (
                    <>
                        <Form.Item
                            name='plcNo'
                            label={intl.formatMessage({ id: 'map.settings.conveyor.plc.no', defaultMessage: 'PLC编号' })}
                            rules={[
                                {
                                    required: true,
                                },
                            ]}
                        >
                            <InputNumber
                                style={{
                                    width: '50%',
                                }}
                            />
                        </Form.Item>
                    </>
                )}
                {curSprite?.data?.type === Utils.SENSOR_TYPE.POINT && (
                    <>
                        <Form.Item